Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Amilcar34 opened this issue Apr 21, 2023 · 7 comments
Open

Comments

@Amilcar34
Copy link

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
Copy link
Collaborator

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

@Amilcar34
Copy link
Author

Amilcar34 commented Apr 21, 2023

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
Copy link
Collaborator

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
Copy link
Author

ok, thank you so much.

@echebbi
Copy link
Collaborator

echebbi commented Mar 23, 2024

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
Copy link
Collaborator

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

@echebbi
Copy link
Collaborator

echebbi commented Mar 23, 2024

I'm working on it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants