Created
April 29, 2018 23:14
-
-
Save jameshmread/f03bc0c24dba8179ce3be4ae0eb1aaaa to your computer and use it in GitHub Desktop.
JSON file for Professor X mutation results before the addition of unit tests.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"runner": "mocha", | |
"config": { | |
"reporter": "dot" | |
}, | |
"duration": { | |
"d": 0, | |
"h": 0, | |
"m": 0, | |
"s": 20, | |
"ms": 977 | |
}, | |
"scoresPerFile": { | |
"files": [ | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts" | |
], | |
"mutantsSurvivedForEach": [ | |
14, | |
27, | |
12, | |
7, | |
15, | |
49, | |
38, | |
12, | |
28, | |
4, | |
17, | |
12, | |
45, | |
40, | |
8, | |
14 | |
], | |
"totalMutationsForEach": [ | |
35, | |
42, | |
27, | |
7, | |
22, | |
49, | |
40, | |
15, | |
48, | |
12, | |
77, | |
27, | |
73, | |
82, | |
15, | |
23 | |
] | |
}, | |
"overallScores": { | |
"totalKilledMutants": 252, | |
"totalSurvivingMutants": 342, | |
"mutationScore": 42.42 | |
} | |
}, | |
[ | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "{\r\n if (typeof tree[currentTreePosition[0]] === \"boolean\") {\r\n return tree[currentTreePosition[0]];\r\n }\r\n return this.traverseRuleTree(tree[currentTreePosition[indexOfFamilyMember]], nodeFamilyIndex + 1);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 118 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 118 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n Logger.info(\"Worker Exit: \", exit);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts12C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "{\r\n this.sourceObj.modifiedSourceCode = this.sourceObj.modifiedSourceCode\r\n .substring(0, currentNode.positions.pos) + \" \"\r\n + replacement\r\n + this.sourceObj.modifiedSourceCode\r\n .substring(currentNode.positions.end, this.sourceObj.modifiedSourceCode.length);\r\n return this.isModificationDifferentFromSource(\r\n this.sourceObj.originalSourceObject.text, this.sourceObj.modifiedSourceCode);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " public resetModified (): void {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.originalSourceObject.getText();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " public resetModified (): void {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.originalSourceObject.getText();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts24C11936undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "1", | |
"nodeToBeMutated": { | |
"syntaxType": 8, | |
"positions": { | |
"pos": 686, | |
"end": 687 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"plainText": "1", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " public isNodeValidForMutation (nodeText: string): boolean {\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " return nodeText[0] === \"(\" && nodeText[nodeText.length - 1] === \")\";\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 22 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " public isNodeValidForMutation (nodeText: string): boolean {\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " return nodeText[0] === \"(\" && nodeText[nodeText.length - 1] === \")\";\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " } protected removeParentheses (): string {\r", | |
"lineNumber": 22 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts28C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" * new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts32C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" - new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts36C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " constructor (plainText: string) {\r", | |
"lineNumber": 7 | |
}, | |
{ | |
"lineText": " super(plainText);\r", | |
"lineNumber": 8 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " constructor (plainText: string) {", | |
"lineNumber": 7 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 8 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "{\r\n super(plainText);\r\n this.number = Number(plainText);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts40C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " private addOne (): string {\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " return (boundChangedNumber ++).toString();\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 30 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " private addOne (): string {\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number; return null;\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 30 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "return (boundChangedNumber ++).toString();", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts44C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * - 1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts48C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " public static createAllFileDescriptors (): Array<IFileDescriptor> {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.filter((srcFile) => {if (existsSync(srcFile)) { return srcFile; } });\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.filter((testFile) => { if (existsSync(testFile)) {return testFile; } });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " console.log(\"before\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " // if (!this.fileExists(ConfigManager.filesToMutate[i]) || !this.fileExists(ConfigManager.testFiles[i])) {\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " // console.log(\"file removed\", ConfigManager.filesToMutate[i]);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.splice(\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.indexOf(ConfigManager.filesToMutate[i], 1));\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.splice(\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.indexOf(ConfigManager.testFiles[i], 1));\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " // NodeHandler.fileDescriptors.splice(i, 1);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " // } else {\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " console.log(\"file\", i);\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " const fo = new FileObject(ConfigManager.filesToMutate[i], ConfigManager.testFiles[i]);\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " const fh = new FileHandler(fo);\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " const so = new SourceObject(fh.getSourceObject());\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " const ci = new CodeInspector(so.originalSourceObject);\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " NodeHandler.fileDescriptors.push({\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " fileName: ConfigManager.filesToMutate[i],\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " fileObject: fo, fileHandler: fh, sourceObject: so, codeInspector: ci\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " // }\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " console.log(\"aa\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " console.log(\"file desc\", NodeHandler.fileDescriptors.length);\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " return NodeHandler.fileDescriptors;\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 77 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " public static createAllFileDescriptors (): Array<IFileDescriptor> {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.filter((srcFile) => {if (existsSync(srcFile)) { return srcFile; } });\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.filter((testFile) => { if (existsSync(testFile)) {return testFile; } });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " console.log(\"before\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " console.log(\"aa\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " console.log(\"file desc\", NodeHandler.fileDescriptors.length);\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " return NodeHandler.fileDescriptors;\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " private static fileExists (file: string) {\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " return existsSync(file);\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " private static removeFileFromAnalysis (file: string, arrayContainingFile: Array<string>) {\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " arrayContainingFile.splice(arrayContainingFile.indexOf(file), 1);\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not find File: \", file);\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineNumber": 72 | |
}, | |
{ | |
"lineNumber": 73 | |
}, | |
{ | |
"lineNumber": 74 | |
}, | |
{ | |
"lineNumber": 75 | |
}, | |
{ | |
"lineNumber": 76 | |
}, | |
{ | |
"lineNumber": 77 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "{\r\n // if (!this.fileExists(ConfigManager.filesToMutate[i]) || !this.fileExists(ConfigManager.testFiles[i])) {\r\n // console.log(\"file removed\", ConfigManager.filesToMutate[i]);\r\n // ConfigManager.filesToMutate.splice(\r\n // ConfigManager.filesToMutate.indexOf(ConfigManager.filesToMutate[i], 1));\r\n // ConfigManager.testFiles.splice(\r\n // ConfigManager.testFiles.indexOf(ConfigManager.testFiles[i], 1));\r\n // NodeHandler.fileDescriptors.splice(i, 1);\r\n // } else {\r\n console.log(\"file\", i);\r\n const fo = new FileObject(ConfigManager.filesToMutate[i], ConfigManager.testFiles[i]);\r\n const fh = new FileHandler(fo);\r\n const so = new SourceObject(fh.getSourceObject());\r\n const ci = new CodeInspector(so.originalSourceObject);\r\n NodeHandler.fileDescriptors.push({\r\n fileName: ConfigManager.filesToMutate[i],\r\n fileObject: fo, fileHandler: fh, sourceObject: so, codeInspector: ci\r\n });\r\n // }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts52C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " public addMutationResultToList (): void {\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " if (MutationResultManager.mutationResults.indexOf(this.currentMutationResult) < 0) {\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " MutationResultManager.mutationResults.push(this.currentMutationResult);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 32 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " public addMutationResultToList (): void {\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " if (MutationResultManager.mutationResults.indexOf(this.currentMutationResult) < 0) {", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 32 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n MutationResultManager.mutationResults.push(this.currentMutationResult);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts60C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " public static mutationResults = new Array<MutationResult>();\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " private currentMutationResult: MutationResult;\r", | |
"lineNumber": 16 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " public static mutationResults = new Array<MutationResult>(); protected currentMutationResult: MutationResult;\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " private sourceCodeModifier: SourceCodeModifier;\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " private currentSourceCodeObject: ts.SourceFile;\r", | |
"lineNumber": 16 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts64C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " public static getTotalNumberOfMutations (nodes: Array<IMutatableNode>): number {\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " const allMutations = new Array<Array<IMutationArrayAndClass>>();\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " nodes.forEach((node) => {\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " allMutations.push(this.getAllMutations(node));\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 82 | |
}, | |
{ | |
"lineText": " return [].concat(...allMutations).length;\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 84 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " public static getTotalNumberOfMutations (nodes: Array<IMutatableNode>): number {\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " const allMutations = new Array<Array<IMutationArrayAndClass>>();\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " nodes.forEach((node) => {\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " allMutations.push(this.getAllMutations(node));\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " }); return null;\r", | |
"lineNumber": 82 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 84 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "return [].concat(...allMutations).length;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.spec.ts72C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total <= 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts84C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total + 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts88C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "true", | |
"mutationType": "Inverting a Boolean" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " public static setLogLevelVerbose () {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " this.outputToConsole = true;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " this.outputToJSON = true;\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 51 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " public static setLogLevelVerbose () {", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n this.outputToConsole = true;\r\n this.outputToJSON = true;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts96C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter / \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts100C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ * \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts104C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts108C11936undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "-", | |
"nodeToBeMutated": { | |
"syntaxType": 38, | |
"positions": { | |
"pos": 699, | |
"end": 701 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"plainText": "-", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n this.file.sourceCode = this.readFile(this.file.fullPath);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " private getTestFileContents (): string {\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " if (!this.file.testFileContents) {\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " this.file.testFileContents = this.readFile(this.file.testFileName);\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " return this.file.testFileContents;\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 78 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " private getTestFileContents (): string {\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " if (!this.file.testFileContents) {\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " this.file.testFileContents = this.readFile(this.file.testFileName);\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " } return null;\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 78 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "return this.file.testFileContents;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts116C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" + file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath * \"/\" + file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts120C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return fs.readdirSync(file);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 136 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n if (basename(a) >= basename(b)) {\r\n return -1;\r\n } else { return 1; }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts128C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return sourceFiles.filter((file) => {\r\n return testFilesWithoutExtension.indexOf(basename(file)) >= 0;\r\n });", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " constructor (private sourceObject: SourceFile) {}\r", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " public static isNodeMutatable (node: Node): boolean {\r", | |
"lineNumber": 11 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " constructor (private sourceObject: SourceFile) {", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 11 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "{}", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.spec.ts136C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " public static cleanRemainingFiles () {\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " const fileArray = fs.readdirSync(ConfigManager.filePath);\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " Cleaner.removeFoundFiles(\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " Cleaner.filterMutatedFiles(fileArray)\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 33 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " public static cleanRemainingFiles () {", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static filterMutatedFiles (fileArray) {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " const filtered = fileArray.filter((element) => {\r", | |
"lineNumber": 33 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n const fileArray = fs.readdirSync(ConfigManager.filePath);\r\n Cleaner.removeFoundFiles(\r\n Cleaner.filterMutatedFiles(fileArray)\r\n );\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts144C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " [SyntaxKind.GreaterThanToken || SyntaxKind.LessThanToken]: {\r", | |
"lineNumber": 17 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " [SyntaxKind.GreaterThanToken && SyntaxKind.LessThanToken]: {\r", | |
"lineNumber": 17 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "||", | |
"mutationType": "Replacing one Logical operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts1C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt( 0).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "2", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts9C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " public spawnWorkers () {\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < this.logicalCores; i++) {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " this.workers.push(worker.fork(\"./src/Worker.ts\", [], {silent: true}));\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " Logger.info(\"Creating Worker: \", i);\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " this.createWorkerMessagers(this.workers[i]);\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " this.workers[i].send(JSON.stringify(this.splitNodes[i]));\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 54 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " public spawnWorkers () {", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " public getIndividualFileResults () {\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " this.progressDisplay.summaryProgressBar = this.progressDisplay.createProgressBar(\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " \"Generating Summary: |:bar| :percent | Time Elapsed :elapsed\",\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " this.threadResults.length);\r", | |
"lineNumber": 54 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n for (let i = 0; i < this.logicalCores; i++) {\r\n this.workers.push(worker.fork(\"./src/Worker.ts\", [], {silent: true}));\r\n Logger.info(\"Creating Worker: \", i);\r\n this.createWorkerMessagers(this.workers[i]);\r\n this.workers[i].send(JSON.stringify(this.splitNodes[i]));\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts13C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp - this.startTimestamp).getTime()\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " Logger.info(\"Mutations Complete in: \", timeTaken);\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " Logger.info(\"Number of mutations produced: \", this.threadResults.length);\r", | |
"lineNumber": 136 | |
}, | |
{ | |
"lineText": " console.log(\"Creating End Result\");\r", | |
"lineNumber": 137 | |
}, | |
{ | |
"lineText": " this.individualFileResults = this.getIndividualFileResults();\r", | |
"lineNumber": 138 | |
}, | |
{ | |
"lineText": " const endResult = new EndResult(\r", | |
"lineNumber": 139 | |
}, | |
{ | |
"lineText": " ConfigManager.testRunner,\r", | |
"lineNumber": 140 | |
}, | |
{ | |
"lineText": " ConfigManager.runnerConfig,\r", | |
"lineNumber": 141 | |
}, | |
{ | |
"lineText": " timeTaken,\r", | |
"lineNumber": 142 | |
}, | |
{ | |
"lineText": " this.individualFileResults,\r", | |
"lineNumber": 143 | |
}, | |
{ | |
"lineText": " this.getOverallMutationScore(),\r", | |
"lineNumber": 144 | |
}, | |
{ | |
"lineText": " this.threadResults\r", | |
"lineNumber": 145 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 146 | |
}, | |
{ | |
"lineText": " console.log(\"end result\", endResult.overallScores);\r", | |
"lineNumber": 147 | |
}, | |
{ | |
"lineText": " console.log(\"Writing results\");\r", | |
"lineNumber": 148 | |
}, | |
{ | |
"lineText": " OutputToJSON.writeResults(endResult);\r", | |
"lineNumber": 149 | |
}, | |
{ | |
"lineText": " console.log(\"Results written\");\r", | |
"lineNumber": 150 | |
}, | |
{ | |
"lineText": " Cleaner.cleanRemainingFiles();\r", | |
"lineNumber": 151 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 152 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " private finishRun () {", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " private createMutationProgressBar () {\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " this.progressDisplay = new ProgressDisplay();\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " this.progressDisplay.mutationProgressBar = this.progressDisplay.createProgressBar(\r", | |
"lineNumber": 136 | |
}, | |
{ | |
"lineText": " \"Generating and Executing Mutants |:bar| :percent | Time elapsed :elapsed\",\r", | |
"lineNumber": 137 | |
}, | |
{ | |
"lineText": " MutationFactory.getTotalNumberOfMutations(this.inputNodes));\r", | |
"lineNumber": 138 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 139 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 140 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 141 | |
}, | |
{ | |
"lineNumber": 142 | |
}, | |
{ | |
"lineNumber": 143 | |
}, | |
{ | |
"lineNumber": 144 | |
}, | |
{ | |
"lineNumber": 145 | |
}, | |
{ | |
"lineNumber": 146 | |
}, | |
{ | |
"lineNumber": 147 | |
}, | |
{ | |
"lineNumber": 148 | |
}, | |
{ | |
"lineNumber": 149 | |
}, | |
{ | |
"lineNumber": 150 | |
}, | |
{ | |
"lineNumber": 151 | |
}, | |
{ | |
"lineNumber": 152 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n const endTimestamp = new Date().getTime();\r\n const timeTaken = MathFunctions.calculateRunTime(\r\n new Date(endTimestamp - this.startTimestamp).getTime()\r\n );\r\n Logger.info(\"Mutations Complete in: \", timeTaken);\r\n Logger.info(\"Number of mutations produced: \", this.threadResults.length);\r\n console.log(\"Creating End Result\");\r\n this.individualFileResults = this.getIndividualFileResults();\r\n const endResult = new EndResult(\r\n ConfigManager.testRunner,\r\n ConfigManager.runnerConfig,\r\n timeTaken,\r\n this.individualFileResults,\r\n this.getOverallMutationScore(),\r\n this.threadResults\r\n );\r\n console.log(\"end result\", endResult.overallScores);\r\n console.log(\"Writing results\");\r\n OutputToJSON.writeResults(endResult);\r\n console.log(\"Results written\");\r\n Cleaner.cleanRemainingFiles();\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts17C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " private isModificationDifferentFromSource (original: string, modified: string): boolean {\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " return !(original === modified);\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 37 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " private isModificationDifferentFromSource (original: string, modified: string): boolean {\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " return ! original === modified;\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 37 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "(original === modified)", | |
"mutationType": "Removal of Parenthesis in a statement", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts29C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length - 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length * 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts33C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" /\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts37C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" * new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts41C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public static writeResults (collatedResults: EndResult) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " this.getOutFilePath();\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " const header = {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " runner: collatedResults.runner,\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " config: collatedResults.runnerConf,\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " duration: collatedResults.duration,\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " scoresPerFile: collatedResults.mutationScoresPerFile,\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " overallScores: collatedResults.overallScores\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " const results = collatedResults.results;\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " const transformStream = JSONStream.stringify();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " const outputStream = fs.createWriteStream(OutputToJSON.outputfilePath);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " Logger.log(\"Results File Path\", OutputToJSON.outputfilePath);\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " transformStream.pipe(outputStream);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " transformStream.write(header);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " MathFunctions.divideItemsAmongArrays(results,\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Math.floor(results.length / (results.length / 4))\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " ).forEach((result) => {\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " transformStream.write(result);\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " Logger.info(\"Length of Division\", result.length);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " transformStream.end();\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " outputStream.on(\"finish\", () => {Logger.log(\"Results Written to Disk\"); });\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 37 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public static writeResults (collatedResults: EndResult) {", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineNumber": 26 | |
}, | |
{ | |
"lineNumber": 27 | |
}, | |
{ | |
"lineNumber": 28 | |
}, | |
{ | |
"lineNumber": 29 | |
}, | |
{ | |
"lineNumber": 30 | |
}, | |
{ | |
"lineNumber": 31 | |
}, | |
{ | |
"lineNumber": 32 | |
}, | |
{ | |
"lineNumber": 33 | |
}, | |
{ | |
"lineNumber": 34 | |
}, | |
{ | |
"lineNumber": 35 | |
}, | |
{ | |
"lineNumber": 36 | |
}, | |
{ | |
"lineNumber": 37 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "{\r\n this.getOutFilePath();\r\n const header = {\r\n runner: collatedResults.runner,\r\n config: collatedResults.runnerConf,\r\n duration: collatedResults.duration,\r\n scoresPerFile: collatedResults.mutationScoresPerFile,\r\n overallScores: collatedResults.overallScores\r\n };\r\n const results = collatedResults.results;\r\n const transformStream = JSONStream.stringify();\r\n const outputStream = fs.createWriteStream(OutputToJSON.outputfilePath);\r\n Logger.log(\"Results File Path\", OutputToJSON.outputfilePath);\r\n transformStream.pipe(outputStream);\r\n\r\n transformStream.write(header);\r\n MathFunctions.divideItemsAmongArrays(results,\r\n Math.floor(results.length / (results.length / 4))\r\n ).forEach((result) => {\r\n transformStream.write(result);\r\n Logger.info(\"Length of Division\", result.length);\r\n });\r\n\r\n transformStream.end();\r\n outputStream.on(\"finish\", () => {Logger.log(\"Results Written to Disk\"); });\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts45C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "{\r\n const negativeNum = this.number;\r\n return (negativeNum * -1).toString();\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts49C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(- 1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts53C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "{\r\n NodeHandler.fileNameNodes.push({\r\n syntaxType: syntaxItem,\r\n positions: {pos: token.pos, end: token.end},\r\n parentFilePath: ConfigManager.filesToMutate[fileNameIndex],\r\n plainText: token.getText(),\r\n associatedTestFilePath: ConfigManager.testFiles[fileNameIndex]\r\n // for now i can't see a problem doing this, however the test files may be in a different order\r\n // to the source files in some occasions.\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " private setoriginalCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.originalCode.push({\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 90 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 94 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " private setoriginalCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end / 1; line++) {\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.originalCode.push({\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 90 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 94 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts61C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " public setSourceCodeLines (\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " code: {original: string, mutated: string},\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " bounds: {pos: number, end: number}): void {\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " const methodStartLine = ts.getLineAndCharacterOfPosition(this.currentSourceCodeObject, bounds.pos).line;\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " const methodEndLine = ts.getLineAndCharacterOfPosition(this.currentSourceCodeObject, bounds.end).line;\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " this.setoriginalCode(code.original, {start: methodStartLine, end: methodEndLine});\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " this.setMutatedCode(code.mutated, {start: methodStartLine, end: methodEndLine});\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 68 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " public setSourceCodeLines (\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " code: {original: string, mutated: string},\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " bounds: {pos: number, end: number}): void {", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " public getParentMethodBoundsOfMutatedLine (characterOfMutation: number) {\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " const methodBounds = this.getAllMethodNames().filter((methods) =>\r", | |
"lineNumber": 68 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n const methodStartLine = ts.getLineAndCharacterOfPosition(this.currentSourceCodeObject, bounds.pos).line;\r\n const methodEndLine = ts.getLineAndCharacterOfPosition(this.currentSourceCodeObject, bounds.end).line;\r\n this.setoriginalCode(code.original, {start: methodStartLine, end: methodEndLine});\r\n this.setMutatedCode(code.mutated, {start: methodStartLine, end: methodEndLine});\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts65C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " public getCurrentMutationResult (): MutationResult {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.currentMutationResult;\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " public getCurrentMutationResult (): MutationResult { return null;\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "return this.currentMutationResult;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts69C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "return {mutations: [], mutationClass: \"No Simple Mutations Found for this Syntax Kind\"};", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) {", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "{ return 0; }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts93C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n if (level === LogLevels.verbose) {\r\n this.outputToConsole = true;\r\n this.outputToJSON = true;\r\n } else if (level === LogLevels.JSON) {\r\n this.outputToJSON = true;\r\n } else if (level === LogLevels.console) {\r\n this.outputToConsole = true;\r\n } else if (level === LogLevels.none) {\r\n this.outputToConsole = false;\r\n this.outputToJSON = false;\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "return {console: this.outputToConsole, json: this.outputToJSON};", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber - FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts105C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n const tempFilename =\r\n this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r\n fs.writeFileSync(tempFilename, modifiedCode);\r\n return tempFilename;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts113C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " public mutateTestFileReference (contents: string): string {\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " const filenameNoExtension = this.file.filename.substring(0, this.file.filename.length - 3);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " contents = contents.replace(\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension,\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension + \".ts\" + FileObject.counter + \"C\" + this.file.coreNumber + \".m\"\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " return contents;\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 67 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " public mutateTestFileReference (contents: string): string {\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " const filenameNoExtension = this.file.filename.substring( 0, this.file.filename.length - 3);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " contents = contents.replace(\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension,\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension + \".ts\" + FileObject.counter + \"C\" + this.file.coreNumber + \".m\"\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " return contents;\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 67 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts117C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private static filterOutTestFiles (files: Array<string>): Array<string> {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " return files.filter((file) => {\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " return !file.endsWith(this.testFileExtension + \".ts\");\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 100 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private static filterOutTestFiles (files: Array<string>): Array<string> {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " return files.filter((file) => {\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " return !file.endsWith(this.testFileExtension / \".ts\");\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 100 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts121C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return fileName.substring(fileName.length - 3, fileName.length) === \".ts\";\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else {", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{ return 1; }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts133C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return this.filesToMutate.filter((item) => {\r\n return this.filesToSkip.indexOf(item) < 0;\r\n });", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " public static isNodeMutatable (node: Node): boolean {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " const mutationRules = new ValidMutationRules();\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " mutationRules.setNodeFamily(node);\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " if (mutationRules.nodeFamily === void 0) { return false; }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " return mutationRules.traverseRuleTree(ValidMutationRules.RULE_TREE, 0);\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 16 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " public static isNodeMutatable (node: Node): boolean {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " const mutationRules = new ValidMutationRules();\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " mutationRules.setNodeFamily(node);\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " if (mutationRules.nodeFamily === void 0) {", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 16 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "{ return false; }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.spec.ts141C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public static deleteTestFile (filePath: string) {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " if (!Cleaner.isMutatedFile(filePath)) {\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " Logger.warn(`${filePath} is not a mutated test file. Tried to delete a non mutated file.`);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " fs.unlink(filePath, (err) => {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " if (err !== null) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not delete test file\", {path: filePath, error: err});\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public static deleteTestFile (filePath: string) {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " if (!Cleaner.isMutatedFile(filePath)) {\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " Logger.warn(`${filePath} is not a mutated test file. Tried to delete a non mutated file.`);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " fs.unlink(filePath, (err) => {", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " public static cleanRemainingFiles () {\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n if (err !== null) {\r\n Logger.warn(\"Could not delete test file\", {path: filePath, error: err});\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts145C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "{\r\n const currentTreePosition = Object.keys(tree);\r\n const indexOfFamilyMember =\r\n currentTreePosition.indexOf(this.nodeFamily[nodeFamilyIndex].toString());\r\n if (indexOfFamilyMember >= 0) {\r\n if (typeof tree[currentTreePosition[0]] === \"boolean\") {\r\n return tree[currentTreePosition[0]];\r\n }\r\n return this.traverseRuleTree(tree[currentTreePosition[indexOfFamilyMember]], nodeFamilyIndex + 1);\r\n }\r\n return true;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt( 1).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts5C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n filesMutated.totalMutationsForEach[indexOfSRCFile] ++;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " Logger.log(\"All workers complete\");\r", | |
"lineNumber": 123 | |
}, | |
{ | |
"lineText": " this.threadResults = [].concat.apply([], this.threadResults);\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " this.finishRun();\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " return;\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 128 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " Logger.log(\"All workers complete\");\r", | |
"lineNumber": 123 | |
}, | |
{ | |
"lineText": " this.threadResults = [].concat.apply([], this.threadResults);\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " this.finishRun();\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " return;\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " } protected finishRun () {\r", | |
"lineNumber": 128 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts13C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " public modifyCode (currentNode: IMutatableNode, replacement: string): boolean {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " .substring(0, currentNode.positions.pos) + \" \"\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " + replacement\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " + this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " .substring(currentNode.positions.end, this.sourceObj.modifiedSourceCode.length);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " return this.isModificationDifferentFromSource(\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " this.sourceObj.originalSourceObject.text, this.sourceObj.modifiedSourceCode);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 33 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " public modifyCode (currentNode: IMutatableNode, replacement: string): boolean {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " .substring(0, currentNode.positions.pos) + \" \"\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " + replacement\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " + this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " .substring(currentNode.positions.end, this.sourceObj.modifiedSourceCode.length);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " return this.isModificationDifferentFromSource(\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " this.sourceObj.originalSourceObject.text, this.sourceObj.modifiedSourceCode);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " } protected isModificationDifferentFromSource (original: string, modified: string): boolean {\r", | |
"lineNumber": 33 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts17C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length - 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "{\r\n return this.plainText.substring(1, this.plainText.length - 1);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts21C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length - 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring( 0, this.plainText.length - 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts25C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() - \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts29C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() / \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts33C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum / -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts37C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum !== -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts41C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "{\r\n return !isNaN(parseInt(nodeText, 10));\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " private setToValue (value: number): string {\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " let newNumber = this.number;\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " return (newNumber = value).toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 45 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " private setToValue (value: number): string {\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " let newNumber = this.number; return null;\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 45 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "return (newNumber = value).toString();", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts49C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " private static fileExists (file: string) {\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " return existsSync(file);\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 81 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " private static fileExists (file: string) { return null;\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 81 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "return existsSync(file);", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts53C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " public addMutationResultToList (): void {\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " if (MutationResultManager.mutationResults.indexOf(this.currentMutationResult) < 0) {\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " MutationResultManager.mutationResults.push(this.currentMutationResult);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 32 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " public addMutationResultToList (): void {", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public setCurrentSourceCodeModifierAndSourceObj (sourceCodeModifier: SourceCodeModifier) {\r", | |
"lineNumber": 32 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n if (MutationResultManager.mutationResults.indexOf(this.currentMutationResult) < 0) {\r\n MutationResultManager.mutationResults.push(this.currentMutationResult);\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts57C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " private splitCodeByLine (code: string): Array<string> {\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " return code.split(\"\\n\");\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 108 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " private splitCodeByLine (code: string): Array<string> {", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 108 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n return code.split(\"\\n\");\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts61C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "{\r\n const numbLitteral = new NumericLiteral(node.plainText);\r\n const parentheses = new ParenthesesModifier(node.plainText);\r\n return [\r\n numbLitteral.getComplexMutation(),\r\n parentheses.getComplexMutation()];\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "{\r\n dividedResults[i % divisionLength] = [];\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed( 0));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "2", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts89C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "false", | |
"mutationType": "Inverting a Boolean" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " public static dumpLogToFile () {\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " throw Error(\"Not implemented yet\");\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(\"../../LOG.json\", JSON.stringify(this.logContent));\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 88 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " public static dumpLogToFile () {", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 88 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n throw Error(\"Not implemented yet\");\r\n fs.writeFileSync(\"../../LOG.json\", JSON.stringify(this.logContent));\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts97C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath - FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts101C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " private getTestFileContents (): string {\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " if (!this.file.testFileContents) {\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " this.file.testFileContents = this.readFile(this.file.testFileName);\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " return this.file.testFileContents;\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 78 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " private getTestFileContents (): string {\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " if (!this.file.testFileContents) {", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " return this.file.testFileContents;\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 78 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n this.file.testFileContents = this.readFile(this.file.testFileName);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts113C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " public configValid () {\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " Object.keys(ConfigManager).forEach((el) => {\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " if (ConfigManager[el] === void 0) {\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Professor X config not valid. Not all keys are defined\", this);\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " throw new Error(\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " \"Professor X config not valid. Not all keys are defined\"\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 76 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " public configValid () {\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " Object.keys(ConfigManager).forEach((el) => {", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " private static filterFilesToMutateBySkipped (): Array<string> {\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " return this.filesToMutate.filter((item) => {\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " return this.filesToSkip.indexOf(item) < 0;\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 76 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n if (ConfigManager[el] === void 0) {\r\n Logger.fatal(\"Professor X config not valid. Not all keys are defined\", this);\r\n throw new Error(\r\n \"Professor X config not valid. Not all keys are defined\"\r\n );\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts121C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" + file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n this.getAllProjectFiles(filePath + \"/\" + file);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts125C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private static filterOutTestFiles (files: Array<string>): Array<string> {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " return files.filter((file) => {\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " return !file.endsWith(this.testFileExtension + \".ts\");\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 100 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private static filterOutTestFiles (files: Array<string>): Array<string> {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " return files.filter((file) => {\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " return !file.endsWith(this.testFileExtension + \".ts\");\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " } protected static filterOutSrcFiles (files: Array<string>): Array<string> {\r", | |
"lineNumber": 100 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts129C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return this.projectFilesRetrieved;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return - 0;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts137C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "return mutationRules.traverseRuleTree(ValidMutationRules.RULE_TREE, 0);", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public static deleteSourceFile (fileToDelete: string) {\r", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": " fs.unlink(fileToDelete, (err) => {\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " if (err !== null) {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not delete source file\", {filePath: fileToDelete, error: err});\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public static deleteSourceFile (fileToDelete: string) {\r", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": " fs.unlink(fileToDelete, (err) => {\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " if (err !== null) {", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n Logger.warn(\"Could not delete source file\", {filePath: fileToDelete, error: err});\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts145C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "true", | |
"mutationType": "Inverting a Boolean" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " public traverseRuleTree (tree: Object, nodeFamilyIndex: number): boolean {\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " const currentTreePosition = Object.keys(tree);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " const indexOfFamilyMember =\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " currentTreePosition.indexOf(this.nodeFamily[nodeFamilyIndex].toString());\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " if (indexOfFamilyMember >= 0) {\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " if (typeof tree[currentTreePosition[0]] === \"boolean\") {\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " return tree[currentTreePosition[0]];\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return this.traverseRuleTree(tree[currentTreePosition[indexOfFamilyMember]], nodeFamilyIndex + 1);\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " return true;\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 42 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " public traverseRuleTree (tree: Object, nodeFamilyIndex: number): boolean {\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " const currentTreePosition = Object.keys(tree);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " const indexOfFamilyMember =\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " currentTreePosition.indexOf(this.nodeFamily[nodeFamilyIndex].toString());\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " if (indexOfFamilyMember >= 0) {\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " if (typeof tree[currentTreePosition[ 0]] === \"boolean\") {\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " return tree[currentTreePosition[0]];\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return this.traverseRuleTree(tree[currentTreePosition[indexOfFamilyMember]], nodeFamilyIndex + 1);\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " return true;\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 42 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts4C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp - this.startTimestamp).getTime()\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " Logger.info(\"Mutations Complete in: \", timeTaken);\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " Logger.info(\"Number of mutations produced: \", this.threadResults.length);\r", | |
"lineNumber": 136 | |
}, | |
{ | |
"lineText": " console.log(\"Creating End Result\");\r", | |
"lineNumber": 137 | |
}, | |
{ | |
"lineText": " this.individualFileResults = this.getIndividualFileResults();\r", | |
"lineNumber": 138 | |
}, | |
{ | |
"lineText": " const endResult = new EndResult(\r", | |
"lineNumber": 139 | |
}, | |
{ | |
"lineText": " ConfigManager.testRunner,\r", | |
"lineNumber": 140 | |
}, | |
{ | |
"lineText": " ConfigManager.runnerConfig,\r", | |
"lineNumber": 141 | |
}, | |
{ | |
"lineText": " timeTaken,\r", | |
"lineNumber": 142 | |
}, | |
{ | |
"lineText": " this.individualFileResults,\r", | |
"lineNumber": 143 | |
}, | |
{ | |
"lineText": " this.getOverallMutationScore(),\r", | |
"lineNumber": 144 | |
}, | |
{ | |
"lineText": " this.threadResults\r", | |
"lineNumber": 145 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 146 | |
}, | |
{ | |
"lineText": " console.log(\"end result\", endResult.overallScores);\r", | |
"lineNumber": 147 | |
}, | |
{ | |
"lineText": " console.log(\"Writing results\");\r", | |
"lineNumber": 148 | |
}, | |
{ | |
"lineText": " OutputToJSON.writeResults(endResult);\r", | |
"lineNumber": 149 | |
}, | |
{ | |
"lineText": " console.log(\"Results written\");\r", | |
"lineNumber": 150 | |
}, | |
{ | |
"lineText": " Cleaner.cleanRemainingFiles();\r", | |
"lineNumber": 151 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 152 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp * this.startTimestamp).getTime()\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " Logger.info(\"Mutations Complete in: \", timeTaken);\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " Logger.info(\"Number of mutations produced: \", this.threadResults.length);\r", | |
"lineNumber": 136 | |
}, | |
{ | |
"lineText": " console.log(\"Creating End Result\");\r", | |
"lineNumber": 137 | |
}, | |
{ | |
"lineText": " this.individualFileResults = this.getIndividualFileResults();\r", | |
"lineNumber": 138 | |
}, | |
{ | |
"lineText": " const endResult = new EndResult(\r", | |
"lineNumber": 139 | |
}, | |
{ | |
"lineText": " ConfigManager.testRunner,\r", | |
"lineNumber": 140 | |
}, | |
{ | |
"lineText": " ConfigManager.runnerConfig,\r", | |
"lineNumber": 141 | |
}, | |
{ | |
"lineText": " timeTaken,\r", | |
"lineNumber": 142 | |
}, | |
{ | |
"lineText": " this.individualFileResults,\r", | |
"lineNumber": 143 | |
}, | |
{ | |
"lineText": " this.getOverallMutationScore(),\r", | |
"lineNumber": 144 | |
}, | |
{ | |
"lineText": " this.threadResults\r", | |
"lineNumber": 145 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 146 | |
}, | |
{ | |
"lineText": " console.log(\"end result\", endResult.overallScores);\r", | |
"lineNumber": 147 | |
}, | |
{ | |
"lineText": " console.log(\"Writing results\");\r", | |
"lineNumber": 148 | |
}, | |
{ | |
"lineText": " OutputToJSON.writeResults(endResult);\r", | |
"lineNumber": 149 | |
}, | |
{ | |
"lineText": " console.log(\"Results written\");\r", | |
"lineNumber": 150 | |
}, | |
{ | |
"lineText": " Cleaner.cleanRemainingFiles();\r", | |
"lineNumber": 151 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 152 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts12C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 118 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " Logger.log(\"All workers complete\");\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.threadResults = [].concat.apply([], this.threadResults);\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " this.finishRun();\r", | |
"lineNumber": 118 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n if (data === \"tick\") {\r\n this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r\n } else {\r\n this.collateResults(data);\r\n Logger.info(\"Worker Complete\", individualWorker.pid);\r\n individualWorker.kill();\r\n Logger.info(\"Worker Killed\", individualWorker.pid);\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts16C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " public getIndividualFileResults () {\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " this.progressDisplay.summaryProgressBar = this.progressDisplay.createProgressBar(\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " \"Generating Summary: |:bar| :percent | Time Elapsed :elapsed\",\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " this.threadResults.length);\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " const filesMutated: IMutationScoresPerFile = {\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " files: ConfigManager.filesToMutate,\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " mutantsSurvivedForEach: [],\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " totalMutationsForEach: []\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " filesMutated.files.forEach((file) => {\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " filesMutated.mutantsSurvivedForEach.push(0);\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " filesMutated.totalMutationsForEach.push(0);\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " this.threadResults.forEach((item, index) => {\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " const indexOfSRCFile = ConfigManager.filesToMutate.indexOf(item.SRC_FILE);\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " if (indexOfSRCFile >= 0) {\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " filesMutated.totalMutationsForEach[indexOfSRCFile] ++;\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " if (item.mutatedCode !== null) {\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " filesMutated.mutantsSurvivedForEach[indexOfSRCFile] ++;\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.summaryProgressBar);\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " return filesMutated;\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 82 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " public getIndividualFileResults () {\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " this.progressDisplay.summaryProgressBar = this.progressDisplay.createProgressBar(\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " \"Generating Summary: |:bar| :percent | Time Elapsed :elapsed\",\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " this.threadResults.length);\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " const filesMutated: IMutationScoresPerFile = {\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " files: ConfigManager.filesToMutate,\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " mutantsSurvivedForEach: [],\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " totalMutationsForEach: []\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " filesMutated.files.forEach((file) => {\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " filesMutated.mutantsSurvivedForEach.push( 0);\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " filesMutated.totalMutationsForEach.push(0);\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " this.threadResults.forEach((item, index) => {\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " const indexOfSRCFile = ConfigManager.filesToMutate.indexOf(item.SRC_FILE);\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " if (indexOfSRCFile >= 0) {\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " filesMutated.totalMutationsForEach[indexOfSRCFile] ++;\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " if (item.mutatedCode !== null) {\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " filesMutated.mutantsSurvivedForEach[indexOfSRCFile] ++;\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.summaryProgressBar);\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " return filesMutated;\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 82 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts20C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "return this.sourceObj.originalSourceObject.getText();", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " public resetModified (): void {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.originalSourceObject.getText();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " public resetModified (): void {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.originalSourceObject.getText();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"targetNode": "{\r\n bar.tick(1);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts32C6372undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "{\r\n bar.tick(1);\r\n }", | |
"nodeToBeMutated": { | |
"syntaxType": 208, | |
"positions": { | |
"pos": 665, | |
"end": 696 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"plainText": "{\r\n bar.tick(1);\r\n }", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " this.removeParentheses()\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return {mutations: arrayOfMutations, mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " this.removeParentheses()\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return {mutations: arrayOfMutations, mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "{\r\n return {mutations: [], mutationClass: MutationClass.Parenthesis_Removal};\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts36C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() - \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts44C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() / \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts48C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() *\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts52C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[ 0];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts56C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) { return null;\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts60C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue( 0), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts64C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " public static traverseFilesForNodes () {\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " Logger.dumpLogToConsole();\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " console.log(\"dd\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " NodeHandler.getAllNodesInFile(NodeHandler.fileDescriptors[i].codeInspector, i);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " if (this.fileNameNodes.length === 0) {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"No nodes found to mutate, check Professor X config settings.\", NodeHandler);\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " throw Error(\"No nodes found to mutate, check Professor X config settings.\");\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Logger.info(\"Found Nodes\", NodeHandler.fileNameNodes.length);\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " return NodeHandler.fileNameNodes;\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 31 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " public static traverseFilesForNodes () {\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " Logger.dumpLogToConsole();\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " console.log(\"dd\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " NodeHandler.getAllNodesInFile(NodeHandler.fileDescriptors[i].codeInspector, i);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " if (this.fileNameNodes.length === 0) {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"No nodes found to mutate, check Professor X config settings.\", NodeHandler);\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " throw Error(\"No nodes found to mutate, check Professor X config settings.\");\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Logger.info(\"Found Nodes\", NodeHandler.fileNameNodes.length); return null;\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "return NodeHandler.fileNameNodes;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts68C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n this.currentMutationResult = mResult;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutatedCode.push({\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 104 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " private splitCodeByLine (code: string): Array<string> {\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " return code.split(\"\\n\");\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 104 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n const splitCode = this.splitCodeByLine(code);\r\n for (let line = method.start; line < method.end + 1; line++) {\r\n this.currentMutationResult.mutatedCode.push({\r\n lineText: splitCode[line],\r\n lineNumber: ++ method.start\r\n });\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts76C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " public static getTotalNumberOfMutations (nodes: Array<IMutatableNode>): number {\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " const allMutations = new Array<Array<IMutationArrayAndClass>>();\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " nodes.forEach((node) => {\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " allMutations.push(this.getAllMutations(node));\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 82 | |
}, | |
{ | |
"lineText": " return [].concat(...allMutations).length;\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 84 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " public static getTotalNumberOfMutations (nodes: Array<IMutatableNode>): number {", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " private static getComplexMutations (node: IMutatableNode): Array<IMutationArrayAndClass> {\r", | |
"lineNumber": 82 | |
}, | |
{ | |
"lineText": " const numbLitteral = new NumericLiteral(node.plainText);\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " const parentheses = new ParenthesesModifier(node.plainText);\r", | |
"lineNumber": 84 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "{\r\n const allMutations = new Array<Array<IMutationArrayAndClass>>();\r\n nodes.forEach((node) => {\r\n allMutations.push(this.getAllMutations(node));\r\n });\r\n return [].concat(...allMutations).length;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.spec.ts80C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "{\r\n const dividedResults = new Array<Array<any>>();\r\n for (let i = 0; i < input.length; i++) {\r\n if (dividedResults[i] === void 0 && i < divisionLength) {\r\n dividedResults[i % divisionLength] = [];\r\n }\r\n dividedResults[i % divisionLength].push(input[i]);\r\n }\r\n return dividedResults;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " public static setLogLevelVerbose () {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " this.outputToConsole = true;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " this.outputToJSON = true;\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 51 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " public static setLogLevelVerbose () {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " this.outputToConsole = true;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " this.outputToJSON = false;\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 51 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "true", | |
"mutationType": "Inverting a Boolean", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts96C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " public static fatal (message: string, object? : any): void {\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " this.logContent.fatal.push(\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " {logType: LogTypes.fatal, timestamp: new Date().getTime(), messageText: message, obj: object});\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " // console.log(this.logContent.fatal);\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 76 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " public static fatal (message: string, object? : any): void {", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " public static dumpLogToConsole () {\r", | |
"lineNumber": 76 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n this.logContent.fatal.push(\r\n {logType: LogTypes.fatal, timestamp: new Date().getTime(), messageText: message, obj: object});\r\n // console.log(this.logContent.fatal);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts100C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" * this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts104C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n return fs.readFileSync(path).toString();\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" + file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" - file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts120C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n ConfigManager.filesToMutate =\r\n ConfigManager.removeSrcFilesWhichDontHaveTests(\r\n ConfigManager.filterOutTestFiles(\r\n ConfigManager.filterFilesToMutateBySkipped())\r\n );\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n if (ConfigManager.isTypescriptFile(file)) {\r\n this.projectFilesRetrieved.push(resolve(filePath, file));\r\n } else {\r\n this.getAllProjectFiles(filePath + \"/\" + file);\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " private static readfileDirectory (file: string): Array<string> {\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " if (fs.statSync(file).isDirectory()) {\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " return fs.readdirSync(file);\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " return [];\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 90 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " private static readfileDirectory (file: string): Array<string> {\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " if (fs.statSync(file).isDirectory()) {\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " return fs.readdirSync(file);\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " return [];\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " } protected static isTypescriptFile (fileName: string): boolean {\r", | |
"lineNumber": 90 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts132C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return files.filter((file) => {\r\n return file.endsWith(this.testFileExtension + \".ts\");\r\n });", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return - 0;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts140C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private static findTokenObjectsOfKind (object: Node, kind: SyntaxKind)\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " : Array<Node> {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " if (object.kind === kind && CodeInspector.isNodeMutatable(object)) {\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " CodeInspector.retrievedObjects.push(object);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " object.forEachChild((element) => {\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " this.findTokenObjectsOfKind(element, kind);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " return CodeInspector.retrievedObjects;\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 33 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private static findTokenObjectsOfKind (object: Node, kind: SyntaxKind)\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " : Array<Node> {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " if (object.kind === kind && CodeInspector.isNodeMutatable(object)) {\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " CodeInspector.retrievedObjects.push(object);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " object.forEachChild((element) => {\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " this.findTokenObjectsOfKind(element, kind);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " }); return null;\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 33 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "return CodeInspector.retrievedObjects;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.spec.ts144C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " private static removeFoundFiles (fileArray) {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " fileArray.forEach((file) => {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " fs.unlinkSync(ConfigManager.filePath + file);\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 52 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " private static removeFoundFiles (fileArray) {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " fileArray.forEach((file) => {", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 52 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n fs.unlinkSync(ConfigManager.filePath + file);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts148C6372undefined.m.ts" | |
} | |
], | |
[ | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineNumber": 58 | |
}, | |
{ | |
"lineNumber": 59 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "{\r\n this.nodeFamily = [\r\n node.kind,\r\n node.parent.kind,\r\n node.parent.getChildAt(0).kind\r\n ];\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts5C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " constructor (private inputNodes: Array<IMutatableNode>) {\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " this.createMutationProgressBar();\r", | |
"lineNumber": 37 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " constructor (private inputNodes: Array<IMutatableNode>) {", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 37 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n this.createMutationProgressBar();\r\n this.logicalCores = os.cpus().length;\r\n this.startTimestamp = new Date().getTime();\r\n Logger.log(\"Splitting nodes among workers\");\r\n this.splitNodes = MathFunctions.divideItemsAmongArrays(inputNodes, this.logicalCores);\r\n if (this.splitNodes.length < this.logicalCores) {\r\n this.logicalCores = this.splitNodes.length;\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts9C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " Logger.log(\"All workers complete\");\r", | |
"lineNumber": 123 | |
}, | |
{ | |
"lineText": " this.threadResults = [].concat.apply([], this.threadResults);\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " this.finishRun();\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " return;\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 128 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " private collateResults (data) {", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 123 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp - this.startTimestamp).getTime()\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 128 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n this.threadResults.push(data);\r\n if (this.threadResults.length >= this.logicalCores) {\r\n Logger.log(\"All workers complete\");\r\n this.threadResults = [].concat.apply([], this.threadResults);\r\n this.finishRun();\r\n return;\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts13C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public getOriginalSourceObject (): SourceFile {\r", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": " return this.sourceObj.originalSourceObject;\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 11 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public getOriginalSourceObject (): SourceFile { return null;\r", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "return this.sourceObj.originalSourceObject;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts21C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " public resetModified (): void {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.originalSourceObject.getText();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " public resetModified (): void {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.originalSourceObject.getText();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts25C11936undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "1", | |
"nodeToBeMutated": { | |
"syntaxType": 8, | |
"positions": { | |
"pos": 686, | |
"end": 687 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"plainText": "1", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length - 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string { return null;\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "return this.plainText.substring(1, this.plainText.length - 1);", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts29C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" -\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts33C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" / new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts37C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " private addOne (): string {\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " return (boundChangedNumber ++).toString();\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 30 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " private addOne (): string {", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 30 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "{\r\n let boundChangedNumber = this.number;\r\n return (boundChangedNumber ++).toString();\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts41C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue( 0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts45C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * - -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts49C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " private static fileExists (file: string) {\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " return existsSync(file);\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 81 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " private static fileExists (file: string) {\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " return existsSync(file);\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " } protected static removeFileFromAnalysis (file: string, arrayContainingFile: Array<string>) {\r", | |
"lineNumber": 81 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts53C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " public setMutationResultData (testFile: string, currentNode: IMutatableNode) {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " this.setTestFile(testFile);\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " try {\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " const methodBounds = this.getParentMethodBoundsOfMutatedLine(currentNode.positions.pos);\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " this.setSourceCodeLines(\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " {original: this.sourceCodeModifier.getOriginalSourceCode(),\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " mutated: this.sourceCodeModifier.getModifiedSourceCode()},\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " methodBounds);\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " } catch (err) {\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutationAttemptFailure = new MAttemptFail(\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " `The current nodes 'Start' and 'End' positions were undefined.\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " Or the method bounds for these positions could not be determined`,\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " currentNode.plainText,\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " currentNode\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 55 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " public setMutationResultData (testFile: string, currentNode: IMutatableNode) {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " this.setTestFile(testFile);\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " try {\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " const methodBounds = this.getParentMethodBoundsOfMutatedLine(currentNode.positions.pos);\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " this.setSourceCodeLines(\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " {original: this.sourceCodeModifier.getOriginalSourceCode(),\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " mutated: this.sourceCodeModifier.getModifiedSourceCode()},\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " methodBounds);\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " } catch (err) {", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public setTestFile (filename: string): void {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.testFilePath = filename;\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 55 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n this.currentMutationResult.mutationAttemptFailure = new MAttemptFail(\r\n `The current nodes 'Start' and 'End' positions were undefined.\r\n Or the method bounds for these positions could not be determined`,\r\n currentNode.plainText,\r\n currentNode\r\n );\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts61C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " private setoriginalCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.originalCode.push({\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 90 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 94 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " private setoriginalCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.originalCode.push({\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 90 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " } protected setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 94 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts65C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total >= 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts85C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total > 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts89C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " public static setLogLevelVerbose () {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " this.outputToConsole = true;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " this.outputToJSON = true;\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 51 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " public static setLogLevelVerbose () {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " this.outputToConsole = false;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " this.outputToJSON = true;\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 51 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "true", | |
"mutationType": "Inverting a Boolean", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts93C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " public static warn (message: string, object? : any): void {\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " this.logContent.warn.push(\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " {logType: LogTypes.warn, timestamp: new Date().getTime(), messageText: message, obj: object});\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 70 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " public static warn (message: string, object? : any): void {", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 70 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n this.logContent.warn.push(\r\n {logType: LogTypes.warn, timestamp: new Date().getTime(), messageText: message, obj: object});\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts97C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter * \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts101C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts109C11936undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "-", | |
"nodeToBeMutated": { | |
"syntaxType": 38, | |
"positions": { | |
"pos": 699, | |
"end": 701 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"plainText": "-", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n const filenameNoExtension = this.file.filename.substring(0, this.file.filename.length - 3);\r\n contents = contents.replace(\r\n \"/\" + filenameNoExtension,\r\n \"/\" + filenameNoExtension + \".ts\" + FileObject.counter + \"C\" + this.file.coreNumber + \".m\"\r\n );\r\n return contents;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " if (! this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source) {\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)", | |
"mutationType": "Removal of Parenthesis in a statement", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts117C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n let testFilesWithoutExtension: Array<string> = [];\r\n testFilesWithoutExtension = this.testFiles.map((file) => {\r\n return basename(file.replace(this.testFileExtension, \"\"));\r\n });\r\n return sourceFiles.filter((file) => {\r\n return testFilesWithoutExtension.indexOf(basename(file)) >= 0;\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return !file.endsWith(this.testFileExtension + \".ts\");\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " private static mutateAllFiles: boolean;\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " private static filesToSkip: Array<string>;\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " private static mutateAllFiles: boolean; protected static filesToSkip: Array<string>;\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " private projectFilesRetrieved: Array<string>;\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts129C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return fs.readdirSync(file);", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "{\r\n if (object.kind === kind && CodeInspector.isNodeMutatable(object)) {\r\n CodeInspector.retrievedObjects.push(object);\r\n }\r\n object.forEachChild((element) => {\r\n this.findTokenObjectsOfKind(element, kind);\r\n });\r\n return CodeInspector.retrievedObjects;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " private static removeFoundFiles (fileArray) {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " fileArray.forEach((file) => {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " fs.unlinkSync(ConfigManager.filePath + file);\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 52 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " private static removeFoundFiles (fileArray) {", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 52 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n fileArray.forEach((file) => {\r\n fs.unlinkSync(ConfigManager.filePath + file);\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts145C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "{\r\n if (node.parent.getChildCount() === 3) {\r\n this.nodeFamily = [\r\n node.kind,\r\n node.parent.kind,\r\n node.parent.getChildAt(0).kind,\r\n node.parent.getChildAt(2).kind\r\n ];\r\n } else {\r\n this.nodeFamily = [\r\n node.kind,\r\n node.parent.kind,\r\n node.parent.getChildAt(0).kind\r\n ];\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "2", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n const indexOfSRCFile = ConfigManager.filesToMutate.indexOf(item.SRC_FILE);\r\n if (indexOfSRCFile >= 0) {\r\n filesMutated.totalMutationsForEach[indexOfSRCFile] ++;\r\n }\r\n if (item.mutatedCode !== null) {\r\n filesMutated.mutantsSurvivedForEach[indexOfSRCFile] ++;\r\n }\r\n this.progressDisplay.tickBar(this.progressDisplay.summaryProgressBar);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 118 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } protected collateResults (data) {\r", | |
"lineNumber": 118 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts18C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "{\r\n return this.sourceObj.modifiedSourceCode;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public getModifiedSourceCode (): string {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return this.sourceObj.modifiedSourceCode;\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public getModifiedSourceCode (): string {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return this.sourceObj.modifiedSourceCode;\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"targetNode": "return bar;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts30C3912undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "return bar;", | |
"nodeToBeMutated": { | |
"syntaxType": 220, | |
"positions": { | |
"pos": 609, | |
"end": 630 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"plainText": "return bar;", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "{\r\n return nodeText[0] === \"(\" && nodeText[nodeText.length - 1] === \")\";\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" *\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts38C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" - new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts42C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public static writeResults (collatedResults: EndResult) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " this.getOutFilePath();\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " const header = {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " runner: collatedResults.runner,\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " config: collatedResults.runnerConf,\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " duration: collatedResults.duration,\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " scoresPerFile: collatedResults.mutationScoresPerFile,\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " overallScores: collatedResults.overallScores\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " const results = collatedResults.results;\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " const transformStream = JSONStream.stringify();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " const outputStream = fs.createWriteStream(OutputToJSON.outputfilePath);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " Logger.log(\"Results File Path\", OutputToJSON.outputfilePath);\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " transformStream.pipe(outputStream);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " transformStream.write(header);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " MathFunctions.divideItemsAmongArrays(results,\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Math.floor(results.length / (results.length / 4))\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " ).forEach((result) => {\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " transformStream.write(result);\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " Logger.info(\"Length of Division\", result.length);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " transformStream.end();\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " outputStream.on(\"finish\", () => {Logger.log(\"Results Written to Disk\"); });\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 37 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public static writeResults (collatedResults: EndResult) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " this.getOutFilePath();\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " const header = {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " runner: collatedResults.runner,\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " config: collatedResults.runnerConf,\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " duration: collatedResults.duration,\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " scoresPerFile: collatedResults.mutationScoresPerFile,\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " overallScores: collatedResults.overallScores\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " const results = collatedResults.results;\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " const transformStream = JSONStream.stringify();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " const outputStream = fs.createWriteStream(OutputToJSON.outputfilePath);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " Logger.log(\"Results File Path\", OutputToJSON.outputfilePath);\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " transformStream.pipe(outputStream);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " transformStream.write(header);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " MathFunctions.divideItemsAmongArrays(results,\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Math.floor(results.length / (results.length / 4))\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " ).forEach((result) => {\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " transformStream.write(result);\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " Logger.info(\"Length of Division\", result.length);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " transformStream.end();\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " outputStream.on(\"finish\", () => {Logger.log(\"Results Written to Disk\"); });\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " } protected static getOutFilePath () {\r", | |
"lineNumber": 37 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts46C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " private addOne (): string {\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " return (boundChangedNumber ++).toString();\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 30 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " private addOne (): string {\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " return (boundChangedNumber ++).toString();\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " } protected minusOne (): string {\r", | |
"lineNumber": 30 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts50C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(- -1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts54C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 82 | |
}, | |
{ | |
"lineText": " private static removeFileFromAnalysis (file: string, arrayContainingFile: Array<string>) {\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " arrayContainingFile.splice(arrayContainingFile.indexOf(file), 1);\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not find File: \", file);\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 86 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 82 | |
}, | |
{ | |
"lineText": " private static removeFileFromAnalysis (file: string, arrayContainingFile: Array<string>) {", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 86 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "{\r\n arrayContainingFile.splice(arrayContainingFile.indexOf(file), 1);\r\n Logger.warn(\"Could not find File: \", file);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts58C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " private setoriginalCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.originalCode.push({\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 90 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 94 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " private setoriginalCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end * 1; line++) {\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.originalCode.push({\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 90 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 94 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts62C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n const inspector = new CodeInspector(this.currentSourceCodeObject);\r\n return inspector.findObjectsOfSyntaxKind(ts.SyntaxKind.MethodDeclaration)\r\n .map((obj) => obj = {pos: 2 + obj.pos, end: obj.end} );\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " private splitCodeByLine (code: string): Array<string> {\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " return code.split(\"\\n\");\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 108 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " private splitCodeByLine (code: string): Array<string> { return null;\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 108 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "return code.split(\"\\n\");", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts70C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; } return null;\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "return Number((fraction / total * 100).toFixed(2));", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts94C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " public static setLogLevel (level: string) {\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " if (level === LogLevels.verbose) {\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " this.outputToConsole = true;\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " this.outputToJSON = true;\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " } else if (level === LogLevels.JSON) {\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " this.outputToJSON = true;\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " } else if (level === LogLevels.console) {\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " this.outputToConsole = true;\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " } else if (level === LogLevels.none) {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " this.outputToConsole = false;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " this.outputToJSON = false;\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 41 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " public static setLogLevel (level: string) {\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " if (level === LogLevels.verbose) {\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " this.outputToConsole = true;\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " this.outputToJSON = true;\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " } else if (level === LogLevels.JSON) {\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " this.outputToJSON = true;\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " } else if (level === LogLevels.console) {\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " this.outputToConsole = true;\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " } else if (level === LogLevels.none) {", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 41 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n this.outputToConsole = false;\r\n this.outputToJSON = false;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts98C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber - FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts102C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber / FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts106C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " private getTestFileContents (): string {\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " if (!this.file.testFileContents) {\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " this.file.testFileContents = this.readFile(this.file.testFileName);\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " return this.file.testFileContents;\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 78 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " private getTestFileContents (): string {", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineNumber": 78 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n if (!this.file.testFileContents) {\r\n this.file.testFileContents = this.readFile(this.file.testFileName);\r\n }\r\n return this.file.testFileContents;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts114C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private static filterOutTestFiles (files: Array<string>): Array<string> {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " return files.filter((file) => {\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " return !file.endsWith(this.testFileExtension + \".ts\");\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 100 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private static filterOutTestFiles (files: Array<string>): Array<string> {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " return files.filter((file) => {\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " return !file.endsWith(this.testFileExtension * \".ts\");\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 100 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts122C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return testFilesWithoutExtension.indexOf(basename(file)) >= 0;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return file.endsWith(this.testFileExtension + \".ts\");\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " constructor (private configurationFile: IConfigFile) {\r", | |
"lineNumber": 22 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " constructor ( protected configurationFile: IConfigFile) {\r", | |
"lineNumber": 22 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts134C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return fileName.substring(fileName.length - 3, fileName.length) === \".ts\";", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "{\r\n this.findTokenObjectsOfKind(element, kind);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n return Cleaner.isMutatedFile(element);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "{\r\n this.nodeFamily = [\r\n node.kind,\r\n node.parent.kind,\r\n node.parent.getChildAt(0).kind,\r\n node.parent.getChildAt(2).kind\r\n ];\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt( -1).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts6C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 118 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 118 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n Logger.fatal(\"Worker Error: \", err);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts10C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " Logger.log(\"All workers complete\");\r", | |
"lineNumber": 123 | |
}, | |
{ | |
"lineText": " this.threadResults = [].concat.apply([], this.threadResults);\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " this.finishRun();\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " return;\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 128 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " Logger.log(\"All workers complete\");\r", | |
"lineNumber": 123 | |
}, | |
{ | |
"lineText": " this.threadResults = [].concat.apply([], this.threadResults);\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " this.finishRun(); return null;\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 128 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "return;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts14C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " public modifyCode (currentNode: IMutatableNode, replacement: string): boolean {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " .substring(0, currentNode.positions.pos) + \" \"\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " + replacement\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " + this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " .substring(currentNode.positions.end, this.sourceObj.modifiedSourceCode.length);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " return this.isModificationDifferentFromSource(\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " this.sourceObj.originalSourceObject.text, this.sourceObj.modifiedSourceCode);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 33 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " public modifyCode (currentNode: IMutatableNode, replacement: string): boolean {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " .substring(0, currentNode.positions.pos) + \" \"\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " + replacement\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " + this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " .substring(currentNode.positions.end, this.sourceObj.modifiedSourceCode.length); return null;\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " private isModificationDifferentFromSource (original: string, modified: string): boolean {\r", | |
"lineNumber": 33 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "return this.isModificationDifferentFromSource(\r\n this.sourceObj.originalSourceObject.text, this.sourceObj.modifiedSourceCode);", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts18C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "return nodeText[0] === \"(\" && nodeText[nodeText.length - 1] === \")\";", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() - \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts26C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() / \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts30C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() * \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts34C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum < -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts38C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum - -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts42C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " private setToValue (value: number): string {\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " let newNumber = this.number;\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " return (newNumber = value).toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 45 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " private setToValue (value: number): string {", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 45 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "{\r\n let newNumber = this.number;\r\n return (newNumber = value).toString();\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts46C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " public static traverseFilesForNodes () {\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " Logger.dumpLogToConsole();\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " console.log(\"dd\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " NodeHandler.getAllNodesInFile(NodeHandler.fileDescriptors[i].codeInspector, i);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " if (this.fileNameNodes.length === 0) {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"No nodes found to mutate, check Professor X config settings.\", NodeHandler);\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " throw Error(\"No nodes found to mutate, check Professor X config settings.\");\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Logger.info(\"Found Nodes\", NodeHandler.fileNameNodes.length);\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " return NodeHandler.fileNameNodes;\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 31 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " public static traverseFilesForNodes () {\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " Logger.dumpLogToConsole();\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " console.log(\"dd\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " NodeHandler.getAllNodesInFile(NodeHandler.fileDescriptors[i].codeInspector, i);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " if (this.fileNameNodes.length === 0) {", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " Logger.info(\"Found Nodes\", NodeHandler.fileNameNodes.length);\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " return NodeHandler.fileNameNodes;\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "{\r\n Logger.fatal(\"No nodes found to mutate, check Professor X config settings.\", NodeHandler);\r\n throw Error(\"No nodes found to mutate, check Professor X config settings.\");\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts50C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutatedCode.push({\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 104 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end - 1; line++) {\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutatedCode.push({\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 104 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts54C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " public setMutationResultData (testFile: string, currentNode: IMutatableNode) {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " this.setTestFile(testFile);\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " try {\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " const methodBounds = this.getParentMethodBoundsOfMutatedLine(currentNode.positions.pos);\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " this.setSourceCodeLines(\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " {original: this.sourceCodeModifier.getOriginalSourceCode(),\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " mutated: this.sourceCodeModifier.getModifiedSourceCode()},\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " methodBounds);\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " } catch (err) {\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutationAttemptFailure = new MAttemptFail(\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " `The current nodes 'Start' and 'End' positions were undefined.\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " Or the method bounds for these positions could not be determined`,\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " currentNode.plainText,\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " currentNode\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 55 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " public setMutationResultData (testFile: string, currentNode: IMutatableNode) {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " this.setTestFile(testFile);\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " try {", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " } catch (err) {\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutationAttemptFailure = new MAttemptFail(\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " `The current nodes 'Start' and 'End' positions were undefined.\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " Or the method bounds for these positions could not be determined`,\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " currentNode.plainText,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " currentNode\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " public setTestFile (filename: string): void {\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.testFilePath = filename;\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 55 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n const methodBounds = this.getParentMethodBoundsOfMutatedLine(currentNode.positions.pos);\r\n this.setSourceCodeLines(\r\n {original: this.sourceCodeModifier.getOriginalSourceCode(),\r\n mutated: this.sourceCodeModifier.getModifiedSourceCode()},\r\n methodBounds);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts58C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " public getAllMethodNames () {\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " const inspector = new CodeInspector(this.currentSourceCodeObject);\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " return inspector.findObjectsOfSyntaxKind(ts.SyntaxKind.MethodDeclaration)\r", | |
"lineNumber": 82 | |
}, | |
{ | |
"lineText": " .map((obj) => obj = {pos: 2 + obj.pos, end: obj.end} );\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 84 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " public getAllMethodNames () {\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " const inspector = new CodeInspector(this.currentSourceCodeObject);\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " return inspector.findObjectsOfSyntaxKind(ts.SyntaxKind.MethodDeclaration)\r", | |
"lineNumber": 82 | |
}, | |
{ | |
"lineText": " .map((obj) => obj = {pos: 2 + obj.pos, end: obj.end} );\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " } protected setoriginalCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 84 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts62C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "return this.syntaxMutationMap[syntaxKind];", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "return dividedResults;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed( 1));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "2", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts90C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n this.outputToConsole = true;\r\n this.outputToJSON = true;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath - FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts98C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath / FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts102C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n this.file = file;\r\n if (!fs.existsSync(this.file.fullPath)) {\r\n Logger.fatal(\"File Path requested doesn't exist\", this.file);\r\n throw new Error(`File '${this.file.fullPath}' doesn't exist`);\r\n }\r\n if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r\n Logger.fatal(\"Incorrect file extension filtered out\", this.file);\r\n throw new Error(\"Typescript files must end with .ts\");\r\n }\r\n this.file.testFileName = this.file.testFilePath;\r\n\r\n if (!fs.existsSync(this.file.testFileName)) {\r\n Logger.fatal(`No test file found matching this source file.\r\n Spelling of source and test must match exactly and test must end in .ts`,\r\n {fileName: this.file, testFileName: this.file.testFileName});\r\n throw new Error(\"No existing test file that matches this file\");\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " public getSourceObject (): ts.SourceFile {\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " return (this.file.sourceObject) ? this.file.sourceObject :\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " ts.createSourceFile(this.file.filename, this.getSourceCode (), ts.ScriptTarget.ES2015, true);\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 43 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " public getSourceObject (): ts.SourceFile { return null;\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 43 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "return (this.file.sourceObject) ? this.file.sourceObject :\r\n ts.createSourceFile(this.file.filename, this.getSourceCode (), ts.ScriptTarget.ES2015, true);", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts114C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n if (fs.statSync(file).isDirectory()) {\r\n return fs.readdirSync(file);\r\n } else {\r\n return [];\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{ return 1; }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return basename(file.replace(this.testFileExtension, \"\"));", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return null; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return 1;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts134C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " public static isNodeMutatable (node: Node): boolean {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " const mutationRules = new ValidMutationRules();\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " mutationRules.setNodeFamily(node);\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " if (mutationRules.nodeFamily === void 0) { return false; }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " return mutationRules.traverseRuleTree(ValidMutationRules.RULE_TREE, 0);\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 16 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " public static isNodeMutatable (node: Node): boolean {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " const mutationRules = new ValidMutationRules();\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " mutationRules.setNodeFamily(node);\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " if (mutationRules.nodeFamily === void 0) { return true; }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " return mutationRules.traverseRuleTree(ValidMutationRules.RULE_TREE, 0);\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 16 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "false", | |
"mutationType": "Inverting a Boolean", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.spec.ts138C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " private static removeFoundFiles (fileArray) {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " fileArray.forEach((file) => {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " fs.unlinkSync(ConfigManager.filePath + file);\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 52 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " private static removeFoundFiles (fileArray) {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " fileArray.forEach((file) => {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " fs.unlinkSync(ConfigManager.filePath - file);\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 52 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts142C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public static deleteTestFile (filePath: string) {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " if (!Cleaner.isMutatedFile(filePath)) {\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " Logger.warn(`${filePath} is not a mutated test file. Tried to delete a non mutated file.`);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " fs.unlink(filePath, (err) => {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " if (err !== null) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not delete test file\", {path: filePath, error: err});\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public static deleteTestFile (filePath: string) {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " if (!Cleaner.isMutatedFile(filePath)) {\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " Logger.warn(`${filePath} is not a mutated test file. Tried to delete a non mutated file.`);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " fs.unlink(filePath, (err) => {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " if (err !== null) {", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n Logger.warn(\"Could not delete test file\", {path: filePath, error: err});\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts146C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " [SyntaxKind.VoidExpression]: false\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 27 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " [SyntaxKind.VoidExpression]: true\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 27 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "false", | |
"mutationType": "Inverting a Boolean", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts1C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " if (this.splitNodes.length < this.logicalCores) {\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " this.logicalCores = this.splitNodes.length;\r", | |
"lineNumber": 43 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " if (this.splitNodes.length < this.logicalCores) {", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 43 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n this.logicalCores = this.splitNodes.length;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts13C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " Logger.log(\"All workers complete\");\r", | |
"lineNumber": 123 | |
}, | |
{ | |
"lineText": " this.threadResults = [].concat.apply([], this.threadResults);\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " this.finishRun();\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " return;\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 128 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 123 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 128 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n Logger.log(\"All workers complete\");\r\n this.threadResults = [].concat.apply([], this.threadResults);\r\n this.finishRun();\r\n return;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts17C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " public modifyCode (currentNode: IMutatableNode, replacement: string): boolean {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " .substring(0, currentNode.positions.pos) + \" \"\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " + replacement\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " + this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " .substring(currentNode.positions.end, this.sourceObj.modifiedSourceCode.length);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " return this.isModificationDifferentFromSource(\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " this.sourceObj.originalSourceObject.text, this.sourceObj.modifiedSourceCode);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 33 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " public modifyCode (currentNode: IMutatableNode, replacement: string): boolean {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " .substring( 0, currentNode.positions.pos) + \" \"\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " + replacement\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " + this.sourceObj.modifiedSourceCode\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " .substring(currentNode.positions.end, this.sourceObj.modifiedSourceCode.length);\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " return this.isModificationDifferentFromSource(\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " this.sourceObj.originalSourceObject.text, this.sourceObj.modifiedSourceCode);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 33 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts29C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " this.removeParentheses()\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return {mutations: arrayOfMutations, mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) { return null;\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " this.removeParentheses()\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " return {mutations: arrayOfMutations, mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " public isNodeValidForMutation (nodeText: string): boolean {\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "return {mutations: [], mutationClass: MutationClass.Parenthesis_Removal};", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts37C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName - \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts41C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() / \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts45C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() * \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts49C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineNumber": 44 | |
}, | |
{ | |
"lineNumber": 45 | |
}, | |
{ | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "{\r\n const rootName = ConfigManager.filePath.split(\"/\")[1];\r\n OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r\n new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r\n new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r\n \".json\".toString();\r\n return OutputToJSON.outputfilePath;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts53C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " public isNodeValidForMutation (nodeText: string) {\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " return !isNaN(parseInt(nodeText, 10));\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " private addOne (): string {\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "{\r\n if (!this.isNodeValidForMutation(this.plainText)) {\r\n return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r\n }\r\n const arrayOfMutations = this.removeDuplicateMutations([\r\n this.addOne(), this.minusOne(), this.multiplyByNegative(),\r\n this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r\n ]);\r\n return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts57C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " private minusOne (): string {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return (boundChangedNumber--).toString();\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " private minusOne (): string {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number; return null;\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "return (boundChangedNumber--).toString();", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts61C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " public static traverseFilesForNodes () {\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " Logger.dumpLogToConsole();\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " console.log(\"dd\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " NodeHandler.getAllNodesInFile(NodeHandler.fileDescriptors[i].codeInspector, i);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " if (this.fileNameNodes.length === 0) {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"No nodes found to mutate, check Professor X config settings.\", NodeHandler);\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " throw Error(\"No nodes found to mutate, check Professor X config settings.\");\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Logger.info(\"Found Nodes\", NodeHandler.fileNameNodes.length);\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " return NodeHandler.fileNameNodes;\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 31 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " public static traverseFilesForNodes () {", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " public static getAllNodesInFile (codeInspector: CodeInspector, fileNameIndex: number): void {\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " MutationFactory.mutatableTokens.forEach((syntaxItem) => {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " codeInspector.findObjectsOfSyntaxKind(syntaxItem).forEach((token) => {\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " NodeHandler.fileNameNodes.push({\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " syntaxType: syntaxItem,\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " positions: {pos: token.pos, end: token.end},\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " parentFilePath: ConfigManager.filesToMutate[fileNameIndex],\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " plainText: token.getText(),\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " associatedTestFilePath: ConfigManager.testFiles[fileNameIndex]\r", | |
"lineNumber": 31 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "{\r\n Logger.dumpLogToConsole();\r\n console.log(\"dd\", ConfigManager.filesToMutate.length);\r\n for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r\n NodeHandler.getAllNodesInFile(NodeHandler.fileDescriptors[i].codeInspector, i);\r\n }\r\n if (this.fileNameNodes.length === 0) {\r\n Logger.fatal(\"No nodes found to mutate, check Professor X config settings.\", NodeHandler);\r\n throw Error(\"No nodes found to mutate, check Professor X config settings.\");\r\n }\r\n Logger.info(\"Found Nodes\", NodeHandler.fileNameNodes.length);\r\n return NodeHandler.fileNameNodes;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts65C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n this.sourceCodeModifier = sourceCodeModifier;\r\n this.currentSourceCodeObject = sourceCodeModifier.getOriginalSourceObject();\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " private currentMutationResult: MutationResult;\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " private sourceCodeModifier: SourceCodeModifier;\r", | |
"lineNumber": 17 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " private currentMutationResult: MutationResult; protected sourceCodeModifier: SourceCodeModifier;\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " private currentSourceCodeObject: ts.SourceFile;\r", | |
"lineNumber": 17 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts77C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "return [].concat(...[this.getMultipleMutations(node.syntaxType), this.getComplexMutations(node)]);", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "{\r\n if (total === 0) { return 0; }\r\n return Number((fraction / total * 100).toFixed(2));\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts93C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "false", | |
"mutationType": "Inverting a Boolean" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " private static outputToConsole: boolean;\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " private static outputToJSON: boolean;\r", | |
"lineNumber": 27 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " private static outputToConsole: boolean; protected static outputToJSON: boolean;\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 27 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts101C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" - this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts105C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " private readFile (path: string): string {\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " return fs.readFileSync(path).toString();\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 71 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " private readFile (path: string): string {\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " return fs.readFileSync(path).toString();\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " } protected getTestFileContents (): string {\r", | |
"lineNumber": 71 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts117C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" + file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" / file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts121C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return this.filesToMutate.filter((item) => {\r\n return this.filesToSkip.indexOf(item) < 0;\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n if (basename(a) >= basename(b)) {\r\n return -1;\r\n } else { return 1; }\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " private setProjectTestFiles () {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.filterOutSrcFiles(\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(ConfigManager.testFilePath));\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 111 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " private setProjectTestFiles () {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.filterOutSrcFiles(\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(ConfigManager.testFilePath));\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } protected getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 111 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts133C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return 1;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "{\r\n const mutationRules = new ValidMutationRules();\r\n mutationRules.setNodeFamily(node);\r\n if (mutationRules.nodeFamily === void 0) { return false; }\r\n return mutationRules.traverseRuleTree(ValidMutationRules.RULE_TREE, 0);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public static deleteSourceFile (fileToDelete: string) {\r", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": " fs.unlink(fileToDelete, (err) => {\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " if (err !== null) {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not delete source file\", {filePath: fileToDelete, error: err});\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public static deleteSourceFile (fileToDelete: string) {", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " public static deleteTestFile (filePath: string) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " if (!Cleaner.isMutatedFile(filePath)) {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " Logger.warn(`${filePath} is not a mutated test file. Tried to delete a non mutated file.`);\r", | |
"lineNumber": 15 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n fs.unlink(fileToDelete, (err) => {\r\n if (err !== null) {\r\n Logger.warn(\"Could not delete source file\", {filePath: fileToDelete, error: err});\r\n }\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts145C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "return filePath.substring(filePath.length - FileObject.M_SOURCE_FILE_SUFFIX.length)\r\n === FileObject.M_SOURCE_FILE_SUFFIX;", | |
"mutationType": "Modifying a Return Statement to return null" | |
} | |
], | |
[ | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n this.progressDisplay.summaryProgressBar = this.progressDisplay.createProgressBar(\r\n \"Generating Summary: |:bar| :percent | Time Elapsed :elapsed\",\r\n this.threadResults.length);\r\n\r\n const filesMutated: IMutationScoresPerFile = {\r\n files: ConfigManager.filesToMutate,\r\n mutantsSurvivedForEach: [],\r\n totalMutationsForEach: []\r\n };\r\n filesMutated.files.forEach((file) => {\r\n filesMutated.mutantsSurvivedForEach.push(0);\r\n filesMutated.totalMutationsForEach.push(0);\r\n });\r\n\r\n this.threadResults.forEach((item, index) => {\r\n const indexOfSRCFile = ConfigManager.filesToMutate.indexOf(item.SRC_FILE);\r\n if (indexOfSRCFile >= 0) {\r\n filesMutated.totalMutationsForEach[indexOfSRCFile] ++;\r\n }\r\n if (item.mutatedCode !== null) {\r\n filesMutated.mutantsSurvivedForEach[indexOfSRCFile] ++;\r\n }\r\n this.progressDisplay.tickBar(this.progressDisplay.summaryProgressBar);\r\n });\r\n return filesMutated;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " constructor (private inputNodes: Array<IMutatableNode>) {\r", | |
"lineNumber": 36 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " constructor ( protected inputNodes: Array<IMutatableNode>) {\r", | |
"lineNumber": 36 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts14C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " private isModificationDifferentFromSource (original: string, modified: string): boolean {\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " return !(original === modified);\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 37 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " private isModificationDifferentFromSource (original: string, modified: string): boolean { return null;\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 37 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "return !(original === modified);", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts22C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " public resetModified (): void {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.originalSourceObject.getText();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " public resetModified (): void {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " this.sourceObj.modifiedSourceCode = this.sourceObj.originalSourceObject.getText();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 23 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts26C11936undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "1", | |
"nodeToBeMutated": { | |
"syntaxType": 8, | |
"positions": { | |
"pos": 686, | |
"end": 687 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"plainText": "1", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" - new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts30C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" /\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts34C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" * new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts38C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "export class NumericLiteral extends ComplexMutations {\r", | |
"lineNumber": 5 | |
}, | |
{ | |
"lineText": " private number: number;\r", | |
"lineNumber": 6 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "export class NumericLiteral extends ComplexMutations { protected number: number;\r", | |
"lineNumber": 5 | |
}, | |
{ | |
"lineText": " constructor (plainText: string) {\r", | |
"lineNumber": 6 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts42C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue( 1), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts46C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * - 0).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts50C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n return {pos: characterOfMutation - 5, end: characterOfMutation + 10};\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "return methodBounds;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "{\r\n return {mutations: [], mutationClass: \"No Simple Mutations Found for this Syntax Kind\"};\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total / 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts82C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total !== 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts86C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "{\r\n /*\r\n convert millis to date time adapted from\r\n https://gist.github.com/remino/1563878\r\n */\r\n let ms = runTime;\r\n ms = ms % 1000;\r\n let s = Math.floor(runTime / 1000);\r\n let m = Math.floor(s / 60);\r\n s = s % 60;\r\n let h = Math.floor(m / 60);\r\n m = m % 60;\r\n const d = Math.floor(h / 24);\r\n h = h % 24;\r\n return { d, h, m, s, ms };\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "false", | |
"mutationType": "Inverting a Boolean" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " };\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " private static outputToConsole: boolean;\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " }; protected static outputToConsole: boolean;\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " private static outputToJSON: boolean;\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts98C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ - \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts102C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts110C11936undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "-", | |
"nodeToBeMutated": { | |
"syntaxType": 38, | |
"positions": { | |
"pos": 699, | |
"end": 701 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"plainText": "-", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " public mutateTestFileReference (contents: string): string {\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " const filenameNoExtension = this.file.filename.substring(0, this.file.filename.length - 3);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " contents = contents.replace(\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension,\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension + \".ts\" + FileObject.counter + \"C\" + this.file.coreNumber + \".m\"\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " return contents;\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 67 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " public mutateTestFileReference (contents: string): string {\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " const filenameNoExtension = this.file.filename.substring(0, this.file.filename.length - 3);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " contents = contents.replace(\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension,\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension + \".ts\" + FileObject.counter + \"C\" + this.file.coreNumber + \".m\"\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " return contents;\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " } protected readFile (path: string): string {\r", | |
"lineNumber": 67 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts114C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" + file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath - \"/\" + file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts118C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n ConfigManager.filesToMutate =\r\n ConfigManager.removeSrcFilesWhichDontHaveTests(\r\n ConfigManager.filterOutTestFiles(\r\n this.getAllProjectFiles(ConfigManager.filePath))\r\n );\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n const currentDir = ConfigManager.readfileDirectory(filePath);\r\n currentDir.forEach((file) => {\r\n if (ConfigManager.isTypescriptFile(file)) {\r\n this.projectFilesRetrieved.push(resolve(filePath, file));\r\n } else {\r\n this.getAllProjectFiles(filePath + \"/\" + file);\r\n }\r\n });\r\n return this.projectFilesRetrieved;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " private static filterFilesToMutateBySkipped (): Array<string> {\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " return this.filesToMutate.filter((item) => {\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " return this.filesToSkip.indexOf(item) < 0;\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 82 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 77 | |
}, | |
{ | |
"lineText": " private static filterFilesToMutateBySkipped (): Array<string> {\r", | |
"lineNumber": 78 | |
}, | |
{ | |
"lineText": " return this.filesToMutate.filter((item) => {\r", | |
"lineNumber": 79 | |
}, | |
{ | |
"lineText": " return this.filesToSkip.indexOf(item) < 0;\r", | |
"lineNumber": 80 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 81 | |
}, | |
{ | |
"lineText": " } protected static readfileDirectory (file: string): Array<string> {\r", | |
"lineNumber": 82 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts130C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return !file.endsWith(this.testFileExtension + \".ts\");", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " constructor (private sourceObject: SourceFile) {}\r", | |
"lineNumber": 9 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " constructor ( protected sourceObject: SourceFile) {}\r", | |
"lineNumber": 9 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.spec.ts138C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "return filtered;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "return this.traverseRuleTree(tree[currentTreePosition[indexOfFamilyMember]], nodeFamilyIndex + 1);", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " public setNodeFamily (node: Node) {\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " if (node.parent.getChildCount() === 3) {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind,\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt( 2).kind\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " this.nodeFamily = [\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " node.kind,\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " node.parent.kind,\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " node.parent.getChildAt(0).kind\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " ];\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "2", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts7C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "2", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 118 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " if (this.threadResults.length >= this.logicalCores) {\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " Logger.log(\"All workers complete\");\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " this.threadResults = [].concat.apply([], this.threadResults);\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.finishRun();\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " return;\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp - this.startTimestamp).getTime()\r", | |
"lineNumber": 118 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n individualWorker.on(\"error\", (err) => {\r\n Logger.fatal(\"Worker Error: \", err);\r\n });\r\n individualWorker.on(\"exit\", (exit) => {\r\n Logger.info(\"Worker Exit: \", exit);\r\n });\r\n individualWorker.on(\"message\", (data) => {\r\n if (data === \"tick\") {\r\n this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r\n } else {\r\n this.collateResults(data);\r\n Logger.info(\"Worker Complete\", individualWorker.pid);\r\n individualWorker.kill();\r\n Logger.info(\"Worker Killed\", individualWorker.pid);\r\n }\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts15C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "return {\r\n totalKilledMutants: numberOfKilledOrErrored,\r\n totalSurvivingMutants: survivingMutants,\r\n mutationScore: MathFunctions.calculatePercentage(\r\n numberOfKilledOrErrored, mutationsPerformed)\r\n };", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " constructor (private readonly sourceObj: SourceObject) {}\r", | |
"lineNumber": 7 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " constructor ( protected readonly sourceObj: SourceObject) {}\r", | |
"lineNumber": 7 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts27C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length - 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length + 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts31C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " this.removeParentheses()\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return {mutations: arrayOfMutations, mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " this.removeParentheses()\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " ]); return null;\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " public isNodeValidForMutation (nodeText: string): boolean {\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "return {mutations: arrayOfMutations, mutationClass: MutationClass.Parenthesis_Removal};", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts35C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" - new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts39C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" / new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts43C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public static writeResults (collatedResults: EndResult) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " this.getOutFilePath();\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " const header = {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " runner: collatedResults.runner,\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " config: collatedResults.runnerConf,\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " duration: collatedResults.duration,\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " scoresPerFile: collatedResults.mutationScoresPerFile,\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " overallScores: collatedResults.overallScores\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " const results = collatedResults.results;\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " const transformStream = JSONStream.stringify();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " const outputStream = fs.createWriteStream(OutputToJSON.outputfilePath);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " Logger.log(\"Results File Path\", OutputToJSON.outputfilePath);\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " transformStream.pipe(outputStream);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " transformStream.write(header);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " MathFunctions.divideItemsAmongArrays(results,\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Math.floor(results.length / (results.length / 4))\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " ).forEach((result) => {\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " transformStream.write(result);\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " Logger.info(\"Length of Division\", result.length);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " transformStream.end();\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " outputStream.on(\"finish\", () => {Logger.log(\"Results Written to Disk\"); });\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 37 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public static writeResults (collatedResults: EndResult) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " this.getOutFilePath();\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " const header = {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " runner: collatedResults.runner,\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " config: collatedResults.runnerConf,\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " duration: collatedResults.duration,\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " scoresPerFile: collatedResults.mutationScoresPerFile,\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " overallScores: collatedResults.overallScores\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " const results = collatedResults.results;\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " const transformStream = JSONStream.stringify();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " const outputStream = fs.createWriteStream(OutputToJSON.outputfilePath);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " Logger.log(\"Results File Path\", OutputToJSON.outputfilePath);\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " transformStream.pipe(outputStream);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " transformStream.write(header);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " MathFunctions.divideItemsAmongArrays(results,\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Math.floor(results.length / results.length / 4)\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " ).forEach((result) => {\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " transformStream.write(result);\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " Logger.info(\"Length of Division\", result.length);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " transformStream.end();\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " outputStream.on(\"finish\", () => {Logger.log(\"Results Written to Disk\"); });\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 37 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "(results.length / 4)", | |
"mutationType": "Removal of Parenthesis in a statement", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts47C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]); return null;\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts51C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(- 0)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts55C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " public static createAllFileDescriptors (): Array<IFileDescriptor> {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.filter((srcFile) => {if (existsSync(srcFile)) { return srcFile; } });\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.filter((testFile) => { if (existsSync(testFile)) {return testFile; } });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " console.log(\"before\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " // if (!this.fileExists(ConfigManager.filesToMutate[i]) || !this.fileExists(ConfigManager.testFiles[i])) {\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " // console.log(\"file removed\", ConfigManager.filesToMutate[i]);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.splice(\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.indexOf(ConfigManager.filesToMutate[i], 1));\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.splice(\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.indexOf(ConfigManager.testFiles[i], 1));\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " // NodeHandler.fileDescriptors.splice(i, 1);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " // } else {\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " console.log(\"file\", i);\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " const fo = new FileObject(ConfigManager.filesToMutate[i], ConfigManager.testFiles[i]);\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " const fh = new FileHandler(fo);\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " const so = new SourceObject(fh.getSourceObject());\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " const ci = new CodeInspector(so.originalSourceObject);\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " NodeHandler.fileDescriptors.push({\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " fileName: ConfigManager.filesToMutate[i],\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " fileObject: fo, fileHandler: fh, sourceObject: so, codeInspector: ci\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " // }\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " console.log(\"aa\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " console.log(\"file desc\", NodeHandler.fileDescriptors.length);\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " return NodeHandler.fileDescriptors;\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 77 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " public static createAllFileDescriptors (): Array<IFileDescriptor> {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.filter((srcFile) => {if (existsSync(srcFile)) { return srcFile; } });\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.filter((testFile) => { if (existsSync(testFile)) {return testFile; } });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " console.log(\"before\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " // if (!this.fileExists(ConfigManager.filesToMutate[i]) || !this.fileExists(ConfigManager.testFiles[i])) {\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " // console.log(\"file removed\", ConfigManager.filesToMutate[i]);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.splice(\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.indexOf(ConfigManager.filesToMutate[i], 1));\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.splice(\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.indexOf(ConfigManager.testFiles[i], 1));\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " // NodeHandler.fileDescriptors.splice(i, 1);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " // } else {\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " console.log(\"file\", i);\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " const fo = new FileObject(ConfigManager.filesToMutate[i], ConfigManager.testFiles[i]);\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " const fh = new FileHandler(fo);\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " const so = new SourceObject(fh.getSourceObject());\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " const ci = new CodeInspector(so.originalSourceObject);\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " NodeHandler.fileDescriptors.push({\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " fileName: ConfigManager.filesToMutate[i],\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " fileObject: fo, fileHandler: fh, sourceObject: so, codeInspector: ci\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " // }\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " console.log(\"aa\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " console.log(\"file desc\", NodeHandler.fileDescriptors.length); return null;\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 77 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "return NodeHandler.fileDescriptors;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts59C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " public getCurrentMutationResult (): MutationResult {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.currentMutationResult;\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " public getCurrentMutationResult (): MutationResult {", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n return this.currentMutationResult;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts63C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutatedCode.push({\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 104 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " private splitCodeByLine (code: string): Array<string> {\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " return code.split(\"\\n\");\r", | |
"lineNumber": 104 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n this.currentMutationResult.mutatedCode.push({\r\n lineText: splitCode[line],\r\n lineNumber: ++ method.start\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts67C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "{\r\n return [].concat(...[this.getMultipleMutations(node.syntaxType), this.getComplexMutations(node)]);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "true", | |
"mutationType": "Inverting a Boolean" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " public static log (message: string, object? : any): void {\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " this.logContent.log.push(\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " {logType: LogTypes.log, timestamp: new Date().getTime(), messageText: message, obj: object});\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 60 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " public static log (message: string, object? : any): void {", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 60 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n this.logContent.log.push(\r\n {logType: LogTypes.log, timestamp: new Date().getTime(), messageText: message, obj: object});\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.spec.ts99C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber / FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts103C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber * FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts107C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " public getSourceObject (): ts.SourceFile {\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " return (this.file.sourceObject) ? this.file.sourceObject :\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " ts.createSourceFile(this.file.filename, this.getSourceCode (), ts.ScriptTarget.ES2015, true);\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 43 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " public getSourceObject (): ts.SourceFile {\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " return (this.file.sourceObject) ? this.file.sourceObject :\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " ts.createSourceFile(this.file.filename, this.getSourceCode (), ts.ScriptTarget.ES2015, false);\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 43 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "true", | |
"mutationType": "Inverting a Boolean", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts111C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "return this.file.sourceCode;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " public mutateTestFileReference (contents: string): string {\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " const filenameNoExtension = this.file.filename.substring(0, this.file.filename.length - 3);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " contents = contents.replace(\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension,\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension + \".ts\" + FileObject.counter + \"C\" + this.file.coreNumber + \".m\"\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " return contents;\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 67 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " public mutateTestFileReference (contents: string): string {\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " const filenameNoExtension = this.file.filename.substring( -1, this.file.filename.length - 3);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " contents = contents.replace(\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension,\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " \"/\" + filenameNoExtension + \".ts\" + FileObject.counter + \"C\" + this.file.coreNumber + \".m\"\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " return contents;\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 67 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts119C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " public configValid () {\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " Object.keys(ConfigManager).forEach((el) => {\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " if (ConfigManager[el] === void 0) {\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Professor X config not valid. Not all keys are defined\", this);\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " throw new Error(\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " \"Professor X config not valid. Not all keys are defined\"\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 76 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " public configValid () {", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " private static filterFilesToMutateBySkipped (): Array<string> {\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " return this.filesToMutate.filter((item) => {\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " return this.filesToSkip.indexOf(item) < 0;\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 76 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n Object.keys(ConfigManager).forEach((el) => {\r\n if (ConfigManager[el] === void 0) {\r\n Logger.fatal(\"Professor X config not valid. Not all keys are defined\", this);\r\n throw new Error(\r\n \"Professor X config not valid. Not all keys are defined\"\r\n );\r\n }\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts127C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n this.projectFilesRetrieved.push(resolve(filePath, file));\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " private static isTypescriptFile (fileName: string): boolean {\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " return fileName.substring(fileName.length - 3, fileName.length) === \".ts\";\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 94 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " private static isTypescriptFile (fileName: string): boolean {\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " return fileName.substring(fileName.length - 3, fileName.length) === \".ts\";\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " } protected static filterOutTestFiles (files: Array<string>): Array<string> {\r", | |
"lineNumber": 94 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts135C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return file.endsWith(this.testFileExtension + \".ts\");", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " public static isNodeMutatable (node: Node): boolean {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " const mutationRules = new ValidMutationRules();\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " mutationRules.setNodeFamily(node);\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " if (mutationRules.nodeFamily === void 0) { return false; }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " return mutationRules.traverseRuleTree(ValidMutationRules.RULE_TREE, 0);\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 16 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " public static isNodeMutatable (node: Node): boolean {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " const mutationRules = new ValidMutationRules();\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " mutationRules.setNodeFamily(node);\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " if (mutationRules.nodeFamily === void 0) { return null; }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " return mutationRules.traverseRuleTree(ValidMutationRules.RULE_TREE, 0);\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 16 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "return false;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.spec.ts143C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " public static isMutatedFile (filePath: string): boolean {\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " return filePath.substring(filePath.length - FileObject.M_SOURCE_FILE_SUFFIX.length)\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " === FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " public static isMutatedFile (filePath: string): boolean {\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " return filePath.substring(filePath.length - FileObject.M_SOURCE_FILE_SUFFIX.length)\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " === FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " } protected static removeFoundFiles (fileArray) {\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts147C3912undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "return true;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "process.on(\"SIGINT\", () => {\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"User Pressed Ctrl + C: SIGINT Caught. Program ending.\");\r", | |
"lineNumber": 20 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "process.on(\"SIGINT\", () => {", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 20 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n Logger.fatal(\"User Pressed Ctrl + C: SIGINT Caught. Program ending.\");\r\n Logger.log(\"Deleting Generated Files\");\r\n Logger.fatal(\"User ended program\");\r\n Cleaner.cleanRemainingFiles();\r\n}", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts7C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": " this.collateResults(data);\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Complete\", individualWorker.pid);\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " individualWorker.kill();\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Killed\", individualWorker.pid);\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 118 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " private createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"error\", (err) => {\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Worker Error: \", err);\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 104 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"exit\", (exit) => {\r", | |
"lineNumber": 105 | |
}, | |
{ | |
"lineText": " Logger.info(\"Worker Exit: \", exit);\r", | |
"lineNumber": 106 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 107 | |
}, | |
{ | |
"lineText": " individualWorker.on(\"message\", (data) => {\r", | |
"lineNumber": 108 | |
}, | |
{ | |
"lineText": " if (data === \"tick\") {\r", | |
"lineNumber": 109 | |
}, | |
{ | |
"lineText": " this.progressDisplay.tickBar(this.progressDisplay.mutationProgressBar);\r", | |
"lineNumber": 110 | |
}, | |
{ | |
"lineText": " } else {", | |
"lineNumber": 111 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " private collateResults (data) {\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " this.threadResults.push(data);\r", | |
"lineNumber": 118 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n this.collateResults(data);\r\n Logger.info(\"Worker Complete\", individualWorker.pid);\r\n individualWorker.kill();\r\n Logger.info(\"Worker Killed\", individualWorker.pid);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts11C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " constructor (private readonly sourceObj: SourceObject) {}\r", | |
"lineNumber": 7 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public getOriginalSourceObject (): SourceFile {\r", | |
"lineNumber": 9 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " constructor (private readonly sourceObj: SourceObject) {", | |
"lineNumber": 7 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 9 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "{}", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts15C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "import { IMutatableNode } from \"../../interfaces/IMutatableNode\";\r", | |
"lineNumber": 3 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 4 | |
}, | |
{ | |
"lineText": "export class SourceCodeModifier {\r", | |
"lineNumber": 5 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "import { IMutatableNode } from \"../../interfaces/IMutatableNode\";\r", | |
"lineNumber": 3 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 4 | |
}, | |
{ | |
"lineText": "export class SourceCodeModifier {\r", | |
"lineNumber": 5 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"targetNode": "{\r\n const green = \"\\u001b[42m \\u001b[0m\";\r\n const red = \"\\u001b[41m \\u001b[0m\";\r\n const ProgressBar = require(\"node-progress-3\");\r\n // only works using require syntax\r\n const bar = new ProgressBar({\r\n format: barFormat,\r\n complete: green,\r\n incomplete: red,\r\n total: length,\r\n width: 60\r\n });\r\n bar.onComplete = () => { console.log(\"\"); };\r\n return bar;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts19C12704undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "{\r\n const green = \"\\u001b[42m \\u001b[0m\";\r\n const red = \"\\u001b[41m \\u001b[0m\";\r\n const ProgressBar = require(\"node-progress-3\");\r\n // only works using require syntax\r\n const bar = new ProgressBar({\r\n format: barFormat,\r\n complete: green,\r\n incomplete: red,\r\n total: length,\r\n width: 60\r\n });\r\n bar.onComplete = () => { console.log(\"\"); };\r\n return bar;\r\n }", | |
"nodeToBeMutated": { | |
"syntaxType": 208, | |
"positions": { | |
"pos": 165, | |
"end": 637 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"plainText": "{\r\n const green = \"\\u001b[42m \\u001b[0m\";\r\n const red = \"\\u001b[41m \\u001b[0m\";\r\n const ProgressBar = require(\"node-progress-3\");\r\n // only works using require syntax\r\n const bar = new ProgressBar({\r\n format: barFormat,\r\n complete: green,\r\n incomplete: red,\r\n total: length,\r\n width: 60\r\n });\r\n bar.onComplete = () => { console.log(\"\"); };\r\n return bar;\r\n }", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length - 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " return this.plainText.substring( 1, this.plainText.length - 1);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts23C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() / \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts27C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() * \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts31C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public static writeResults (collatedResults: EndResult) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " this.getOutFilePath();\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " const header = {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " runner: collatedResults.runner,\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " config: collatedResults.runnerConf,\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " duration: collatedResults.duration,\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " scoresPerFile: collatedResults.mutationScoresPerFile,\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " overallScores: collatedResults.overallScores\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " const results = collatedResults.results;\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " const transformStream = JSONStream.stringify();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " const outputStream = fs.createWriteStream(OutputToJSON.outputfilePath);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " Logger.log(\"Results File Path\", OutputToJSON.outputfilePath);\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " transformStream.pipe(outputStream);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " transformStream.write(header);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " MathFunctions.divideItemsAmongArrays(results,\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Math.floor(results.length / (results.length / 4))\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " ).forEach((result) => {\r", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": " transformStream.write(result);\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " Logger.info(\"Length of Division\", result.length);\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " transformStream.end();\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " outputStream.on(\"finish\", () => {Logger.log(\"Results Written to Disk\"); });\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 37 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public static writeResults (collatedResults: EndResult) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " this.getOutFilePath();\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " const header = {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " runner: collatedResults.runner,\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " config: collatedResults.runnerConf,\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " duration: collatedResults.duration,\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " scoresPerFile: collatedResults.mutationScoresPerFile,\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " overallScores: collatedResults.overallScores\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " const results = collatedResults.results;\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " const transformStream = JSONStream.stringify();\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " const outputStream = fs.createWriteStream(OutputToJSON.outputfilePath);\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " Logger.log(\"Results File Path\", OutputToJSON.outputfilePath);\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " transformStream.pipe(outputStream);\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 26 | |
}, | |
{ | |
"lineText": " transformStream.write(header);\r", | |
"lineNumber": 27 | |
}, | |
{ | |
"lineText": " MathFunctions.divideItemsAmongArrays(results,\r", | |
"lineNumber": 28 | |
}, | |
{ | |
"lineText": " Math.floor(results.length / (results.length / 4))\r", | |
"lineNumber": 29 | |
}, | |
{ | |
"lineText": " ).forEach((result) => {", | |
"lineNumber": 30 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " transformStream.end();\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " outputStream.on(\"finish\", () => {Logger.log(\"Results Written to Disk\"); });\r", | |
"lineNumber": 35 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 37 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "{\r\n transformStream.write(result);\r\n Logger.info(\"Length of Division\", result.length);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts35C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum <= -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts39C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum * -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 36 | |
}, | |
{ | |
"lineText": " private multiplyByNegative (): string {\r", | |
"lineNumber": 37 | |
}, | |
{ | |
"lineText": " const negativeNum = this.number;\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " return (negativeNum + -1).toString();\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 40 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "*", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts43C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " private minusOne (): string {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return (boundChangedNumber--).toString();\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " private minusOne (): string {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return (boundChangedNumber--).toString();\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " } protected multiplyByNegative (): string {\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts47C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " public static createAllFileDescriptors (): Array<IFileDescriptor> {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.filter((srcFile) => {if (existsSync(srcFile)) { return srcFile; } });\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.filter((testFile) => { if (existsSync(testFile)) {return testFile; } });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " console.log(\"before\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " // if (!this.fileExists(ConfigManager.filesToMutate[i]) || !this.fileExists(ConfigManager.testFiles[i])) {\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " // console.log(\"file removed\", ConfigManager.filesToMutate[i]);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.splice(\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " // ConfigManager.filesToMutate.indexOf(ConfigManager.filesToMutate[i], 1));\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.splice(\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " // ConfigManager.testFiles.indexOf(ConfigManager.testFiles[i], 1));\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": " // NodeHandler.fileDescriptors.splice(i, 1);\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": " // } else {\r", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineText": " console.log(\"file\", i);\r", | |
"lineNumber": 63 | |
}, | |
{ | |
"lineText": " const fo = new FileObject(ConfigManager.filesToMutate[i], ConfigManager.testFiles[i]);\r", | |
"lineNumber": 64 | |
}, | |
{ | |
"lineText": " const fh = new FileHandler(fo);\r", | |
"lineNumber": 65 | |
}, | |
{ | |
"lineText": " const so = new SourceObject(fh.getSourceObject());\r", | |
"lineNumber": 66 | |
}, | |
{ | |
"lineText": " const ci = new CodeInspector(so.originalSourceObject);\r", | |
"lineNumber": 67 | |
}, | |
{ | |
"lineText": " NodeHandler.fileDescriptors.push({\r", | |
"lineNumber": 68 | |
}, | |
{ | |
"lineText": " fileName: ConfigManager.filesToMutate[i],\r", | |
"lineNumber": 69 | |
}, | |
{ | |
"lineText": " fileObject: fo, fileHandler: fh, sourceObject: so, codeInspector: ci\r", | |
"lineNumber": 70 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 71 | |
}, | |
{ | |
"lineText": " // }\r", | |
"lineNumber": 72 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 73 | |
}, | |
{ | |
"lineText": " console.log(\"aa\", ConfigManager.filesToMutate.length);\r", | |
"lineNumber": 74 | |
}, | |
{ | |
"lineText": " console.log(\"file desc\", NodeHandler.fileDescriptors.length);\r", | |
"lineNumber": 75 | |
}, | |
{ | |
"lineText": " return NodeHandler.fileDescriptors;\r", | |
"lineNumber": 76 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 77 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " public static createAllFileDescriptors (): Array<IFileDescriptor> {", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " private static fileExists (file: string) {\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " return existsSync(file);\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " private static removeFileFromAnalysis (file: string, arrayContainingFile: Array<string>) {\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " arrayContainingFile.splice(arrayContainingFile.indexOf(file), 1);\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not find File: \", file);\r", | |
"lineNumber": 59 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 60 | |
}, | |
{ | |
"lineText": "}\r", | |
"lineNumber": 61 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 62 | |
}, | |
{ | |
"lineNumber": 63 | |
}, | |
{ | |
"lineNumber": 64 | |
}, | |
{ | |
"lineNumber": 65 | |
}, | |
{ | |
"lineNumber": 66 | |
}, | |
{ | |
"lineNumber": 67 | |
}, | |
{ | |
"lineNumber": 68 | |
}, | |
{ | |
"lineNumber": 69 | |
}, | |
{ | |
"lineNumber": 70 | |
}, | |
{ | |
"lineNumber": 71 | |
}, | |
{ | |
"lineNumber": 72 | |
}, | |
{ | |
"lineNumber": 73 | |
}, | |
{ | |
"lineNumber": 74 | |
}, | |
{ | |
"lineNumber": 75 | |
}, | |
{ | |
"lineNumber": 76 | |
}, | |
{ | |
"lineNumber": 77 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "{\r\n // ConfigManager.filesToMutate.filter((srcFile) => {if (existsSync(srcFile)) { return srcFile; } });\r\n // ConfigManager.testFiles.filter((testFile) => { if (existsSync(testFile)) {return testFile; } });\r\n console.log(\"before\", ConfigManager.filesToMutate.length);\r\n\r\n for (let i = 0; i < ConfigManager.filesToMutate.length; i++) {\r\n // if (!this.fileExists(ConfigManager.filesToMutate[i]) || !this.fileExists(ConfigManager.testFiles[i])) {\r\n // console.log(\"file removed\", ConfigManager.filesToMutate[i]);\r\n // ConfigManager.filesToMutate.splice(\r\n // ConfigManager.filesToMutate.indexOf(ConfigManager.filesToMutate[i], 1));\r\n // ConfigManager.testFiles.splice(\r\n // ConfigManager.testFiles.indexOf(ConfigManager.testFiles[i], 1));\r\n // NodeHandler.fileDescriptors.splice(i, 1);\r\n // } else {\r\n console.log(\"file\", i);\r\n const fo = new FileObject(ConfigManager.filesToMutate[i], ConfigManager.testFiles[i]);\r\n const fh = new FileHandler(fo);\r\n const so = new SourceObject(fh.getSourceObject());\r\n const ci = new CodeInspector(so.originalSourceObject);\r\n NodeHandler.fileDescriptors.push({\r\n fileName: ConfigManager.filesToMutate[i],\r\n fileObject: fo, fileHandler: fh, sourceObject: so, codeInspector: ci\r\n });\r\n // }\r\n }\r\n console.log(\"aa\", ConfigManager.filesToMutate.length);\r\n console.log(\"file desc\", NodeHandler.fileDescriptors.length);\r\n return NodeHandler.fileDescriptors;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.spec.ts51C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutatedCode.push({\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 104 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end / 1; line++) {\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutatedCode.push({\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 104 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts55C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n const methodBounds = this.getAllMethodNames().filter((methods) =>\r\n methods.pos <= characterOfMutation && methods.end >= characterOfMutation)[0];\r\n if (methodBounds === void 0) {\r\n return {pos: characterOfMutation - 5, end: characterOfMutation + 10};\r\n } else {\r\n return methodBounds;\r\n }\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "return {pos: characterOfMutation - 5, end: characterOfMutation + 10};", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed( 2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "2", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts87C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed( -1));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "2", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts91C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n this.outputToConsole = false;\r\n this.outputToJSON = false;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath / FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts99C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath * FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts103C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n if (!this.file.sourceCode) {\r\n this.file.sourceCode = this.readFile(this.file.fullPath);\r\n }\r\n return this.file.sourceCode;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "return fs.readFileSync(path).toString();", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n this.projectFilesRetrieved = [];\r\n ConfigManager.mutateAllFiles = configurationFile.mutateAllFiles;\r\n ConfigManager.filePath = configurationFile.filePath;\r\n ConfigManager.filesToSkip =\r\n configurationFile.filesToSkip.map((skipping) => resolve(configurationFile.filePath, skipping));\r\n ConfigManager.filesToMutate =\r\n configurationFile.filesToMutate.map((file) => resolve(configurationFile.filePath, file));\r\n ConfigManager.testFilePath = configurationFile.testFilePath;\r\n ConfigManager.testFileExtension = configurationFile.testFileExtension;\r\n ConfigManager.testRunner = configurationFile.testRunner;\r\n ConfigManager.runnerConfig = configurationFile.runnerConfig;\r\n this.configValid();\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return files.filter((file) => {\r\n return !file.endsWith(this.testFileExtension + \".ts\");\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " public static runnerConfig: Object;\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " private static mutateAllFiles: boolean;\r", | |
"lineNumber": 18 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " public static runnerConfig: Object; protected static mutateAllFiles: boolean;\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " private static filesToSkip: Array<string>;\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " private projectFilesRetrieved: Array<string>;\r", | |
"lineNumber": 18 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts127C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return this.filesToSkip.indexOf(item) < 0;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return - 1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts135C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "{\r\n CodeInspector.retrievedObjects = [];\r\n CodeInspector.findTokenObjectsOfKind(this.sourceObject, kind);\r\n return CodeInspector.retrievedObjects;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " private static removeFoundFiles (fileArray) {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " fileArray.forEach((file) => {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " fs.unlinkSync(ConfigManager.filePath + file);\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 52 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " private static removeFoundFiles (fileArray) {\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " fileArray.forEach((file) => {\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " fs.unlinkSync(ConfigManager.filePath / file);\r", | |
"lineNumber": 50 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 52 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts143C12704undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n return filePath.substring(filePath.length - FileObject.M_SOURCE_FILE_SUFFIX.length)\r\n === FileObject.M_SOURCE_FILE_SUFFIX;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "{\r\n return tree[currentTreePosition[0]];\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp - this.startTimestamp).getTime()\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " Logger.info(\"Mutations Complete in: \", timeTaken);\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " Logger.info(\"Number of mutations produced: \", this.threadResults.length);\r", | |
"lineNumber": 136 | |
}, | |
{ | |
"lineText": " console.log(\"Creating End Result\");\r", | |
"lineNumber": 137 | |
}, | |
{ | |
"lineText": " this.individualFileResults = this.getIndividualFileResults();\r", | |
"lineNumber": 138 | |
}, | |
{ | |
"lineText": " const endResult = new EndResult(\r", | |
"lineNumber": 139 | |
}, | |
{ | |
"lineText": " ConfigManager.testRunner,\r", | |
"lineNumber": 140 | |
}, | |
{ | |
"lineText": " ConfigManager.runnerConfig,\r", | |
"lineNumber": 141 | |
}, | |
{ | |
"lineText": " timeTaken,\r", | |
"lineNumber": 142 | |
}, | |
{ | |
"lineText": " this.individualFileResults,\r", | |
"lineNumber": 143 | |
}, | |
{ | |
"lineText": " this.getOverallMutationScore(),\r", | |
"lineNumber": 144 | |
}, | |
{ | |
"lineText": " this.threadResults\r", | |
"lineNumber": 145 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 146 | |
}, | |
{ | |
"lineText": " console.log(\"end result\", endResult.overallScores);\r", | |
"lineNumber": 147 | |
}, | |
{ | |
"lineText": " console.log(\"Writing results\");\r", | |
"lineNumber": 148 | |
}, | |
{ | |
"lineText": " OutputToJSON.writeResults(endResult);\r", | |
"lineNumber": 149 | |
}, | |
{ | |
"lineText": " console.log(\"Results written\");\r", | |
"lineNumber": 150 | |
}, | |
{ | |
"lineText": " Cleaner.cleanRemainingFiles();\r", | |
"lineNumber": 151 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 152 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp + this.startTimestamp).getTime()\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " Logger.info(\"Mutations Complete in: \", timeTaken);\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " Logger.info(\"Number of mutations produced: \", this.threadResults.length);\r", | |
"lineNumber": 136 | |
}, | |
{ | |
"lineText": " console.log(\"Creating End Result\");\r", | |
"lineNumber": 137 | |
}, | |
{ | |
"lineText": " this.individualFileResults = this.getIndividualFileResults();\r", | |
"lineNumber": 138 | |
}, | |
{ | |
"lineText": " const endResult = new EndResult(\r", | |
"lineNumber": 139 | |
}, | |
{ | |
"lineText": " ConfigManager.testRunner,\r", | |
"lineNumber": 140 | |
}, | |
{ | |
"lineText": " ConfigManager.runnerConfig,\r", | |
"lineNumber": 141 | |
}, | |
{ | |
"lineText": " timeTaken,\r", | |
"lineNumber": 142 | |
}, | |
{ | |
"lineText": " this.individualFileResults,\r", | |
"lineNumber": 143 | |
}, | |
{ | |
"lineText": " this.getOverallMutationScore(),\r", | |
"lineNumber": 144 | |
}, | |
{ | |
"lineText": " this.threadResults\r", | |
"lineNumber": 145 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 146 | |
}, | |
{ | |
"lineText": " console.log(\"end result\", endResult.overallScores);\r", | |
"lineNumber": 147 | |
}, | |
{ | |
"lineText": " console.log(\"Writing results\");\r", | |
"lineNumber": 148 | |
}, | |
{ | |
"lineText": " OutputToJSON.writeResults(endResult);\r", | |
"lineNumber": 149 | |
}, | |
{ | |
"lineText": " console.log(\"Results written\");\r", | |
"lineNumber": 150 | |
}, | |
{ | |
"lineText": " Cleaner.cleanRemainingFiles();\r", | |
"lineNumber": 151 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 152 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts10C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n filesMutated.mutantsSurvivedForEach.push(0);\r\n filesMutated.totalMutationsForEach.push(0);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " public getOverallMutationScore () {\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " const mutationsPerformed = this.individualFileResults.totalMutationsForEach\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " .reduce((accumulator, current) => accumulator += current);\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " console.log(\"Mutations Performed\", mutationsPerformed);\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " const survivingMutants = this.individualFileResults.mutantsSurvivedForEach\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " .reduce((accumulator, current) => accumulator += current);\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " console.log(\"Surviving mutants\", survivingMutants);\r", | |
"lineNumber": 90 | |
}, | |
{ | |
"lineText": " const numberOfKilledOrErrored = mutationsPerformed - survivingMutants;\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " console.log(\"killed OR errored\", numberOfKilledOrErrored);\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " return {\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " totalKilledMutants: numberOfKilledOrErrored,\r", | |
"lineNumber": 94 | |
}, | |
{ | |
"lineText": " totalSurvivingMutants: survivingMutants,\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " mutationScore: MathFunctions.calculatePercentage(\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " numberOfKilledOrErrored, mutationsPerformed)\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 99 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " public getOverallMutationScore () {\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " const mutationsPerformed = this.individualFileResults.totalMutationsForEach\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " .reduce((accumulator, current) => accumulator += current);\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " console.log(\"Mutations Performed\", mutationsPerformed);\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " const survivingMutants = this.individualFileResults.mutantsSurvivedForEach\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " .reduce((accumulator, current) => accumulator += current);\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " console.log(\"Surviving mutants\", survivingMutants);\r", | |
"lineNumber": 90 | |
}, | |
{ | |
"lineText": " const numberOfKilledOrErrored = mutationsPerformed - survivingMutants;\r", | |
"lineNumber": 91 | |
}, | |
{ | |
"lineText": " console.log(\"killed OR errored\", numberOfKilledOrErrored);\r", | |
"lineNumber": 92 | |
}, | |
{ | |
"lineText": " return {\r", | |
"lineNumber": 93 | |
}, | |
{ | |
"lineText": " totalKilledMutants: numberOfKilledOrErrored,\r", | |
"lineNumber": 94 | |
}, | |
{ | |
"lineText": " totalSurvivingMutants: survivingMutants,\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " mutationScore: MathFunctions.calculatePercentage(\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " numberOfKilledOrErrored, mutationsPerformed)\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " };\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " } protected createWorkerMessagers (individualWorker: ChildProcess) {\r", | |
"lineNumber": 99 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts18C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "{\r\n return this.sourceObj.originalSourceObject.getText();\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " public isNodeValidForMutation (nodeText: string): boolean {\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " return nodeText[0] === \"(\" && nodeText[nodeText.length - 1] === \")\";\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 22 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " public isNodeValidForMutation (nodeText: string): boolean {\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " return nodeText[ 0] === \"(\" && nodeText[nodeText.length - 1] === \")\";\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 22 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "0", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts38C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName / \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts42C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() * \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts46C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() -\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts50C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[ 1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\outputResults\\OutputToJSON.spec.ts54C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " private minusOne (): string {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " let boundChangedNumber = this.number;\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return (boundChangedNumber--).toString();\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " private minusOne (): string {", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "{\r\n let boundChangedNumber = this.number;\r\n return (boundChangedNumber--).toString();\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts58C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue(1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " this.addOne(), this.minusOne(), this.multiplyByNegative(),\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " this.setToValue(0), this.setToValue( 1), this.setToValue(-1)\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " return { mutations: arrayOfMutations, mutationClass: MutationClass.NumericLiteral_ConstantChange};\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 21 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\NumericLiteral.spec.ts62C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\nodeHandler\\NodeHandler.ts", | |
"targetNode": "{\r\n codeInspector.findObjectsOfSyntaxKind(syntaxItem).forEach((token) => {\r\n NodeHandler.fileNameNodes.push({\r\n syntaxType: syntaxItem,\r\n positions: {pos: token.pos, end: token.end},\r\n parentFilePath: ConfigManager.filesToMutate[fileNameIndex],\r\n plainText: token.getText(),\r\n associatedTestFilePath: ConfigManager.testFiles[fileNameIndex]\r\n // for now i can't see a problem doing this, however the test files may be in a different order\r\n // to the source files in some occasions.\r\n });\r\n });\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " public setTestFile (filename: string): void {\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.testFilePath = filename;\r", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " public setTestFile (filename: string): void {", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 58 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 59 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "{\r\n this.currentMutationResult.testFilePath = filename;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts74C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutatedCode.push({\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 104 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 95 | |
}, | |
{ | |
"lineText": " private setMutatedCode (code: string, method: {start: number, end: number}) {\r", | |
"lineNumber": 96 | |
}, | |
{ | |
"lineText": " const splitCode = this.splitCodeByLine(code);\r", | |
"lineNumber": 97 | |
}, | |
{ | |
"lineText": " for (let line = method.start; line < method.end + 1; line++) {\r", | |
"lineNumber": 98 | |
}, | |
{ | |
"lineText": " this.currentMutationResult.mutatedCode.push({\r", | |
"lineNumber": 99 | |
}, | |
{ | |
"lineText": " lineText: splitCode[line],\r", | |
"lineNumber": 100 | |
}, | |
{ | |
"lineText": " lineNumber: ++ method.start\r", | |
"lineNumber": 101 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 102 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 103 | |
}, | |
{ | |
"lineText": " } protected splitCodeByLine (code: string): Array<string> {\r", | |
"lineNumber": 104 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationResultManager\\MutationResultManager.spec.ts78C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\MutationFactory.ts", | |
"targetNode": "return [\r\n numbLitteral.getComplexMutation(),\r\n parentheses.getComplexMutation()];", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "%", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return 0; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 31 | |
}, | |
{ | |
"lineText": " public static calculatePercentage (fraction: number, total: number): number {\r", | |
"lineNumber": 32 | |
}, | |
{ | |
"lineText": " if (total === 0) { return null; }\r", | |
"lineNumber": 33 | |
}, | |
{ | |
"lineText": " return Number((fraction / total * 100).toFixed(2));\r", | |
"lineNumber": 34 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 35 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.ts", | |
"targetNode": "return 0;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\maths\\MathFunctions.spec.ts94C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\logging\\Logger.ts", | |
"targetNode": "{\r\n this.outputToConsole = true;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" + this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " public writeTempSourceModifiedFile (modifiedCode: string): string {\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " const tempFilename =\r", | |
"lineNumber": 46 | |
}, | |
{ | |
"lineText": " this.file.fullPath + FileObject.counter + \"C\" - this.file.coreNumber + FileObject.M_SOURCE_FILE_SUFFIX;\r", | |
"lineNumber": 47 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, modifiedCode);\r", | |
"lineNumber": 48 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 49 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 50 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts102C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" / this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts106C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " Logger.fatal(\"Incorrect file extension filtered out\", this.file);\r", | |
"lineNumber": 20 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " if (!(this.file.filename.substring(this.file.filename.length - 3) === FileExtensions.source)) {", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 20 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "{\r\n Logger.fatal(\"Incorrect file extension filtered out\", this.file);\r\n throw new Error(\"Typescript files must end with .ts\");\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts114C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents);\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " return tempFilename;\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 58 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 51 | |
}, | |
{ | |
"lineText": " public createTempTestModifiedFile (): string {\r", | |
"lineNumber": 52 | |
}, | |
{ | |
"lineText": " const updatedContents = this.mutateTestFileReference(this.getTestFileContents());\r", | |
"lineNumber": 53 | |
}, | |
{ | |
"lineText": " const tempFilename = this.file.testFilePath\r", | |
"lineNumber": 54 | |
}, | |
{ | |
"lineText": " + FileObject.counter++ + \"C\" + this.file.coreNumber + FileObject.M_TEST_FILE_SUFFIX;\r", | |
"lineNumber": 55 | |
}, | |
{ | |
"lineText": " fs.writeFileSync(tempFilename, updatedContents); return null;\r", | |
"lineNumber": 56 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 57 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 58 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.ts", | |
"targetNode": "return tempFilename;", | |
"mutationType": "Modifying a Return Statement to return null", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\FileHandler\\FileHandler.spec.ts118C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" + file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 112 | |
}, | |
{ | |
"lineText": " private getAllProjectFiles (filePath: string): Array<string> {\r", | |
"lineNumber": 113 | |
}, | |
{ | |
"lineText": " const currentDir = ConfigManager.readfileDirectory(filePath);\r", | |
"lineNumber": 114 | |
}, | |
{ | |
"lineText": " currentDir.forEach((file) => {\r", | |
"lineNumber": 115 | |
}, | |
{ | |
"lineText": " if (ConfigManager.isTypescriptFile(file)) {\r", | |
"lineNumber": 116 | |
}, | |
{ | |
"lineText": " this.projectFilesRetrieved.push(resolve(filePath, file));\r", | |
"lineNumber": 117 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 118 | |
}, | |
{ | |
"lineText": " this.getAllProjectFiles(filePath + \"/\" * file);\r", | |
"lineNumber": 119 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 120 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 121 | |
}, | |
{ | |
"lineText": " return this.projectFilesRetrieved;\r", | |
"lineNumber": 122 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 123 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "+", | |
"mutationType": "Replacing one Binary Operator with another", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts122C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " private static readfileDirectory (file: string): Array<string> {\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " if (fs.statSync(file).isDirectory()) {\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " return fs.readdirSync(file);\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " } else {\r", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": " return [];\r", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 90 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 83 | |
}, | |
{ | |
"lineText": " private static readfileDirectory (file: string): Array<string> {\r", | |
"lineNumber": 84 | |
}, | |
{ | |
"lineText": " if (fs.statSync(file).isDirectory()) {\r", | |
"lineNumber": 85 | |
}, | |
{ | |
"lineText": " return fs.readdirSync(file);\r", | |
"lineNumber": 86 | |
}, | |
{ | |
"lineText": " } else {", | |
"lineNumber": 87 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 88 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 89 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 90 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return [];\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts126C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "{\r\n return -1;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts130C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "return testFilesWithoutExtension.indexOf(basename(file)) >= 0;", | |
"mutationType": "Modifying a Return Statement to return null" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 124 | |
}, | |
{ | |
"lineText": " private orderSourceAndTestFiles () {\r", | |
"lineNumber": 125 | |
}, | |
{ | |
"lineText": " ConfigManager.filesToMutate = ConfigManager.filesToMutate.sort((a, b) => {\r", | |
"lineNumber": 126 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 127 | |
}, | |
{ | |
"lineText": " return -1;\r", | |
"lineNumber": 128 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " ConfigManager.testFiles = ConfigManager.testFiles.sort((a, b) => {\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " if (basename(a) >= basename(b)) {\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " return - 1;\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " } else { return 1; }\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 136 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.ts", | |
"targetNode": "1", | |
"mutationType": "Modification of Numeric Literal", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\configManager\\ConfigManager.spec.ts138C6372undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\CodeInspector.ts", | |
"targetNode": "{\r\n CodeInspector.retrievedObjects.push(object);\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public static deleteTestFile (filePath: string) {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " if (!Cleaner.isMutatedFile(filePath)) {\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " Logger.warn(`${filePath} is not a mutated test file. Tried to delete a non mutated file.`);\r", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " fs.unlink(filePath, (err) => {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " if (err !== null) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not delete test file\", {path: filePath, error: err});\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public static deleteTestFile (filePath: string) {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " if (!Cleaner.isMutatedFile(filePath)) {", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 19 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 20 | |
}, | |
{ | |
"lineText": " fs.unlink(filePath, (err) => {\r", | |
"lineNumber": 21 | |
}, | |
{ | |
"lineText": " if (err !== null) {\r", | |
"lineNumber": 22 | |
}, | |
{ | |
"lineText": " Logger.warn(\"Could not delete test file\", {path: filePath, error: err});\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 24 | |
}, | |
{ | |
"lineText": " });\r", | |
"lineNumber": 25 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 26 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.ts", | |
"targetNode": "{\r\n Logger.warn(`${filePath} is not a mutated test file. Tried to delete a non mutated file.`);\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\cleanup\\Cleaner.spec.ts146C6372undefined.m.ts" | |
} | |
], | |
[ | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " [SyntaxKind.PropertyAccessExpression]: false\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " },\r", | |
"lineNumber": 24 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " [SyntaxKind.PropertyAccessExpression]: true\r", | |
"lineNumber": 23 | |
}, | |
{ | |
"lineText": " },\r", | |
"lineNumber": 24 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.ts", | |
"targetNode": "false", | |
"mutationType": "Inverting a Boolean", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\CodeInspector\\ValidMutationRules.spec.ts3C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "-", | |
"mutationType": "Replacing one Binary Operator with another" | |
}, | |
{ | |
"originalCode": null, | |
"mutatedCode": null, | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "{\r\n filesMutated.mutantsSurvivedForEach[indexOfSRCFile] ++;\r\n }", | |
"mutationType": "Remove all content from a block of code" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp - this.startTimestamp).getTime()\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " Logger.info(\"Mutations Complete in: \", timeTaken);\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " Logger.info(\"Number of mutations produced: \", this.threadResults.length);\r", | |
"lineNumber": 136 | |
}, | |
{ | |
"lineText": " console.log(\"Creating End Result\");\r", | |
"lineNumber": 137 | |
}, | |
{ | |
"lineText": " this.individualFileResults = this.getIndividualFileResults();\r", | |
"lineNumber": 138 | |
}, | |
{ | |
"lineText": " const endResult = new EndResult(\r", | |
"lineNumber": 139 | |
}, | |
{ | |
"lineText": " ConfigManager.testRunner,\r", | |
"lineNumber": 140 | |
}, | |
{ | |
"lineText": " ConfigManager.runnerConfig,\r", | |
"lineNumber": 141 | |
}, | |
{ | |
"lineText": " timeTaken,\r", | |
"lineNumber": 142 | |
}, | |
{ | |
"lineText": " this.individualFileResults,\r", | |
"lineNumber": 143 | |
}, | |
{ | |
"lineText": " this.getOverallMutationScore(),\r", | |
"lineNumber": 144 | |
}, | |
{ | |
"lineText": " this.threadResults\r", | |
"lineNumber": 145 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 146 | |
}, | |
{ | |
"lineText": " console.log(\"end result\", endResult.overallScores);\r", | |
"lineNumber": 147 | |
}, | |
{ | |
"lineText": " console.log(\"Writing results\");\r", | |
"lineNumber": 148 | |
}, | |
{ | |
"lineText": " OutputToJSON.writeResults(endResult);\r", | |
"lineNumber": 149 | |
}, | |
{ | |
"lineText": " console.log(\"Results written\");\r", | |
"lineNumber": 150 | |
}, | |
{ | |
"lineText": " Cleaner.cleanRemainingFiles();\r", | |
"lineNumber": 151 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 152 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 129 | |
}, | |
{ | |
"lineText": " private finishRun () {\r", | |
"lineNumber": 130 | |
}, | |
{ | |
"lineText": " const endTimestamp = new Date().getTime();\r", | |
"lineNumber": 131 | |
}, | |
{ | |
"lineText": " const timeTaken = MathFunctions.calculateRunTime(\r", | |
"lineNumber": 132 | |
}, | |
{ | |
"lineText": " new Date(endTimestamp - this.startTimestamp).getTime()\r", | |
"lineNumber": 133 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 134 | |
}, | |
{ | |
"lineText": " Logger.info(\"Mutations Complete in: \", timeTaken);\r", | |
"lineNumber": 135 | |
}, | |
{ | |
"lineText": " Logger.info(\"Number of mutations produced: \", this.threadResults.length);\r", | |
"lineNumber": 136 | |
}, | |
{ | |
"lineText": " console.log(\"Creating End Result\");\r", | |
"lineNumber": 137 | |
}, | |
{ | |
"lineText": " this.individualFileResults = this.getIndividualFileResults();\r", | |
"lineNumber": 138 | |
}, | |
{ | |
"lineText": " const endResult = new EndResult(\r", | |
"lineNumber": 139 | |
}, | |
{ | |
"lineText": " ConfigManager.testRunner,\r", | |
"lineNumber": 140 | |
}, | |
{ | |
"lineText": " ConfigManager.runnerConfig,\r", | |
"lineNumber": 141 | |
}, | |
{ | |
"lineText": " timeTaken,\r", | |
"lineNumber": 142 | |
}, | |
{ | |
"lineText": " this.individualFileResults,\r", | |
"lineNumber": 143 | |
}, | |
{ | |
"lineText": " this.getOverallMutationScore(),\r", | |
"lineNumber": 144 | |
}, | |
{ | |
"lineText": " this.threadResults\r", | |
"lineNumber": 145 | |
}, | |
{ | |
"lineText": " );\r", | |
"lineNumber": 146 | |
}, | |
{ | |
"lineText": " console.log(\"end result\", endResult.overallScores);\r", | |
"lineNumber": 147 | |
}, | |
{ | |
"lineText": " console.log(\"Writing results\");\r", | |
"lineNumber": 148 | |
}, | |
{ | |
"lineText": " OutputToJSON.writeResults(endResult);\r", | |
"lineNumber": 149 | |
}, | |
{ | |
"lineText": " console.log(\"Results written\");\r", | |
"lineNumber": 150 | |
}, | |
{ | |
"lineText": " Cleaner.cleanRemainingFiles();\r", | |
"lineNumber": 151 | |
}, | |
{ | |
"lineText": " } protected createMutationProgressBar () {\r", | |
"lineNumber": 152 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.ts", | |
"targetNode": "private", | |
"mutationType": "Changing the scope / visibility of a method", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\supervisor\\Supervisor.spec.ts15C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public getOriginalSourceObject (): SourceFile {\r", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": " return this.sourceObj.originalSourceObject;\r", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 11 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 8 | |
}, | |
{ | |
"lineText": " public getOriginalSourceObject (): SourceFile {", | |
"lineNumber": 9 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 10 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 11 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.ts", | |
"targetNode": "{\r\n return this.sourceObj.originalSourceObject;\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\sourceCodeModifier\\SourceCodeModifier.spec.ts19C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public getModifiedSourceCode (): string {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return this.sourceObj.modifiedSourceCode;\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " public getModifiedSourceCode (): string {\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return this.sourceObj.modifiedSourceCode;\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"targetNode": "{ console.log(\"\"); }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts23C11936undefined.m.ts", | |
"mutationAttemptFailure": { | |
"reasonForFailure": "Mutant Errored Due to: Mocha Errored.", | |
"attemptedMutation": "{ console.log(\"\"); }", | |
"nodeToBeMutated": { | |
"syntaxType": 208, | |
"positions": { | |
"pos": 587, | |
"end": 608 | |
}, | |
"parentFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.ts", | |
"plainText": "{ console.log(\"\"); }", | |
"associatedTestFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\progressDisplay\\ProgressDisplay.spec.ts" | |
} | |
} | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {\r", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": " if (!this.isNodeValidForMutation(this.plainText)) {\r", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " return {mutations: [], mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " const arrayOfMutations = this.removeDuplicateMutations([\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " this.removeParentheses()\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": " ]);\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " return {mutations: arrayOfMutations, mutationClass: MutationClass.Parenthesis_Removal};\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 19 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": " public getComplexMutation (): IMutationArrayAndClass {", | |
"lineNumber": 11 | |
}, | |
{ | |
"lineText": "", | |
"lineNumber": 12 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 13 | |
}, | |
{ | |
"lineText": " public isNodeValidForMutation (nodeText: string): boolean {\r", | |
"lineNumber": 14 | |
}, | |
{ | |
"lineText": " return nodeText[0] === \"(\" && nodeText[nodeText.length - 1] === \")\";\r", | |
"lineNumber": 15 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 16 | |
}, | |
{ | |
"lineText": "\r", | |
"lineNumber": 17 | |
}, | |
{ | |
"lineText": " private removeParentheses (): string {\r", | |
"lineNumber": 18 | |
}, | |
{ | |
"lineText": " return this.plainText.substring(1, this.plainText.length - 1);\r", | |
"lineNumber": 19 | |
} | |
], | |
"SRC_FILE_PATH": "../ProfessorX-Test/src/", | |
"SRC_FILE": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.ts", | |
"targetNode": "{\r\n if (!this.isNodeValidForMutation(this.plainText)) {\r\n return {mutations: [], mutationClass: MutationClass.Parenthesis_Removal};\r\n }\r\n const arrayOfMutations = this.removeDuplicateMutations([\r\n this.removeParentheses()\r\n ]);\r\n return {mutations: arrayOfMutations, mutationClass: MutationClass.Parenthesis_Removal};\r\n }", | |
"mutationType": "Remove all content from a block of code", | |
"testFilePath": "C:\\git\\Honours-Project\\ProfessorX-Test\\src\\mutationFactory\\complexMutations\\ParenthesesModifier.spec.ts27C11936undefined.m.ts" | |
}, | |
{ | |
"originalCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" + new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"lineNumber": 42 | |
}, | |
{ | |
"lineText": " new Date().getUTCHours() + \"-\" + new Date().getUTCMinutes() + \"-\" + new Date().getUTCSeconds() +\r", | |
"lineNumber": 43 | |
}, | |
{ | |
"lineText": " \".json\".toString();\r", | |
"lineNumber": 44 | |
}, | |
{ | |
"lineText": " return OutputToJSON.outputfilePath;\r", | |
"lineNumber": 45 | |
}, | |
{ | |
"lineText": " }\r", | |
"lineNumber": 46 | |
} | |
], | |
"mutatedCode": [ | |
{ | |
"lineText": "\r", | |
"lineNumber": 38 | |
}, | |
{ | |
"lineText": " private static getOutFilePath () {\r", | |
"lineNumber": 39 | |
}, | |
{ | |
"lineText": " const rootName = ConfigManager.filePath.split(\"/\")[1];\r", | |
"lineNumber": 40 | |
}, | |
{ | |
"lineText": " OutputToJSON.outputfilePath = \"./mutationResults/\" + rootName + \"_\" +\r", | |
"lineNumber": 41 | |
}, | |
{ | |
"lineText": " new Date().getDay() + \"_\" / new Date().getMonth() + \"_\" + new Date().getFullYear() + \"_\" +\r", | |
"li |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment