New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Maven plugin to check threshold based on pseudo-tested and partially tested methods #49
Comments
Note that this issue was raised as a result of the workshop I did with Oscar on XWiki, see my blog post at http://massol.myxwiki.org/xwiki/bin/view/Blog/MutationTestingDescartes |
It would be great to have this issue implemented ASAP so that we can test it on the xwiki project. I believe it's quite easy to do and would allow putting PIT/Descartes in production and get feedback. Thanks! |
As we discussed briefly last time, this is already supported by PIT and can be used. You may want to check the following PIT configuration parameters:
Anyways, I would like to leave this issue open in order to inspect the possibility of implementing a PIT Mojo that fails on the number of pseudo-tested or partially tested methods found, which makes more sense in the context of descartes. |
ok thanks Oscar, I must have forgotten. The strong pseudo-tested criteria makes senses indeed. BTW, I've tried to use PIT 1.3.1 this morning and I've rebuilt Descartes from sources (0.2-SNAPSHOT - would be nice to have some release BTW) and it failed (some classes/methods were not found). So there's some incompatibility between latest PIT and latest Descartes versions. |
Given the current PIT code, we might have to create a new Maven plugin to implement a task that fails on the number of pseudo-tested and partially-tested methods. |
We have a custom reporter in Descartes which is identified as |
Probably the steps are:
|
About the last option, I have a plugin to visualize Descartes reports in Jenkins. You can find the initial version here. |
Note that the use case of Jenkins is different IMO. For example in the XWiki case it's not interesting: We need to be able to do this at the level fo the maven build so that it can be executed on developer machines (and since it's in the build it can of course be executed on the CI too, and fail the build too ;)). Note that we're currently using pitest maven plugin's check mojo. |
hi @vmassol , |
I agree that the historical use case (trends) is interesting and not something you can do on the dev machines. But you don't need the ability to fail the build in the Jenkins plugin for computing trends! ;) (my comment was a reply about the fail-the-CI-job feature). Also note that it could be interesting to have a Sonar plugin for the trend. |
I created a fork of pit-test where I added partialyTested and pseudoTested Threshods: |
I added two new parameters to AbstractPitMojo of pitest project (i forked it):
And check the thresolds in AbstractPitMojo.execute() In this way I can compute the pseudo-tested or partially-tested methods for every execution on pitest (with any mutation engine). The other solution that was suggested from Oscar was to analyze the report produced from decartes methods report engine (METHODS) I tryed to add my solution directly to pitmp-maven-plugin project but I not able to extend AbstractPitMojo.execute() because it is marked as final. Do you agree with my solution or do you prefer to analyze the report produced from decartes (with methods as report engine). |
You already answered it I think since you said:
So this just needs to not be final. I think it's a very bad practice in general to have final methods btw ;) (my personal POV) |
The concepts of pseudo-tested and partially-tested methods make sense only when using descartes, so there is no problem in using the reporter. The goal to be implemented in the new implementation of AbstractPitMojo should use only descartes as mutation engine. |
@nicolabertazzo I had the same issue developing PitMP, indeed many methods are private or final in AbstractPitMojo. |
Ok thanks for the hints. |
To implement Maven plugin to check threshold based on methods i tryed these 3 solutions:
|
@nicolabertazzo |
@nicolabertazzo It would really better if you didn't have to fork pit. Have you opened a ticket on the PIt project to discuss it with them and to see what could be done to make PIT extensible for this use case/needs? This would be the best solution by far. Note that XWiki is using the PIT Maven plugin and not PIT MP (since it takes way too long to execute on the xwiki codebase). So a solution based on PIT would be good. |
As suggested from @oscarlvp and @CaelInria i extended pitmp-maven-plugin project.
|
This issue can be transferred to the PitMP repository. |
Create a mechanism to fire a build failure in Maven when the mutation score drops below certain configurable value or the number of strong/weak pseudo tested methods raises above an also configurable threshold.
The text was updated successfully, but these errors were encountered: