DevOpsDays Jakarta 2020
Code Coverage – A Dump Metric
by Thomas Rothe
BRI Corporate University, March 12th 2020
CODE COVERAGE – A DUMP METRIC
For Code Quality Thomas Rothe
Enterprise DevOps Coach
Thomas Rothe
Code Coverage is not a bad metric
- It's just a dump one!
Fixing (and finding) bugs late is costly
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
SourcecodeUnitTestCC
SourcecodeUnitTestCC
The Sneaky Developer The Metric Lovin’ Manager
SourcecodeUnitTestCC
SourcecodeUnitTestCC
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
Software Negligence & Testing Coverage, Cem Kraner, 1995
The question is, what's wrong with this argument?
The Tragedy
of 100%
Code Coverage
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
Journey to Success ….
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
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
The Good
Developer
linkedin.com/in/throthe/
thomas.rothe@devops.co.id
Thank You
DevOpsDays Jakarta 2020
Venue Sponsor
DevOpsDays Jakarta 2020
Platinum Sponsors
DevOpsDays Jakarta 2020
Gold Sponsors
DevOpsDays Jakarta 2020
Silver Sponsors
DevOpsDays Jakarta 2020
University Partners
DevOpsDays Jakarta 2020
Community Partners
DevOpsDays Jakarta 2020
Media Partners
Stay Connected
@IDDevOps @IDDevOps @IDDevOps
DevOps Indonesia
DevOps Indonesia DevOps Indonesia
THANK YOU !
Alone We are smart, together We are brilliant

Code Coverage - A Dump Metric