Skip to main content

Description of the method

Task 1

section 9.3.1, part 1. Translate the below text and delete the picture

image.png

Task 2

section 9.3.1, part 2. Translate the below text and delete the picture

image.png

Task 3

The error hypothesis states that errors can occur due to a specific control flow, determined by decisions made in decision instructions. Let's consider the following simple example from listing 9.2.


1 x:=0;
2 if (a>b) then
3   x:=x+1
4 endif
5 y:=100/x

Listing 9.2. A simple program

Assuming values of a and b such that a > b will cause instructions 1, 2, 3, 4, 5 to be executed and will result in full instruction coverage of this fragment. However, note that if instruction 3 is not executed, the variable x will retain a value of 0, and in line 5, we divide by x. Division by 0 is not allowed and performing such an operation may result in a crash or unexpected behavior of the program or operating system. By applying the instruction coverage criterion, we might not foresee testing the program in this way. However, these situations can be verified using the decision coverage criterion. It requires the existence of at least one test case in which the predicate in line 2 has a false value. This causes division by 0 in line 5 and a crash.

Test conditions in this method are basic blocks containing decisions, such as if, for, while, switch-case instructions, etc. For a given test condition, the coverage elements are all possible logical values (true and false) that the decision corresponding to that condition can take. If the program does not contain branches, the test conditions and coverage elements are instructions, just as in the instruction coverage criterion.

Table 9.6 summarizes the decision testing method.

Task 4

section 9.3.1, part 4.3. Translate the below text and delete the picture

image.pngimage.png

Task 4

Decision Cover – results of results that have been developed by the test set. 100% decision coverage implies 100% transformation coverage

Test conditions -> CFG vertices representing decisions
Coverage elements -> CFG edges of the decision result
Coverage criterion -> critical decision resolution once confirmed meaning of true coverage and once false value
Coverage → p = number of CFG decision edges covered by tests / number of all CFG decision edges * 100%

(In the case of CFG with 1 block 0% or 100% as a result of application of the instruction)