There should be a mutator that replaces numeric constants. I imagine the following variants:
constant 0
constant 1
subtract/add 1
this should catch some off-by-one errors.
Example: It would detect that the following function:
export function lessThan100(x: number): boolean {
if (x < 100) {
return true;
}
return false;
}
Is not appropriately tested by the following testcases:
describe('lessThan100', () => {
it('should detect which numbers are less than 100', () => {
expect(lessThan100(100)).toEqual(false);
expect(lessThan100(98)).toEqual(true);
});
});
There should be a mutator that replaces numeric constants. I imagine the following variants:
this should catch some off-by-one errors.
Example: It would detect that the following function:
Is not appropriately tested by the following testcases: