GitHub

Pitest Github Integration With Gradle

This is a demo of pitest/github merge request integration using gradle.

If you'd be interested in early access please contact pitest.demo@groupcdg.com

How it works

Low level git integration

The pitest-git-plugin extension to pitest adds functionality to map between bytecode and source files within git version control. The allows the scope of mutation analysis to be easily limited to just a portion of changed code, such as a pull request.

The plugin can also be used locally, limiting analysis to lines of code that have been modified locally. This gives an ideal way to get feedback on your work before pushing.

The plugin is commercial software and requires a licence from CDG to be used. This project uses an embedded demo licence which may only be used with code in the package com.example. You are free to use this demo licence for the purpose of evaluation and demonstration, but not for commercial development.

Free licences are available for open source projects.

Github Integration

The project is configured to run the new maven goal pitest-github:github task for each pull request.

This goal reads files generated by the pitest-git-plugin and uses them to create discussions and notes on merge requests. The results from multiple modules are consolidated to give a single view.

This PR workflow allows mutation testing to be used effectively on projects where it would not be practical to mutate the entire codebase. Gaps in the test suite and redundant code will be highlighted automatically each time an area of code is changed.

Requirements

  • A CDG licence file
  • Pitest configured to produce git output (see example build file)
  • pitest-github gradle plugin configured for project
  • ci script calls pitest-github for pull requests only

Read the original on github.com ↗