This pull request addresses an issue where certain mutations in the library use block comments to disable specific block of code, resulting in collusions with block comments within the commented block. This collision leads to compilation errors and stillborn mutants as a result.
The issue is valid for the next mutation types:
Catch block deletion (CBD)
Conditional Statement Change (CSC)
Contract Constructor Deletion (CCD)
Overloaded Function Deletion (OLFD)
Overridden Function Deletion (ORFD)
Overridden Modifier Deletion (OMD)
Description
For example, consider the code snippet before Conditional Statement Change (CSC) mutation:
if (true) {
// some code
} else {
/*
block comment
*/
// another code
}
After the mutation, the code becomes:
if (true) {
// some code
} /* else {
/*
block comment
*/
// another code
} */
Consequently, the compilation fails due to the presence of nested block comments, which is not allowed in Solidity. Any mutation that leads to failed compilation is considered a stillborn mutant.
To calculate the mutation score, the following formula is used:
mutationScore = killed / (survived + killed)
However, stillborn mutants are not considered in the mutation score calculation. This pull request proposes a fix that will enable the recognition of previously stillborn mutants as either "killed" or "survived," thereby increasing the precision and correctness of the mutation score.
Note: There is an alternative option to replace block comments with line comments. However, this method affects the code execution speed, particularly for large blocks of code.
Summary
This pull request addresses an issue where certain mutations in the library use block comments to disable specific block of code, resulting in collusions with block comments within the commented block. This collision leads to compilation errors and stillborn mutants as a result.
The issue is valid for the next mutation types:
Description
For example, consider the code snippet before Conditional Statement Change (CSC) mutation:
After the mutation, the code becomes:
Consequently, the compilation fails due to the presence of nested block comments, which is not allowed in Solidity. Any mutation that leads to failed compilation is considered a stillborn mutant.
To calculate the mutation score, the following formula is used:
However, stillborn mutants are not considered in the mutation score calculation. This pull request proposes a fix that will enable the recognition of previously stillborn mutants as either "killed" or "survived," thereby increasing the precision and correctness of the mutation score.
Note: There is an alternative option to replace block comments with line comments. However, this method affects the code execution speed, particularly for large blocks of code.