Skip to content

Commit f1dccab

Browse files
committed
Update README.md
1 parent c73ec77 commit f1dccab

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ scales
44
Scales is a free Apache licensed code coverage tool for scala that offers statement and branch coverage.
55
Scales is available for both maven and sbt.
66

7+
### Statement Coverage
8+
9+
In traditional code coverage tools, line coverage has been the main metric.
10+
This is fine for languages such as Java which are very verbose and very rarely have more than one
11+
statement per line, and more usually have one statement spread across multiple lines.
12+
13+
In powerful, expressive languages like Scala, quite often multiple statements, or even branches
14+
are included on a single line, eg a very simple example:
15+
16+
```
17+
val status = if (age < 18) "No beer" else "Beer for you"
18+
```
19+
20+
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
22+
23+
That's why in Scales we focus on statement coverage, and don't even include line coverage as a metric.
24+
This is a paradigm shift that we hope will take hold.
25+
726

827
### Alternatives
928

0 commit comments

Comments
 (0)