Search code examples
unit-testingtddmutation-testing

How can I test correctness of a program by removing or replacing lines of code?


I know this question is very vague but I think with your help we can improve it. A couple of month ago in an interview talking about TDD and unit testing, I was asked if I knew I particular methodology (unfortunately I forgot the name) where a class or component gets probed for its correctness by removing or altering some lines (automatically, probably using a specific tool). As you can imagine I didn't get the job and I can't ask the question directly to them but it seems an interesting topic and it also seems they are using it. Anybody has heard about it?


Solution

  • It is called Mutation Testing.

    You could take a look at pitest 'Real world mutation testing'

    http://pitest.org/