At least in MonotonicGA, the algorithm does something like this
double bestFitnessBeforeEvolution = getBestFitness();
evolve();
sortPopulation();
double bestFitnessAfterEvolution = getBestFitness();
//check that the best fitness after evolution is the same or better than the one before evolution
Suggestion
The issue is that if we use a fitness that has dynamic goals (goals are discovered during test generation) then the comparison is checking incomparable states. I suggest changing the code to
T bestCandidateBeforeEvolution = getBestCandidate();
evolve();
sortPopulation();
double bestFitnessBeforeEvolution = getBestFitness(bestCandidateBeforeEvolution);
double bestFitnessAfterEvolution = getBestFitness();
//check that the best fitness after evolution is the same or better than the one before evolution
This code should be semantically equivalent for any fitness with static goals, but it would also support those with dynamic goals
Context
At least in MonotonicGA, the algorithm does something like this
Suggestion
The issue is that if we use a fitness that has dynamic goals (goals are discovered during test generation) then the comparison is checking incomparable states. I suggest changing the code to
This code should be semantically equivalent for any fitness with static goals, but it would also support those with dynamic goals