Files
2025-11-30 08:23:18 +08:00

155 lines
4.0 KiB
JSON

{
"_comment": "Example mutation testing results JSON. Use this as a template for your own results.",
"project": "example-project",
"version": "1.0.0",
"timestamp": "2024-01-26T10:00:00Z",
"mutationScore": 85.71,
"_comment": "Overall mutation score. Higher is better.",
"summary": {
"totalMutations": 21,
"killed": 18,
"survived": 3,
"timeout": 0,
"noCoverage": 0,
"runtimeErrors": 0,
"compileErrors": 0,
"ignored": 0
},
"files": [
{
"path": "src/calculator.js",
"_comment": "Relative path to the file.",
"mutations": [
{
"id": 1,
"location": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 10
}
},
"mutatorName": "ArithmeticOperator",
"_comment": "Type of mutation applied.",
"original": "+",
"replacement": "-",
"status": "Killed",
"_comment": "Killed: Test caught the mutation. Survived: Mutation went undetected.",
"killingTest": "test/calculator.test.js:test addition",
"_comment": "Test that killed the mutation. Null if survived.",
"description": "Replaced + with -",
"static": false
},
{
"id": 2,
"location": {
"start": {
"line": 9,
"column": 9
},
"end": {
"line": 9,
"column": 10
}
},
"mutatorName": "ArithmeticOperator",
"original": "-",
"replacement": "+",
"status": "Killed",
"killingTest": "test/calculator.test.js:test subtraction",
"description": "Replaced - with +",
"static": false
},
{
"id": 3,
"location": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 10
}
},
"mutatorName": "ArithmeticOperator",
"original": "*",
"replacement": "/",
"status": "Survived",
"_comment": "This mutation survived, indicating a gap in the test suite.",
"killingTest": null,
"description": "Replaced * with /",
"static": false
}
]
},
{
"path": "src/utils.js",
"mutations": [
{
"id": 4,
"location": {
"start": {
"line": 2,
"column": 5
},
"end": {
"line": 2,
"column": 7
}
},
"mutatorName": "ConditionalExpression",
"original": ">=",
"replacement": "<",
"status": "Killed",
"killingTest": "test/utils.test.js:test isPositive",
"description": "Replaced >= with <",
"static": false
},
{
"id": 5,
"location": {
"start": {
"line": 6,
"column": 12
},
"end": {
"line": 6,
"column": 14
}
},
"mutatorName": "LogicalOperator",
"original": "&&",
"replacement": "||",
"status": "Killed",
"killingTest": "test/utils.test.js:test isValid",
"description": "Replaced && with ||",
"static": false
},
{
"id": 6,
"location": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 5
}
},
"mutatorName": "BooleanLiteral",
"original": "true",
"replacement": "false",
"status": "Survived",
"killingTest": null,
"description": "Replaced true with false",
"static": false
}
]
}
]
}