Pitest Feedback cycle

16 views
Skip to first unread message

Harald Bittermann

unread,
Apr 24, 2024, 7:24:13 AMApr 24
to PIT Users

Hey everybody.

We are using Pitest in our build pipeline for the past year. It runs as an additional build step in every main build, but we haven’t implemented any feedback cycle. This means that no developer is informed if mutation coverage or test strength decreases.

Currently, our Jenkins build generates a Pitest report and zips it. I occasionally take a look at these reports.

I was hoping to find a Sonar plugin that could visualize these numbers over time. Since we regularly use Sonar, it would be convenient. I found this plugin here (https://github.com/VinodAnandan/sonar-pitest), but it seems to be outdated (no commits in the last 7 years), and it doesn’t appear to be compatible with Sonar 9.

The only alternative I see is to define thresholds so that the build fails if the target threshold is not reached. However, this solution doesn’t quite satisfy me.

How do you integrate Pitest into your daily workflow?

henry

unread,
Apr 24, 2024, 7:28:19 AMApr 24
to PIT Users
Hi Harald,

If your team is using git and pull/merge requests, by far the most effective way to use pitest is to integrate it at that point.

I blogged about it over here -> https://blog.pitest.org/dont-let-your-code-dry/

Ullrich Hafner

unread,
Apr 24, 2024, 9:33:33 AMApr 24
to pitu...@googlegroups.com
I also can recommend a direct integration into pull and merge requests! 

Since you are already using Jenkins: when you are interested in visualizing the history I would additionally recommend the Jenkins coverage plugin: https://plugins.jenkins.io/coverage/

It has support for PIT results and shows a history of the mutation coverage in your Jenkins builds. 
The plugin also has support for quality gates that can change the status of your Jenkins builds depending on the results. 
You also see the delta coverage, i.e. what changed from build to build. Survived mutations will directly show up in GitHub checks as well. 

--
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pitusers/2aa8f95e-3889-4f39-aa4b-f1766901cd8en%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages