mbj / mutant

Automated code reviews via mutation testing - semantic code coverage.
Other
1.94k stars 151 forks source link

Document mutation reasoning #296

Open kbrock opened 9 years ago

kbrock commented 9 years ago

Mutant is making a statement with the questions it asks:

"Can we simplify this code?"

When a mutation fails, it leads the developer to delete code or write test code to better specify the edge cases.

"Do you really want to write code like this?"

* Can you add a link in the readme or source to help the user understand why this question is raised, and how to fix the code? *

(or can you give me a suggestion where you want this documented and some of the links and I could put into a PR)

mbj commented 9 years ago

@kbrock This is an interesting approach, and I always wanted to do this kind of "natural language" explanation of mutation operators, alongside with "kill hints". See the DSL I use to specify which mutation operators mutant right now supports: https://github.com/mbj/mutant/blob/master/meta/array.rb#L3

I always wanted to "lift" those comments into 1rst class citizens, making them available for the reporter. Also I think the standard console reporter should NOT get added these reports, and instead we should have an HTML reporter with all available details.

This leads me to spoil: I'm working in private on a coveralls-a-like service for mutant, called 'mutcov.io' that features this reports, and also statistic aggregation. But the work was delayed as I do not have enough free time. Which is a good thing being commercially busy ;)