Constraint-based Testing
Software Engineering Gordon Fraser • Saarland University
Based on slides by Arnaud Gotlieb & Koushik Sen
But how to create the tests?
Statement testing Branch testing Basic condition testing MCDC testing Compound condition testing Path testing Loop boundary testing Branch and condition testing LCSAJ testing Boundary interior testing Practical Criteria Theoretical Criteria subsumes Statement testing Branch testing All-p uses All-p-some-c All-defs All-c-some-p All-c uses All uses All-DU paths Path testingCC PC GACC CACC RACC CoC RICC GICC
!" #$%&!'()*&!+!(,#-.(./ #$%&!'.)*&!+!.(#-.(./ 0,*!-1!+!2/ #$%&!#/ #!+!'()*&/ 03!4#!++!5657!"!! '.)*&!+!5!5/ 8! 9$0:(!4'()*&7!" ;&<( '.)*&!+!5=25/ &(*<&,!-1/ 8 >%:?( ;&<( 0,*!.0@0*A$0@$!+!B(CAD%:<(?E'466()*&7F/ 0,*!.0@0*A:-9!+!B(CAD%:<(?E'466()*&7F/ 03!4.0@0*A$0@$!++!GH!II!.0@0*A:-9!++!GH7!" ;&<(- 1!+!H/
So many different test objectives...
Test Data Generation
Given a function and a location we want to reach, how do we derive inputs to the function that lead the control flow to the desired statement? Deduce Think Search Guess
We are still looking at the problem
- f deriving input data that will lead
execution to some particular point in the control flow that is interesting for testing reasons. Today, we will consider constraint based testing, which allows us to reason about the precise conditions under which a test goal is satisfied, and allows us to deduce test data satisfying the test goals.