Tritlo / PropR

Genetic program repair using GHC
MIT License
30 stars 2 forks source link

Cleanup & Shrinking Action #12

Closed lapplislazuli closed 3 years ago

lapplislazuli commented 3 years ago

Summary

After a (successful) patch is found, try to shrink it by removing pieces of the patch. Return the minimal patch that still fulfills all properties.

Reasoning

In EvoSuite, which is Test-Case Generation, they try to add statements in a test to reach higher coverage. Results showed that while it worked (great actually), the generated tests where a) unreadable and b) too big with dead code. Or, well not dead-dead but atleast not necessary for the statements that increased coverage.

So after they found a Test, they simply try whether any statement can be safely removed while still giving the same metrics.

Important: They do this AFTER all evolutionary parts. During the evolution the code is not cleaned in that way. For us it should be somewhere between finding the solution and pretty printing it.

lapplislazuli commented 3 years ago

Introduced in #11 and in particular in 7dfa285 but not used yet.

lapplislazuli commented 3 years ago

I think before we close this issue we should add a Timeout to minimization process.

While I think that most pieces will be cached (as our patches grow "organically"), it is something to be considered especially when we have patches of 10 elements, the superset is 10! elements. Optionally we can try different approaches of iterations, which always try to remove one element, re-run fitness and if successful try to remove one more.