The invention relates to the technical field of program repair, in particular to an
executable invariant and differential
signal combined automatic program
repair method, which comprises the following steps of: receiving a to-be-repaired program and a
test set, and calling a large
language model to generate a plurality of candidate patches; forming an entry behavior specification
list according to the repair intention description; generating a plurality of
executable invariant assertions and injecting the
executable invariant assertions into the target function or the calling point, and generating an invariant assertion injection
record table; generating a
test case covering the boundary condition and the abnormal scene based on the large
language model; collecting an execution
signal when the candidate patch is operated; converting the patch difference into semantic editing features, calculating an editing
stability index, and calculating an overall
semantic consistency score of the candidate patches according to the support degree of the standard bar; and calculating an overall comprehensive
score of the candidate patches, and outputting an optimal patch according to the overall comprehensive
score of the candidate patches. According to the method, the proportion of
overfitting patches can be effectively reduced, the patch repairing accuracy is improved, the
interpretability is high, and the universality is good.