MOSA: increase mutation probability
This is, for some reason, part of the EvoSuite implementation.  Could
somebody explain the reasons to me?
@@ -143,12 +143,12 @@ class MOSATestStrategy(TestGenerationStrategy):
continue
# Apply mutation on offspring_1
- offspring_1.mutate()
+ self._mutate(offspring_1)
if offspring_1.has_changed():
offspring_population.append(offspring_1)
# Apply mutation on offspring_2
- offspring_2.mutate()
+ self._mutate(offspring_2)
if offspring_2.has_changed():
offspring_population.append(offspring_2)
@@ -170,6 +170,12 @@ class MOSATestStrategy(TestGenerationStrategy):
self._logger.info("Number of offsprings = %d", len(offspring_population))
return offspring_population
+ @staticmethod
+ def _mutate(offspring: chrom.Chromosome) -> None:
+ offspring.mutate()
+ if not offspring.has_changed():
+ offspring.mutate()
+
def _get_non_dominated_solutions(
self, solutions: List[tcc.TestCaseChromosome]
) -> List[tcc.TestCaseChromosome]:
