Link Search Menu Expand Document

JUnit 5 Accelerator Plugin

Release 1.0.0 requires pitest 1.9.0 or above. Early releases require pitest 1.8.0.

Maven Central


Mutation analysis times depends on many different factors which make overall execution times difficult to predict, but the execution time of the tests is always an important variable.

Although small improvements in the execution time of individual tests are of little importance when the tests are run only once within a suite, mutation testing may require each test be run thousands of times. Small speed gains can become of practical importance.

The junit5-accelerator plugin improves mutation test performance by reducing the overhead in running tests that use a limited set of JUnit Jupiter features. Tests that use only these features will run more quickly, tests that use features outside this set will be executed as normal.

For some codebases this can have a large impact on performance, e.g analysis time for Commons Lang is reduced from over 55 minutes to under 18.

Eligible tests

Tests that use the following subset of JUnit 5 Jupiter functionality will be accelerated. Any test classes using features/annotations outside of this set will be run as normal. Note that this is an “all or nothing” approach, an unsupported annotation added to one test method means no tests within that class will be accelerated.

  • @Test (parameterless methods only)
  • @BeforeEach
  • @AfterEach
  • @DisplayName (annotation is ignored)

The following mockito features are also supported

  • @Mock (on fields only)
  • @ExtendWith(MockitoExtension.class)
  • @MockitoSettings


To you use the plugin you must first acquire a licence.

The licence file must be named cdg-pitest-licence.txt and placed at the root of the project.

The plugin itself should be placed on the classpath of the pitest build integration plugin.

E.g for maven


Or for gradle

dependencies {
  pitest 'com.groupcdg.pitest:pitest-accelerator-junit5:1.0.0'