pitest / pitclipse

Mutation testing for Java in Eclipse IDE. Based on PIT (Pitest).
https://pitest.org
Apache License 2.0
59 stars 17 forks source link

Add the option of 'extreme mutation testing' with engine pit-descartes #219

Open Amilcar34 opened 1 year ago

Amilcar34 commented 1 year ago

Motivation

For to have a quick coverage option based on preliminary mutations

Proposed Solution

I'm sorry, but I don't know how :c

LorenzoBettini commented 1 year ago

Hi Could you please provide pointers to the documentation of such a feature?

Amilcar34 commented 1 year ago

I hope this answers your question. Currently with this configuration in my pom.xml I can generate reports without so much computing cost


<plugin>
  <groupId>org.pitest</groupId>
  <artifactId>pitest-maven</artifactId>
  <version>1.7.0</version>
  <configuration>
    <mutationEngine>descartes</mutationEngine>
  </configuration>
  <dependencies>
    <dependency>
      <groupId>eu.stamp-project</groupId>
      <artifactId>descartes</artifactId>
      <version>1.3.2</version>
    </dependency>
  </dependencies>
</plugin>
´´´

Example: https://github.com/oscarlvp/pitest-extensible-engines
Source: https://github.com/STAMP-project/pitest-descartes/

Do you think the plugin reports can be optionally generated with the 'discards' engine?
LorenzoBettini commented 1 year ago

So it's an external project. I don't think that's feasible. At least, I can't work on that, since it sounds rather complicated

Amilcar34 commented 1 year ago

ok, thank you so much.

echebbi commented 5 months ago

So it's an external project. I don't think that's feasible.

@LorenzoBettini Descartes is a plugin for PIT so I believe we could actually support it without too much trouble.

Here is how I would do it:

  1. Embed Descartes in an Eclipse plug-in (just like org.pitest.pitest-junit5-plugin)
  2. Update PitOptions and PitCliArguments to support the mutationEngine parameter (I've never used it but I expect it to match the mutationEngine in the POM above and Descartes acknowledges it)
  3. Update Pitclipse's launch configuration to expose the mutationEngine parameter to the end user (I think it's in the PitConfiguration and maybe the PitArgumentsTab classes).

A possible pain point would be PIT not detecting the Descartes engine. A possible workaround may be to subclass DescartesEngineFactory and to expose this subclass to PIT through a plug-in fragment. We already do this in the org.pitest.pitclipse.listeners fragment which exposes Pitclipse's listeners here. pitest-junit5-plugin is detected though so it should be fine.

Also, if we plan to support other mutation engines in the future it may be interesting to design an extensible architecture so that we can add new mutation engines without having to update Pitclipse's internals each time. Maybe through a dedicated Eclipse extension in org.pitest.pitclipse.core?

I might have some time to look into this in the incoming weeks.

LorenzoBettini commented 5 months ago

Ok, but first it's crucial to update to the new version of pit ;)

echebbi commented 5 months ago

I'm working on it 😄