Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Upgrade Pitest to 1.15.8#224

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
echebbi wants to merge11 commits intomaster
base:master
Choose a base branch
Loading
from221-support-java-21
Open

Conversation

echebbi
Copy link
Collaborator

@echebbiechebbi commentedMar 26, 2024
edited
Loading

Closes#221 by upgrading Pitest to 1.15.8

This upgrade comes with several API breaking changes. A notable change is the removal of several "research-oriented" mutators from PIT and which are now wrapped in a dedicated PIT plug-in. Seehcoles/pitest#993 for the changes and#221 (comment) for our decision to discard those mutators for now.

@echebbiechebbi added an: enhancement 📈Improve something for: pitest 🐦Related to PIT integration is: in progress 🚧Someone is working on it labelsMar 26, 2024
@echebbiechebbi self-assigned thisMar 26, 2024
@echebbiechebbi linked an issueMar 26, 2024 that may beclosed by this pull request
@LorenzoBettini
Copy link
Collaborator

@echebbi I created#226 and build is green. Please have a look and merge it if you're OK with that.

I tried to cherry pick some of your commits but of you course you should expect merging conflicts.

I wonder if some of the failures I see in your builds (unbound Java 1.8 classpath container) might be due to Java 21 not supporting Java 8 anymore. In any case, I think the main build should be with Java 17 and we could have another build testing that, at least the runtime tests are green.

Copy link
Collaborator

@LorenzoBettiniLorenzoBettini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@echebbi Thanks a lot for this great effort of porting to the new API! :)

I left a few comments, questions and required changes.

You may also want to first merge#228 and then rebase this one.

// run test and confirm result is as expected
PAGES.getRunMenu().runPitWithConfiguration(TEST_CONFIG_NAME);
coverageReportGenerated(TESTED_CLASSES,COVERAGE,1,84,1);
coverageReportGenerated(TESTED_CLASSES,COVERAGE,5,20,1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We lose all these mutators because of the mutators removed by default in PIT?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks like it, yes. We did lose a lot of mutations operators (seeMutations.java,MutatorApiOfPitTest.java andthe list of research mutators). That being said I believe we should take some time to make sure I didn't miss something while upgrading.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@echebbi So creating a new bundle forhttps://github.com/pitest/pitest-rv-plugin and adding it to our distribution would bring the old mutators back?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, just like we did for thepitest-junit5 plugin. Do you think that we should integrate thepitest-rv plugin after all?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@echebbi maybe we should/could. I'm a bit worried by the fact that people using Pitclipse would have more mutators than those using Maven and ignoring the newpitest-rv, but maybe we can rely on them knowing the Maven plugin as well.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

By default we run Pitest's DEFAULT mutator group so our mutators set would still be the same as a bare Pitest configuration.pitest-rv's mutators would only be exposed through the preferences/configuration pages which feels fair to me.

We can even add a column to the mutators table that explicitely states the origin of each mutator:

NameDescriptionContributor
Conditionals BoundaryReplaces the relational operators <, <=, >, >=pitest
NegationReplaces any use of a numeric variable (local variable, field, array cell) with its negationpitest-rv-plugin

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@echebbi yes that'd be useful; but would such information be easily (automatically) retrieved and easy to maintain?

Moreover, withpitest-rv we would restore the "old defaults" or not?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

would such information be easily (automatically) retrieved and easy to maintain?

It might be possible to retrieve/infer the information through reflection. My intuition is that since we have access to theMethodFactoryFactory instances (each mutation operator is implemented as a child ofMethodMutatorFactory) we should be able to get the info with something along the lines of:

// maps plugin ID to the name we want to display in the table//Map<String,String>pluginIdToContributorName =Map.of("org.pitest","pitest","org.pitest.pitest-rv-plugin","pitest-rv");Collection<MethodMutatorFactory>mutators =ServiceLoader.load(MethodMutatorFactory.class,IsolationUtils.getContextClassLoader());for (MethodMutatorFactorymutator :mutators) {//// retrieve the contributor through reflection//Bundlebundle =FrameworkUtil.getBundle(mutator.getClass());//// update our 'Mutators' enum with the contributor name//StringcontributorName =pluginIdToContributorName.get(bundle.getBundleId());Mutators.valueOf(mutator.getName()).setContributorName(contributorName);}

Or, if we want to be really extensible it should be possible to craft a solution based on a custom extension point so that external plug-ins can provide new mutators without having to change a single piece of code in Pitclipse's core. That would require some refactoring though so I believe that such a work would deserve its own PR.

Moreover, with pitest-rv we would restore the "old defaults" or not?

We wouldn't because this group is not related to the research operators and has been completely removed. We may want to somehow supportthe groups related to research operators though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@echebbi thanks for the clarification, especially about the old defaults, which are now gone for good. I thought thepitest-rv was related to that so I was reluctant to addpitest-rv right away because that would have required to undo the removal of old defaults, but it's not like that :)

So, shall we addresspitest-rv in a new PR and go on with this one?

I would also try to build with Java 21 and have a UI test with Java 21, but we can do that in another PR as well.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

shall we addresspitest-rv in a new PR and go on with this one?

@LorenzoBettini fine by me!

@echebbi
Copy link
CollaboratorAuthor

echebbi commentedApr 1, 2024
edited
Loading

Finally a green build 🎉@LorenzoBettini thanks for your help :) I'm not 100% confident regarding the new mutators/groups set and the current results though. I think we should take some time to make sure everything is ok before merging.

@sonarqubecloudSonarQubeCloud
Copy link

@LorenzoBettini
Copy link
Collaborator

@echebbi shall we merge this and release?

1 similar comment
@LorenzoBettini
Copy link
Collaborator

@echebbi shall we merge this and release?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@LorenzoBettiniLorenzoBettiniLorenzoBettini approved these changes

Assignees

@echebbiechebbi

Labels

an: enhancement 📈Improve somethingfor: pitest 🐦Related to PIT integrationis: in progress 🚧Someone is working on it

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Runing pitclipse with Eclipse 2023-12 and Java 21 fails

2 participants

@echebbi@LorenzoBettini

[8]ページ先頭

©2009-2025 Movatter.jp