Open vmassol opened 5 years ago
Hi @vmassol,
There is no precise way to avoid NPE capturing by generated tests. However, EvoSuite uses eight different criteria for test generation by default. One of them is Exception criteria, which capture all of the exceptions. You can run EvoSuite without this criterion by adding this parameter:
-Dcriterion=BRANCH:LINE:WEAKMUTATION:OUTPUT:METHOD:METHODNOEXCEPTION:CBRANCH
Note: I think capturing exception is useful in several cases.
Yes, but unfortunately, in EvoSuite, you can not capture only one specific type of exception.
I've noticed that the majority of the generated tests for xwiki-commons-xml are about setting some values that lead to an NPE and the test verifies that the NPE is thrown.
There are 2 problems with this: 1) On XWiki we don't have the practice of checking for null values for all parameters. We check for null at system boundary. 2) It generates a test that doesn't make sense for us and at best is a wrong test since throwing a NPE is never a good thing ;)
Is it possible to disable generating this type of tests?