26. Examples of Conditional Mutants
@jeanneboyarsky
Conditionals Boundary <= vs <
Negative Conditionals <= vs >
Void Method Call Removes method calls
27. Examples of Math Mutants
@jeanneboyarsky
Math * vs /
Increments ++ vs --
Invert Negatives x vs -x
28. Examples of Other Mutants
@jeanneboyarsky
Return Values x vs x+1
Disabled by default (false
positives, duplicates or
crashes)
Constructor Calls
Inline Constants
Non Void Method Calls
Remove Conditionals
Experimental Member Variables
Switch
29. Tips for bigger projects
• Watch console to see if still running
• Reports on whole project – drill down/split up
• Exclude long running tests
• Experimental feature: incremental analysis
@jeanneboyarsky
Run initially
Add 2 assertTrue and one assertFalse on tooManyAttendees – incorrectly to show failure with failing unit tests. Wait there’s a bug.
Fix assertions and see down to three mutants
In cancel test assertFalse on my registration now down to two mutants
Then add assertTrue on Barry’s registration and see all mutants killed
Change to all mutators
Run initially and note that down from 23 to 7 – our tests are better
Note that the wait list logic still isn’t tested enough. Add test for jeanne and maurice cancelling with barry and sai on wait list with four asserts
4 mutants left
Add test for sai not on wait list so wait list empty
2 mutants left
These two are interesting as they point to unused code – isRoomForMoreAttendees always true and don’t use company name (attendee map value)