• Keine Ergebnisse gefunden

Whitebox Testing Exercise

N/A
N/A
Protected

Academic year: 2022

Aktie "Whitebox Testing Exercise"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Chair for Applied Software Engineering Prof. B. Brügge, Ph. D.

Software Engineering Exercise, SS2009 Solution 4

1/1

Whitebox Testing Exercise

1) Coverage Metrics

• Statement coverage

• Branch coverage

• Condition coverage o Single

o Multiple o Minimum

• Path coverage

2) Control flow graph

Figure one shows a valid control flow graph for the given source code. Note that some states have been collapsed.

Figure 1: Control flow graph for exercise 1

3) Test cases on control flow graphs a) Design

You can design a test case on a control flow graph by specifying a sequence of edges.

A sequence that will execute every statement is:

1, 2, 3, 5, 6, 7, 13, 2, 4, 8, 9, 10, 14, 2, 4, 8, 11, 12, 13, 14

(2)

Chair for Applied Software Engineering Prof. B. Brügge, Ph. D.

Software Engineering Exercise, SS2009 Solution 4

2/2 b)

Implementation

The test case from a) can be implemented by using he following parameter assignments to run the code to be tested:

a=2 b=0 c=2

4) Statement vs. branch coverage

Test case: 1, 2

Statement coverage: 100%

Branch coverage: 50%

Additional test case to reach 100% branch coverage: 3

5) Condition coverage vs. branch coverage

Test cases:

• 1, 2 with a>4 and b>4

• 3 with a<=4 and b>4 Branch coverage: 100%

Condition coverage: 75% (b is never false)

Additional test case to reach 100% condition coverage: 3 with a<=4 and b<=4

6) Path coverage vs. branch coverage

If the loop is always of a fixed length, one can reach 100% path coverage. Otherwise one cannot know how many times the loop will possible run and therefore one cannot design test cases for every possible path.

Abbildung

Figure one shows a valid control flow graph for the given source code. Note that some  states have been collapsed

Referenzen

ÄHNLICHE DOKUMENTE

Software Project (code LTAT.05.005) [Sofb] is a course meant for bachelor’s students of the Computer Science curriculum and is also part of the Software Engineering elective

A method satisfies Modular Continuity if, in the software architectures that it yields, a small change in the problem specification will trigger a change of just one module, or

•  When designing a library, we design (part of) the language that client code will speak.. •  Our choices affect how easy/hard it is to design programs with

•  die bestehende Software an veränderte Bedürfnisse oder Umweltbedingungen anzupassen!. •  oder die bestehende Software um neue Fähigkeiten

Schließlich sollen Gesundheitskarte und elektronische Datennetze auch dabei helfen, Kosten einzusparen, die im Gesundheitswesen entstehen, weil Verwal- tungsvorgänge durch die

❍   Beim Prüfen erkannte Fehler müssen anschließend korrigiert werden (indem die verursachenden Defekte erkannt und behoben werden)!... Software

●  Entwicklungsteam schätzt Aufwand pro Position und wählt Positionen für anstehende Iteration aus (scrum backlog)!. ❍   Durchführung

●  Wie soll das Risiko im Projekt verfolgt werden?. ●  Kann das Risiko auf Dritte