File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,15 @@ val status = if (age < 18) "No beer" else "Beer for you"
1818```
1919
2020If you had a unit test that ran through the value 18 you would get 100% line coverage
21- yet you only have 50% statement coverage
21+ yet you only have 50% statement coverage.
22+
23+ Let's expand this example out to be multifacted, albeit somewhat contrived:
24+
25+ ```
26+ val status = if (religion == "Pentecostalist") "Beer forbidden" else if (age < 18) "Underage" else "Beer for you"
27+ ```
28+
29+ Now we would get 100% code coverage for passing in the values ("Buddist", 34).
2230
2331That's why in Scales we focus on statement coverage, and don't even include line coverage as a metric.
2432This is a paradigm shift that we hope will take hold.
You can’t perform that action at this time.
0 commit comments