Skip to content

Technical Documentation

Luca Böhm edited this page Feb 5, 2024 · 28 revisions

1. Introduction: Enhancing Mutation Testing with the PiTest Plugin for IntelliJ IDE

In the ever-evolving landscape of software development, the pursuit of higher quality code is paramount. Testing methodologies play a pivotal role in achieving this goal, with Mutation Testing standing out as a powerful approach to assess the resilience of test suites. In this context, our project emerges with a mission and vision focused on advancing Mutation Testing capabilities within the popular IntelliJ IDE through a dedicated plugin that seamlessly integrates with PiTest.

2. Project Mission

Our mission is to enhance software mutation testing within the IntelliJ IDE by implementing a specifically designed plugin that integrates with PiTest. The approach involves several key steps:

Integration Development: We will develop an plugin that integrates with IntelliJ IDE, ensuring that PiTest's functionalities are easily accessible within the developer's primary workspace.

Dynamic Test Configuration: A core feature of our plugin will be to enable dynamic configuration of test scopes. This will allow developers to selectively fine-tune their testing efforts, focusing on specific classes or modules.

Result Visualization: The plugin will provide visualizations of Mutation Testing results. This will make it more comfortable for developers to interpret PiTest outputs.

User-Centric Design: The interface and functionality of the plugin will be designed with a strong focus on user experience, ensuring that it is both powerful and easy to use.

By following these steps, we aim to not only enhance PiTest’s functionality within IntelliJ IDE but also empower developers with more efficient, precise, and user-friendly software testing tools, ultimately leading to higher quality software development.

3. Project Vision

Software quality hinges on robust testing practices. While code coverage remains a prevalent metric, evaluating the true effectiveness of tests in ensuring expected behavior often gets overlooked. This is where Mutation Testing steps in—a method that generates code variations to evaluate the ability of tests to detect changes.

PiTest, a leading tool in Mutation Testing, falls short due to its limited integration capabilities. It lacks the functionality to display test run results and configure test scope dynamically, creating a gap in assessing test effectiveness within the environment best known to the developer.

Our product vision is to introduce an IntelliJ IDE plugin that not only presents PITest results but also empowers users to seamlessly fine-tune test scopes, even down to specific classes. By integrating these features, we aim to bridge the existing gap, providing enhanced visibility and control within the familiar IntelliJ environment, thereby ensuring higher-quality test outcomes.

4. Software Architecture

4.1 Definitions, Acronyms and Abbreviations

PITest: PIT mutation testing

4.2 Architecture Overview

4.2.1 Runtime Components

Design Documentation AMOS drawio

After installing our plugin, users will be able to configure mutation tests. This can be achieved by specifying values for verbosity, mutators, target tests and more in a separate window. In addition, buttons are provided within the code editor for initiating, re-running and stopping the execution of pitest runs.

For the plugin implementation, we've chosen the IntelliJ Platform Plugin SDK, which provides all the infrastructure IDEs need to support rich language tools. The SDK uses Java Swing for front-end development. The front-end components communicate with the back-end, which is implemented in Java/Kotlin, using Gradle. The choice of Java/Kotlin is based on the directory structure generated by the IntelliJ IDE plugin generator.

The user can start a PIT run either by clicking on the "Run" button in the IDE or by right clicking on an appropriate class/package in their project folder and selecting "Run PIT MutationMate".
This will send either the previously set run configuration or a default configuration to the override plugin, which will then start a PiTest run in the background.
This PItest run then triggers the third plugin, the coverage reporter, which generates two xml reports containing all the information gathered by pitest.
Our plugin then parses the generated report to show line coverage, mutation coverage and test strength. Passed tests are highlighted in green, while failed tests are highlighted in red. In addition, mutation test results for each line of code are presented as inline annotations.

4.2.2 Code Components

Code Components Diagram

Code Component Diagram

The TestConfigurator allows users to configure and manage mutation test runs in the editor. Our plugin configures the test runs by running a Gradle task. This task triggers the Override plugin, which overwrites certain parts of the task and then triggers a new pitest run.
The coverage reporter plugin is triggered by pitest when it finishes. It now generates the xml files used later in the plugin.
The executor now gets feedback from the UPD server that pitest is finished. It now triggers the XML parser.
The XML parser extracts the necessary information, saves it for further processing and triggers the visualisation.

The results are now presented in the tool window.

5. Technology Stack

Programming Language: Kotlin. Java can be used if strictly necessary for certain tasks and no statisfying kotlin solution is avaliable.

Intellij IDE: The user will interface with the plugin through the Intellij IDEA IDE or Android Studio. Intellij Plugin SDK: main framework for development of the actual plugin PITest: The targeted tool is the PIT Mutation Testing system. Gradle: as the build system Pitest-Gradle/Maven-Plugin: Setup by the user to integrate running their mutation tests into the build environment Git/Github: for source code management & collaboration JUnit: as a test framework Frontend: The UI for the plugin will be developed using Swing or JavaFX Plugin dependencies: The developed plugin will have the following dependencies: GradleConnector: Allows the plugin to run a gradle task, which in turn will execute the pitest mutation testing. Alternatively Maven Invoker API if maven is used as a build system.

6. Team Members

Erben Emanuel
Nützel Felix
Heimbs Lennart
Böhm Luca
Malliaros Nikolaos
Herzig Tim Niklas
Fogarty Liam
Oberson Brianne
Dargel Olivia

6.1 Roles and Responsibilities

Product owners: Erben Emanuel, Nützel Felix Software Developers: Heimbs Lennart, Böhm Luca, Malliaros Nikolaos, Herzig Tim Niklas, Fogarty Liam, Oberson Brianne Scrum Master: Dargel Olivia