Skip to content

Adds GITLAB-ISSUE output format to PIT/Descartes to generate Gitlab issues out of mutation testing

Notifications You must be signed in to change notification settings


Folders and files

Last commit message
Last commit date

Latest commit



14 Commits

Repository files navigation


This project extends the pitmp-maven-plugin, to generate Gitlab issues out of mutation testing: to provide that, it adds a new output format, GITLAB-ISSUES, to PIT/Descartes.

The generated Gitlab issues will be overwritten (updated) if the plugin is run more than once, so you can use it multiple times without generating tons of verbose issues...

The content of issues (plain text) is also replicated in text files (in the Descartes output directory).

When critical issues are detected (GREEN test suite upon code mutation), DSpot commands to fix the issue(s) is/are proposed in the output: the user may then run DSpot manually, as suggested, then Descartes again to validate the result of DSpot (check if new tests eventually generated by DSpot fix something, or not).


To use it, just add some configuration to pitmp-maven-plugin, to declare:

  • GITLAB-ISSUES as an output format
  • Gitlab configuration (optional): if you want Gitlab issues to be injected in your repository, specify the destination (Gitlab url, project and token).

Results are more complete if fullMutationMatrix=true set, but processing would be slower, and PIT would only allow XML output in addition to GITLAB-ISSUES (eg. no HTML nor JSON allowed). These limitations are due to PIT/Descartes. Without fullMutationMatrix set, only critical issues will be detected (mutations that are not detected at all), and processing will be faster.

Example of Descartes plugin configuration to enable GITLAB-ISSUE output:

    <!-- All PIT's properties can be used. -->
      fullMutationMatrix=true optional (required to detect minor issues, but slower processing).
      If set, PIT/Descartes would only allows XML output (no HTML, JSON...)
      Output will be written in reportsDirectory (with same default as for Descartes),
      and optionally to Gitlab if appropriate configuration of destination is provided.
      <!-- Sample config of Gitlab destination (if provided, Gitlab issues will be generated) -->


To run Descartes with the configuration above:

mvn eu.stamp-project:pitmp-maven-plugin:descartes

(Note: generally requires that your project is built before: run "mvn clean install" prior to running Descartes !)

According to issues discovered by Descartes, 3 files may be generated as output:

  • git_critical_issue.txt reports code mutations that are not detected by tests at all (GREEN test suite).
  • git_minor_issue.txt reports code mutations that SOME tests do not detect (only if fullMutationMatrix is set to true).
  • git_no_coverage.txt reports missing unit tests.

The 2 first ones are replicated as Gitlab issues (if a proper Gitlab configuration is provided).

Link with DSpot

If critical issues are detected, the output in git_critical_issue.txt (and the Gitlab issue) suggests DSpot commands (using DSpot maven plugin) to generate tests that may fix the issue.

Example of such output:

CRITICAL TEST FAILURE: test suite GREEN upon code mutation
In class, method get (line 84) was updated as follows:
	All methods instructions replaced by: return null;
	The following test(s) still PASS:
Suggested DSpot fix(es):
mvn eu.stamp-project:dspot-maven:2.1.1-SNAPSHOT:amplify-unit-tests -Dpath-to-properties=/tmp/stamp1379112605526824370.tmp -Dtest-criterion=JacocoCoverageSelector -Dgenerate-new-test-class=true -Diteration=1

Running the suggested DSpot command, then "mvn test" and Descartes again, may or may not fix the issue.


Adds GITLAB-ISSUE output format to PIT/Descartes to generate Gitlab issues out of mutation testing






No releases published