You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issue with running jGenprog with bug from defects4j #370
Hello, I’m currently a bit stuck with trying to use jGenprog to fix a bug from defects4j.
I have installed astor and successfully run the jGenprog example code from getting started. (With the following)
cd examples/Math-issue-280 mvn clean compile test -DskipTests # compiling and running bug example cd ../../ java -cp target/astor-*-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ -bintestfolder /target/test-classes/ -location /home/user/astor/examples/Math-issue-280/ -dependencies examples/Math-issue-280/lib
I have also installed and successfully run the defects4j example. I have checked out, compiled and tested using the example code on their git.
Now to the problem. I have checked out and compiled bug 40 from Math in defects4j and stored the bug in /tmp/bug/40/ and when I try to run jGenprog using this the command below, I get following error:
Error: Could not find or load main class fr.inria.main.evolution.AstorMain
I have compiled the bug folder using the compile command in defects4j and mvn clean compile test -DskipTests. Have encountered the same error in both cases.
Does anyone know what might be the issue?
Any advice on how to extract bugs from defects4j and create and verify patches using jGenprog would be appreciated.
Having read "Astor: Exploring the Design Space of Generate-and-Validate Program Repair beyond GenProg," I discovered that there were two implemented navigation strategies for jGenprog: selective and evolution. However, I couldn't find out how to select the evolution strategy as the navigation strategy for jGenprog, neither among the arguments provided here nor using help in the terminal. How does one select the evolution strategy as the navigation strategy for jGenprog?
While examining the implementation of jGenprog, I noticed there was a check to determine if the crossover operation should be applied. Should one change the setting in astor.properties (applyCrossover=true) to make jGenprog apply the crossover operator? Or what is the intended method to make jGenprog apply the crossover operator?
How does one select the evolution strategy as the navigation strategy for jGenprog?
You can implicitly select the strategy by considering more than program variant to evolve (i.e., the population). By default we use one. The population can be controlled with the param population. There are other propertiesfor the evolution strategy that can be configured (e.g. mutationrate).
Since in our experiments we have executed jGenProg in the selective mode (mostly for a matter of scalability), we dont have a clear interface for the evolutionary mode. For that reason, we have not played enough with the crossover functionality.
I open an issue to implement a clear interface for the two modes. Please, feel free to propose a PR of that implementation. (I don't have time for implement it right now, but I can help you).
Thank you for the answer Matias. Would invoking jGenprog with another value for population or mutationrate make jGenprog use evolution strategy and the crossover functionality?
Would it be possible to combine the selective strategy with the crossover functionality? For example by removing the conditional check in jGenprog and directly run ‘applyCrossover’? Would the crossover functionality work the same with selective navigation strategy as it would with evolutionary navigation strategy?
Activity
monperrus commentedon Mar 11, 2024
Fibien commentedon Mar 11, 2024
Thank you, that was the issue.
Having read "Astor: Exploring the Design Space of Generate-and-Validate Program Repair beyond GenProg," I discovered that there were two implemented navigation strategies for jGenprog: selective and evolution. However, I couldn't find out how to select the evolution strategy as the navigation strategy for jGenprog, neither among the arguments provided here nor using help in the terminal. How does one select the evolution strategy as the navigation strategy for jGenprog?
While examining the implementation of jGenprog, I noticed there was a check to determine if the crossover operation should be applied. Should one change the setting in astor.properties (applyCrossover=true) to make jGenprog apply the crossover operator? Or what is the intended method to make jGenprog apply the crossover operator?
Thank you again for the help and the answers.
monperrus commentedon Mar 12, 2024
ping @martinezmatias
martinezmatias commentedon Mar 12, 2024
Hi @Fibien
You can implicitly select the strategy by considering more than program variant to evolve (i.e., the population). By default we use one. The population can be controlled with the param
population. There are other propertiesfor the evolution strategy that can be configured (e.g.mutationrate).Since in our experiments we have executed jGenProg in the selective mode (mostly for a matter of scalability), we dont have a clear interface for the evolutionary mode. For that reason, we have not played enough with the crossover functionality.
I open an issue to implement a clear interface for the two modes. Please, feel free to propose a PR of that implementation. (I don't have time for implement it right now, but I can help you).
Regards
Matias
Fibien commentedon Mar 12, 2024
Thank you for the answer Matias. Would invoking jGenprog with another value for population or mutationrate make jGenprog use evolution strategy and the crossover functionality?
Would it be possible to combine the selective strategy with the crossover functionality? For example by removing the conditional check in jGenprog and directly run ‘applyCrossover’? Would the crossover functionality work the same with selective navigation strategy as it would with evolutionary navigation strategy?
Thanks again for all the help.