Comments (3)
The mutants are not completely unkillable, but they are not reliably killable.
If they happen to be the first mutant in one of the JVMs that pitest launches, they will be killed by an effective test. Unfortunately, they may also cause other mutants to be falsely killed as any side effects from their execution (e.g bad state stored in a static variable) will endure in the JVM from that point on.
However, I think you are correct that there is an issue here. The change has not considered delayed execution from Suppliers etc.
I'll most likely re-relase 1.15.5 tomorrow with the change rolled back until this is reexamined.
Thanks again for the report.
from pitest.
Thanks for the report.
I've just taken a quick look and I suspect the issue is that the release notes missed out the inclusion of #1274
This change expands pitest's search for code that is only called from static initializers. Although we'd ideally like to mutate this, because the code is only executed once within a JVM, it is only possible to kill these mutants if pitest happens to have launched a fresh JVM just before the mutant is inserted.
From a very quick scan of your example class, this looks to be working as intended since dropRedundantParentheses
etc are called only when initializing a static field.
from pitest.
@hcoles thanks for the quick response!
Perhaps I misunderstand, but since execution of the impacted code is deferred, I would expect it to be excluded from the search. After all, the version 1.15.3 report shows that the mutants could indeed be killed prior to this change (without restarting the JVM).
Put another way, given a method foo
that is referenced only by a static field, I would would expect it to be excluded when used as
private static final String CONST = foo();
but not when used as
private static final Supplier<String> CONST = () -> foo();
private static final Supplier<String> CONST_2 = ThisClass::foo;
Because in the latter cases any mutation of foo
will impact use of the static Supplier
s.
from pitest.
Related Issues (20)
- code might be less elegant if chained call of cast to type is present
- Mutating non-existing lines in Kotlin HOT 3
- Issue in build pulling in old version of java HOT 1
- Conditionals with `isDebugEnabled`
- `avoidCallsTo` not working for internal classes
- Joda-Time Mutation testing requires a green suite Error HOT 1
- Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormally! (MINION_DIED)
- How can i kill this mutation HOT 2
- Allow reusing surefire environmentVariables for pitest HOT 3
- Mutation Coverage failure w/ AspectJ compile-time weaving plus woven deps HOT 1
- PIT Help Error : Couldn't exclude classes / test classes - error - tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite. HOT 3
- Pitest doesn't recognize exception thrown by assert keyword by default HOT 4
- PIT is generating equivalent mutations
- Drop Java 8 Support HOT 5
- Formula for mutation score calculation HOT 2
- pitest-maven (1.16.1) 6 transitive vulnerabilities found HOT 2
- Failed Custom Mutator Creation HOT 3
- Maven variables ${settings.*} not expanded HOT 1
- Android: tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite. HOT 3
- Pitest seems to ignore or never trigger Mockito's UnnecessaryStubbingException HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pitest.