@binary-balance/seshat 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ insufficiently tested code.
|
|
|
9
9
|
|
|
10
10
|
## What Seshat does
|
|
11
11
|
|
|
12
|
-
- Calculates function complexity and CRAP scores from
|
|
12
|
+
- Calculates function complexity and CRAP scores from branch coverage.
|
|
13
13
|
- Changes comparison operators one at a time and checks whether tests detect them.
|
|
14
14
|
- Runs tests in isolated copies of the captured project.
|
|
15
15
|
- Produces readable terminal output and versioned JSON, with optional CI thresholds.
|
|
@@ -102,7 +102,8 @@ but tests can still access external files, services, databases and credentials.
|
|
|
102
102
|
|
|
103
103
|
## Understand the results
|
|
104
104
|
|
|
105
|
-
CRAP uses complexity and
|
|
105
|
+
CRAP uses complexity and branch coverage, a fraction from 0 to 1. Functions
|
|
106
|
+
with no recorded branches use statement coverage instead:
|
|
106
107
|
|
|
107
108
|
```text
|
|
108
109
|
complexity^2 * (1 - coverage)^3 + complexity
|
|
@@ -111,6 +112,12 @@ complexity^2 * (1 - coverage)^3 + complexity
|
|
|
111
112
|
For complexity 10, zero coverage gives `110`, 50% coverage gives `22.5` and
|
|
112
113
|
full coverage gives `10`.
|
|
113
114
|
|
|
115
|
+
Statement coverage counts code that ran; branch coverage counts the recorded
|
|
116
|
+
outcomes of decisions. For example, testing only the member price in
|
|
117
|
+
`if (member) total *= 0.9; return total;` can run every statement while
|
|
118
|
+
leaving the non-member outcome untested. Its statement coverage is 100%,
|
|
119
|
+
but its branch coverage is 50%. Both measurements appear in the report.
|
|
120
|
+
|
|
114
121
|
The mutation score is the percentage of mutants that made a test fail. A mutant
|
|
115
122
|
is one changed comparison, such as `>` to `>=`. If tests catch two of three
|
|
116
123
|
mutants, the score is `66.67%`. A timeout or execution error leaves the run
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@binary-balance/seshat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A native CLI for TypeScript and TSX complexity analysis and mutation testing.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@binary-balance/seshat-linux-x64": "0.
|
|
24
|
-
"@binary-balance/seshat-linux-arm64": "0.
|
|
25
|
-
"@binary-balance/seshat-darwin-x64": "0.
|
|
26
|
-
"@binary-balance/seshat-darwin-arm64": "0.
|
|
27
|
-
"@binary-balance/seshat-win32-x64": "0.
|
|
23
|
+
"@binary-balance/seshat-linux-x64": "0.3.1",
|
|
24
|
+
"@binary-balance/seshat-linux-arm64": "0.3.1",
|
|
25
|
+
"@binary-balance/seshat-darwin-x64": "0.3.1",
|
|
26
|
+
"@binary-balance/seshat-darwin-arm64": "0.3.1",
|
|
27
|
+
"@binary-balance/seshat-win32-x64": "0.3.1"
|
|
28
28
|
}
|
|
29
29
|
}
|