4 ms·
In the ruby world there is the "mutant" ( https://github.com/mbj/mutant https://github.com/mbj/mutant ) gem that does stuff like this automatically. It runs yo
by rurounijones 12y ago
In the ruby world there is the "mutant" ( https://github.com/mbj/mutant https://github.com/mbj/mutant ) gem that does stuff like this automatically.
It runs your tests and makes sure they all pass then it mutates the code under test (changing a == b to a != b or a <= 10 to a < 10) and makes sure that at least one of your tests fails.
If your tests still pass after the mutation then you know you are not covering something.
Tis a great idea but making a C version with the equivalent functionality would be a lot harder I think.
- michaelmior 12y agoCurious why you're thinking doing this in C would be a lot harder? All you really need to do is define what some valid transformations are. There are existing mutation testing tools for C[1]. [1] http://stackoverflow.com/questions/4715890/what-mutation-testing-frameworks-exist-for-c-c http://stackoverflow.com/questions/4715890/what-mutation-tes...