

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of white box testing and different software coverage criteria, including statement coverage, edge coverage, condition coverage, and path coverage. It explains how to select a test set to achieve desired coverage and discusses the weaknesses of each criterion. The document also touches upon the infeasibility problem and the importance of considering the entire specification.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli 1
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli 2
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli (^3)
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli (^4)
read (x); read (y); if x > 0 then write ("1"); else write ("2"); end if; if y > 0 then write ("3"); else write ("4"); end if;
{<x = 2, y = 3>, <x = - 13, y = 51>, <x = 97, y = 17>, <x = - 1, y = - 1>} covers all statements
{<x = - 13, y = 51>, <x = 2, y = - 3>} is minimal
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli (^5)
if x < 0 then x := -x; end if; z := x;
{<x=-3} covers all statements
it does not exercise the case when x is positive and the then branch is not entered
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli (^6)
this requires formalizing the concept of the control graph, and how to construct it
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli 7
G 1 G 2 G 1
G 1
G 1 G 2
I/O, assignment, or procedure call if-then-else if-then
while loop
two sequential statements
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli 8
a sequence of edges can be collapsed into just one edge
k
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli (^9)
begin read (x); read (y); while x ≠ y loop if x > y then x := x - y; else y := y - x; end if; end loop; gcd : = x; end;
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli (^10)
found := false; counter := 1; while (not found) and counter < number_of_items loop if table (counter) = desired_element then found := true; end if; counter := counter + 1; end loop; if found then write ("the desired element is in the table"); else write ("the desired element is not in the table"); end if;
test cases: (1) empty table, (2) table with 3 items, second of which is the item to look for do not discover error (< instead of ≤ )
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli (^11)
Slides adatped from those of Ghezzi, Jazayeri, and Mandrioli (^12)
{<x = 0, z = 1>, <x = 1, z = 3>} causes the execution of all edges, but fails to expose the risk of a division by zero
if x ≠ 0 then y := 5; else z := z - x; end if; if z > 1 then z := z / x; else z := 0; end if;