EvoSuite / evosuite

EvoSuite - automated generation of JUnit test suites for Java classes
http://www.evosuite.org
GNU Lesser General Public License v3.0
824 stars 341 forks source link

Support target_method functioning for MutationFactory #434

Closed zzctmac closed 1 year ago

zzctmac commented 1 year ago

As shown in the issue, A crash happens when we use the target_method functioning with DynaMOSA. This is because: To implement target_method_list, the developers select the target methods' fitness function in Factory class family, such as branch coverage.

  1. But the developers do not implement this functioning for the Mutation criterion.
  2. As a result, all mutation fitness functions are added to the genetic algorithms.
  3. When the GA is DynaMOSA, it dynamically selects goals by analyzing the dependence relationships among all goals. When DynaMOSA tries to analyze the relationship between branch fitness functions and a mutation fitness function that are not in the target method, the crash happens since branch fitness functions are not added to genetic algorithms.

To fix it, I made a slight change in MutationFactory, following the way of other criterion factories.