Path Testing Flashcards
Primary applicable to
Component testing
When a program is executed
It follows various paths
What are we concerned with in path testing
Identifying possible paths through code and identifying test cases with knowledge of possible paths in advance
Bug assumption path testing
Assume program either makes right decision at wrong time or makes wrong decision at right time , the wrong path
Statement coverage
Most basic
Every statement executed at least once
Branch coverage
More refined
Every outcome of every decision executed at least once
Coverage measured as percentage
Statement coverage (statements executed / total statements) x 100 easiest to achieve
Branch coverage = (branch outcomes executed / total branch outcomes) * 100
Path coverage = (paths executed / total number of paths) x 100 hardest to achieve
Procedure for statement testing
Identify all executable statements
Trace execution from first statement
For each decision encountered choose the true outcome first
Make sure all statements covered, if not keep covering
Repeat above until all statements covered by at least one test case
Record. Variable values required to force execution path you take
From paths to test cases
Process of choosing input values is called sensitising the path
Choose easiest pasty’s
Statement testing
Executable statements do something
Statement coverage requires you to exercise each statement at least once
Every statement of code executed at least once
Decision testing
Excercise all outcomes of decision in code
Reuse test cases for statement and add new ones
Trace on path through code then pick off remaining decisions with new tests
Path coverage
Ensures covering all paths from start to end