Fitness Function Using Postconditions for Automated Program Repair
Yusaku Ito, Hironori Washizaki, Yoshiaki Fukazawa · 2023
Genetic algorithm-based automated program repair has the challenge that execution time tends to be extremely long. One of the causes is the low adequacy of the fitness, which represents the evaluation of program variants. To improve the efficiency of automated repair, we propose a new fitness function that uses the state of internal variables of the program in addition to the results of test runs. First, candidate specifications are randomly generated using variables in the program. Next, the correct specification is automatically estimated from the candidates, thus making the granularity of the fitness function more fine-grained. Experimental results with small programs show that the proposed method extracts the postcondition of the program appropriately in most cases. On the other hand, experiments with the Defects4J Math dataset suggest that the proposed method does not necessarily improve the efficiency of automated repair and may reduce the diversity of generated variants.