How to tell PIT not to mutate certain specific parts of the code?

It happens that sometimes there are lines of code or methods that mutants cannot create that will be killed by any appropriate test. (For example, I can use an object with a null pattern, and some of the methods implemented are not relevant in prod, so any implementation (even throwing) would be correct).

It would be nice if I could take into account the pit in order to avoid them (so mutation coverage is more appropriate), but I could not find a way to do this in the documentation.

Is there any way to do this?

+4
source share
1 answer

PIT currently has three mechanisms by which code can be filtered.

  • By class using parameter excludedClasses
  • Using method excludedMethods

1, .

2 ( toString hashcode).

3 , () .

, , . - , , .


.

.

, , . , .

, , .

. , , .

+5

Source: https://habr.com/ru/post/1620693/


All Articles