Code Monkey home page Code Monkey logo

pitclipse's Introduction

ALE logo Pitclipse

Test your tests right into your IDE!

Java CI with Maven Java CI with Maven on Windows and Mac Technical Debt Coverage Lines of Code

Provides mutation coverage for your Java programs within the Eclipse IDE. Built on PIT (Pitest) for reliability.

What is mutation testing?

Faults (or mutations) are automatically seeded into your code, then your tests are run. If your tests fail then the mutation is killed, if your tests pass then the mutation lived.

The quality of your tests can be gauged from the percentage of mutations killed.

Henry Coles, pitest.org

Main Features

  • Reliability: relies on PIT (Pitest)
  • Customization: provides numerous preferences to tailor analysis
  • JUnit support: works with both JUnit 4 and JUnit 5 tests

Usage

Once the plug-in is installed (see Installation below), you can run Pitest:

  • Right-click on a Java project defining unit tests
  • Run As > PIT Mutation Test

Wait a few seconds, two views should open to show the results:

  • PIT Summary: shows the percentage of mutation coverage
  • PIT Mutations: shows the detected mutations and their location in code

It is also possible to run a single JUnit test class. Specific PIT options can be configured from the Launch Configuration window:

  • Run > Run Configurations...
  • Double-click on PIT Mutation Test
  • Specify the options
  • Press Run

Preferences also allow to change mutation settings (Window > Preferences > Pitest).

Installation

The plug-in is available in the Eclipse Marketplace.

Drag the following button to your running Eclipse workspace to start the installation:

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
Or show how to install it manually
  1. Open Eclipse IDE
  2. Go to Help > Install New Software...
  3. Copy the update site’s URL in the Work with textbox (ATTENTION: the update site has changed on 5 May 2021, make sure you remove the previous one hosted on bintray):
  4. Hit Enter and wait for the list to load
  5. Check everything
  6. Click Next then Finish

Contributing

Requirements
Import the projects in the IDE
  1. File > Import... > Team > Team Project Set
  2. Fill URL with "https://raw.githubusercontent.com/pitest/pitclipse/master/eclipse-project-set.psf"
  3. Click on Finish

Tip: use Working Sets for a better workspace organization:

  • Open Project Explorer's menu > Top Level Elements > Working Sets
  • Open Project Explorer's menu > Select Working Sets > Check "bundles", "features", "tests" and "releng"
Setup the environment
  1. Open the org.pitest.pitclipse.target/org.pitest.pitclipse.target.target file
  2. Click on Set as Target Platform
  3. Wait for the dependencies to be loaded (may take a while)
Commit your changes
  1. Make some changes
  2. Make sure tests still pass: mvn clean verify
  3. Submit a PR

See CONTRIBUTING.md for further details.

pitclipse's People

Contributors

lorenzobettini avatar jkutscha avatar echebbi avatar bananeweizen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.