Parts of Speech, Predicate Nominatives, and Predicate Adjectives
Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage...
-
Upload
barbra-dean -
Category
Documents
-
view
219 -
download
1
Transcript of Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage...
![Page 1: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/1.jpg)
Predicate Complete Testing*
Thomas Ball
* Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004-
28, Microsoft Research
![Page 2: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/2.jpg)
Testing Definitions
Statement Every statement is executed by the test set
Path Every control path is executed by the test set
Predicate Every logical predicate is executed by the test
setComplete
Some notion that the test set is “exhaustive”
![Page 3: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/3.jpg)
Theoretical Goals
Control Flow metrics Statement, branch, multiple condition,
predicate, path, linear code sequence and jumpPredicate Complete Testing
Cover all reachable observable states Bound the number tests Know when to stop (when do we have a
complete test set)Does PCT actually produce tests?
![Page 4: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/4.jpg)
Using Boolean Programs
Recall that BP transforms the original program into a program of its Boolean predicates
A BP state is some Boolean assignment of all predicates
The BP state space is finite (<= m*2^n)Some BP states are observableSome BP states are reachable
![Page 5: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/5.jpg)
Boolean Program
![Page 6: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/6.jpg)
Reachable States
![Page 7: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/7.jpg)
Reachability Graph
![Page 8: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/8.jpg)
Formalizing the state abstraction
![Page 9: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/9.jpg)
Boolean Program II
![Page 10: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/10.jpg)
Upper and Lower bounds for R
R – set of reachable statesU – upper bound for R via may-transitionsLp – pessimistic lower bound for R via
must+ transitions, a may transition, and must- transitions
Lo – optimistic lower bound for R, with the assumption that the program does not diverge
![Page 11: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/11.jpg)
Algorithm
Using algorithms for computing L and U, |L|==|U| => the abstraction accurately encodes all the paths of R.
Generate all paths for L in the graph
![Page 12: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/12.jpg)
Test Generation
![Page 13: Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR-2004- 28,](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649cc55503460f9498e1d7/html5/thumbnails/13.jpg)
Discussion