6. Code Coverage
Is a measure used in software testing. It describes the degree to
which the source code of a program has been tested.
https://en.wikipedia.org/wiki/Code_coverage
12. Why?
Why do we need Code Coverage
____________________________________________
To Ensure Quality
Minimize Bugs/Defects
Early detection of flaws
Avoid Cost due to Rework and Delay
Higher Confidence
Everyone Happy
13. Software Negligence & Testing Coverage, Cem Kraner, 1995
The question is, what's wrong with this argument?
15. How to reach 100% Code Coverage
____________________________________________
Every line of source code covered
Every underlying dependency is covered
Every possible representative input is covered
Every branch, condition and statement is covered
Every unexpected and error case is covered
17. Do we really need 100% Code Coverage?
____________________________________________
Every high risk area is covered
Every Sprint we increase our test suite and coverage
Every test is valuable
18. Program
Mutant 1
Mutant 2
Mutant 3
Test
Suite
4. Compare
Test
Suite
Same
Same
Different
(“killed”)
1. Test
3. Test
Test Outputs
Test Outputs
2. Mutation
Operation
Adequacy:
= #Different / total
= 1/3
= 33%
Mutation Testing
Reruns unit tests against modified version of your code