Git Product home page Git Product 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

bananeweizen avatar echebbi avatar jkutscha avatar lorenzobettini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pitclipse's Issues

avoidCallsTo not working in eclipse plugin

I have a log method that should not be mutated but adding it to the Avoid Calls To field does NOT prevent pitclipse from reporting "survived" state of removed method mutations

I tried it with "log" and with "*log" is there any more in depth documentation about the format avail?

java.net.SocketException: Connection reset when launching Mutation Testing

I use Pitclipse 0.30.2.201307081826, which is the latest version supplied to me from the PITclipse repository at http://eclipse.pitest.org/release/ (The repository is activated and when I tell Eclipse to search for updates, I receive none.) My Eclipse version is Kepler.

Sometimes when I start PIT Mutation Testing on a project, I get the following error: It happened several times for me today but I wasn't able to reproduce the exact circumstances. Restarting Eclipse fixed the problem.

Starting on port: 51079
Connected
Exception in thread "main" org.pitest.pitclipse.pitrunner.server.PitServer$PitServerException: java.net.SocketException: Connection reset
    at org.pitest.pitclipse.pitrunner.server.PitServer.readOptions(PitServer.java:56)
    at org.pitest.pitclipse.pitrunner.PitRunner.main(PitRunner.java:52)
Caused by: java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.ObjectInputStream$PeekInputStream.read(Unknown Source)
    at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
    at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
    at java.io.ObjectInputStream.<init>(Unknown Source)
    at org.pitest.pitclipse.pitrunner.server.PitServer.readOptions(PitServer.java:52)
    ... 1 more
Closing server
Closed

Provide a Launcher for Plugin-Test

It would be cool, to be able to Test Eclipse-PlugIns with pitclipse. Currently it doesn't work because pitest is unable to resolve the dependencies.

Refactor PitOptions

PitOptions and it's test are ridiculously complex and can be simplified now we now we spawn PITRunner from eclipse rather than MutationCoverageReport directly.

Fix issue with running SWTBot bdd from mvn

Currently we cannot run the bdds from maven as the eclipse platform created by SWTBot is missing JUnit.

Either we're missing dependencies or need to base the tests on an STS platform bundle (for example).

Link to Update Site in README.md Broken

When attempting to follow the link: http://eclipse.pitest.org/release/

The following page was loaded:

404 Not Found

Code: NoSuchKey
Message: The specified key does not exist.
Key: release/index.html
RequestId: 43B785258E707083
HostId:         QLUoxx4lj6X4drBuOiHU+HLYmX65snnm3Vh+PvAEqpRRBf3ltBo2Tm6hHpZU5tc+
An Error Occurred While Attempting to Retrieve a Custom Error Document

Code: NoSuchKey
Message: The specified key does not exist.
Key: 404.html

I am also wondering if the issue is causing the plugin to not be available in the Eclipse Marketplace.

Support avoidCallsTo

Request on groups:

Subject: Does PITClipse support 'avoidCallsTo'?

I'm using PITclipse to run my PIT mutation tests, there are some lines I want to avoid mutations on. Is this possible using pitclipse at the moment?

Add a way to change PIT options

I would like to exclude i.e. toString.
But as far as i can tell this is not possible right now.
(PIT supports it, there shoudl be a way to change this in eclipse)

Broken link in README

I don't know if it is still used, the but http://eclipse.pitest.org/release URL mentioned in the README file returns 404:

404 Not Found

    Code: NoSuchKey
    Message: The specified key does not exist.
    Key: release
    RequestId: 406C442C2A4F46AB
    HostId: 6A9aLunePS3ZSG9luNayD6B8EMjhKCbuOSAvAUmeeH4XjYaRdRoQ70nwXzx2Qdg37VyNLcMAJMI=

An Error Occurred While Attempting to Retrieve a Custom Error Document

    Code: NoSuchKey
    Message: The specified key does not exist.
    Key: 404.html

Workspace launch mode does not show the results

See forum posts below:

From: [email protected]
Date:
To: [email protected]
Subject: Re: PITView Report not being generated with PitClipse

As a followup for someone else who runs into this problem, we resolved it. For some reason, on some students machine's, we needed to change the PITTest preferences from "Project Containing Test Only" to "All projects in the workspace". Once we made this change, PITView came up fine. I'm not quite certain why this was the case, as we only had one Eclipse project opened, and PIT was clearly running (the console showed the tool running.)

Does this make sense to someone who knows the tool and structure better than I do?

Walt

Hi,

Some of my students had the same problem on Win 7 / 8 and the issue
was solved
using the previous tip ( "Project Containing Test Only" -> "All
projects in the workspace" in the PITtest preferences).

I looked at the Console output. It seems PIT raises an exception
complaining about the absence
of "mutations.xml". This seems to be a temporary file generated by
PIT.
I'm sorry but I can't provide the exception stack trace now.

Best,
Eduardo

Could not resolve module: org.pitest.pitclipse.core [885] Bundle was not resolved because of a uses contraint violation.

From Geff Chang on Pit User group

How do I fix this error?

!SESSION 2014-07-21 12:56:41.504 -----------------------------------------------
eclipse.buildId=4.4.0.I20140528-2000
java.version=1.6.0_37
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

!ENTRY org.pitest.pitclipse.core 4 0 2014-07-21 12:57:03.344
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.pitest.pitclipse.core [885]
Bundle was not resolved because of a uses contraint violation.
org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.pitest.pitclipse.core [osgi.identity; osgi.identity="org.pitest.pitclipse.core"; type="osgi.bundle"; version:Version="0.33.3.201406271742"; singleton:="true"] because it is exposed to package 'javax.xml.bind.annotation' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.0.v20140528-2014"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains.

Chain 1:
org.pitest.pitclipse.core [osgi.identity; osgi.identity="org.pitest.pitclipse.core"; type="osgi.bundle"; version:Version="0.33.3.201406271742"; singleton:="true"]
require: (osgi.wiring.bundle=org.eclipse.core.runtime)
|
provide: osgi.wiring.bundle: org.eclipse.core.runtime
org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.0.v20140528-2014"; singleton:="true"]

Chain 2:
org.pitest.pitclipse.core [osgi.identity; osgi.identity="org.pitest.pitclipse.core"; type="osgi.bundle"; version:Version="0.33.3.201406271742"; singleton:="true"]
require: (&(osgi.wiring.bundle=org.pitest.pitclipse-pitrunner)(bundle-version>=0.33.3))
|
provide: osgi.wiring.bundle; osgi.wiring.bundle="org.pitest.pitclipse-pitrunner"; bundle-version:Version="0.33.3.201406271742"
org.pitest.pitclipse-pitrunner [osgi.identity; osgi.identity="org.pitest.pitclipse-pitrunner"; type="osgi.bundle"; version:Version="0.33.3.201406271742"]
import: (osgi.wiring.package=javax.xml.bind.annotation)
|
export: osgi.wiring.package: javax.xml.bind.annotation
javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"]
at org.eclipse.osgi.container.Module.start(Module.java:434)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.pitest.pitclipse.ui 4 0 2014-07-21 12:57:03.375
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.pitest.pitclipse.ui [886]
Unresolved requirement: Require-Bundle: org.pitest.pitclipse.core; bundle-version="0.33.3"
-> Bundle-SymbolicName: org.pitest.pitclipse.core; bundle-version="0.33.3.201406271742"; singleton:="true"
org.pitest.pitclipse.core [885]
No resolution report for the bundle. Bundle was not resolved because of a uses contraint violation.
org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.pitest.pitclipse.ui [osgi.identity; osgi.identity="org.pitest.pitclipse.ui"; type="osgi.bundle"; version:Version="0.33.3.201406271742"; singleton:="true"] because it is exposed to package 'javax.xml.bind.annotation' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.0.v20140528-2014"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains.

Chain 1:
org.pitest.pitclipse.ui [osgi.identity; osgi.identity="org.pitest.pitclipse.ui"; type="osgi.bundle"; version:Version="0.33.3.201406271742"; singleton:="true"]
require: (osgi.wiring.bundle=org.eclipse.core.runtime)
|
provide: osgi.wiring.bundle: org.eclipse.core.runtime
org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.0.v20140528-2014"; singleton:="true"]

Chain 2:
org.pitest.pitclipse.ui [osgi.identity; osgi.identity="org.pitest.pitclipse.ui"; type="osgi.bundle"; version:Version="0.33.3.201406271742"; singleton:="true"]
require: (&(osgi.wiring.bundle=org.pitest.pitclipse-pitrunner)(bundle-version>=0.33.3))
|
provide: osgi.wiring.bundle; osgi.wiring.bundle="org.pitest.pitclipse-pitrunner"; bundle-version:Version="0.33.3.201406271742"
org.pitest.pitclipse-pitrunner [osgi.identity; osgi.identity="org.pitest.pitclipse-pitrunner"; type="osgi.bundle"; version:Version="0.33.3.201406271742"]
import: (osgi.wiring.package=javax.xml.bind.annotation)
|
export: osgi.wiring.package: javax.xml.bind.annotation
javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"]
at org.eclipse.osgi.container.Module.start(Module.java:434)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

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.