mbj / mutant

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

Add matcher for mutating views #293

Open dkubb opened 9 years ago

dkubb commented 9 years ago

Views often have logic within them that goes untested, and mutant should support mutating the code within the views.

Obviously we attempt to keep as much logic as possible outside of views, where it can be more easily tested, but what does make it into the views should still be tested.

mbj commented 9 years ago

@dkubb Thats a good idea.

For my future self / or anyone who want to hack on this:

It probably requires a custom matcher (the pierce in mutant that finds subject), a custom injector (the components that makes mutated ASTs visible to the tests) and a custom expression (the "UI" the users use to "target" a matcher), and a custom subject that represents the view under mutation testing.

Right now we have Mutant::Subject::Method::Instance for instance methods, and a Mutant::Subject::Method::Singleton for singleton methods. This feature will probably yield an Mutant::Subject::View::Erubis or such that is LSP compatible with the interface of Mutant::Subject.