Skip to content

Commit 170f531

Browse files
committed
Update README.md
1 parent f1dccab commit 170f531

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ val status = if (age < 18) "No beer" else "Beer for you"
1818
```
1919

2020
If 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

2331
That's why in Scales we focus on statement coverage, and don't even include line coverage as a metric.
2432
This is a paradigm shift that we hope will take hold.

0 commit comments

Comments
 (0)