pitest icon indicating copy to clipboard operation
pitest copied to clipboard

Conditionals with `isDebugEnabled`

Open daniel-frak opened this issue 11 months ago • 0 comments

Consider code like this (using @Slf4j):

if(log.isDebugEnabled()) {
  log.debug("Test log {}". performSomeComputation());
}

While pitest correctly ignores the log.debug statement, the conditional is still being mutated.

The Pitest quick start guide says PIT avoids generating this type of equivalent mutation by not generating mutations for lines that contain a call to common logging frameworks, so I would expect this conditional to be ignored as well.

daniel-frak avatar Feb 28 '24 11:02 daniel-frak