nopol icon indicating copy to clipboard operation
nopol copied to clipboard

Allow to ignore tests in command line execution

Open surli opened this issue 7 years ago • 9 comments

surli avatar Mar 06 '17 15:03 surli

Is that right? When I tried the Nopol repairing command without test parameter, the whole execution stops at the step of running tests and does not generate patches. I guess the Nopol will put much time in running all tests (may be more than 1000 if we don't enter the "--test" parameter ) and thus will give no output. So it does not work on my computer without "test" parameter. Hope somebody can give an explanation.

Thanks!

DehengYang avatar Oct 27 '17 03:10 DehengYang

Can you give the output of the execution?

Sometime the fault localization technique takes a lot of time

tdurieux avatar Oct 27 '17 10:10 tdurieux

Math_28_0.txt

The output file records the information that Nopol repaires Math_28 buggy program without "test" parameter. It seems that Nopol execution stops at the step of testing. When I add the test parameter, a valid patch can be obtained by Nopol.

DehengYang avatar Oct 27 '17 10:10 DehengYang

Can you try to run nopol with those parameters:

export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8;
TZ="America/New_York"; 
export TZ;
export PATH="/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/:$PATH";
java -d64 -Xmx4g -Xms1g -XX:MaxPermSize=1024m -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled \
-cp nopol.jar:/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/../lib/tools.jar \
fr.inria.lille.repair.Main \
--flocal gzoltar  \
--maxTime 300  \
--json  \
--mode repair \
--type pre_then_cond \
--oracle angelic \
--solver z3 \
--solver-path z3 \
--complianceLevel 5 \
--source math_28/src/main/java/ \
--classpath math_28/target/classes/:math_28/target/test-classes/:math_28/lib/commons-discovery-0.5.jar:nopol.jar

tdurieux avatar Oct 27 '17 11:10 tdurieux

Thank you so much for your great help. And sorry for my late reply. I runned the Nopol with your parameters successfully without "tests" as a parameter. But I am still confused about what is the function of the codes: export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8; TZ="America/New_York"; export TZ; export PATH="/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/:$PATH"; java -d64 -Xmx4g -Xms1g -XX:MaxPermSize=1024m -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled \

When I compare my command which has "test" parameter with your command, it seems that the codes above can replace the "test" parameter to repair buggy programs. Why should we add these long parameters?

Much appreciated. Have a nice weekend!

DehengYang avatar Oct 27 '17 14:10 DehengYang

export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8; it is for weird encoding in defects4j, I don't remember for which bug I set this up

TZ="America/New_York"; some tests are only failing in a specific timezone (for the time project)

export PATH="/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/:$PATH"; it is for internal useage of my runner, you can remove it

-d64 force jvm in 64bits, it allows me to give more than 3G of memory to the jvm

-Xmx4g -Xms1g -XX:MaxPermSize=1024m gives more memory to the jvm, I think it is the actual fix of your problem

-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled changes the behavior of the garbage collector, to improve the performance

In general, automatic repair technique consume a lot of memory, give them as much memory as you can

tdurieux avatar Oct 27 '17 15:10 tdurieux

Thank you! I really learned a lot from your patient guidance and continuous help. Thanks a lot!

DehengYang avatar Oct 31 '17 00:10 DehengYang

I still have some questions and new findings about Nopol's repairing defects4j programs, Mr Durieux. I found that your command to run nopol without "test" parameter include all test classes ( such as the 27870 test cases in Math_24) can generate valid patches. However, the nopol command with "test" parameter in cannot generate valid patch, as the command just include failing test classes (for example, only 1 failing test classe and 9 test cases in Math_24), the patch generated by which will just repair this failing test but result in other failing tests at the same time. So I think the command in needs some modifications.

Also, I find that your command: export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8; TZ="America/New_York"; export TZ; export PATH="/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/:$PATH"; java -d64 -Xmx4g -Xms1g -XX:MaxPermSize=1024m -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled \ -cp nopol.jar:/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/../lib/tools.jar \ fr.inria.lille.repair.Main \ --flocal gzoltar \ --maxTime 300 \ --json \ --mode repair \ --type pre_then_cond \ --oracle angelic \ --solver z3 \ --solver-path z3 \ --complianceLevel 5 \ --source math_28/src/main/java/ \ --classpath math_28/target/classes/:math_28/target/test-classes/:math_28/lib/commons-discovery-0.5.jar:nopol.jar

When I change the --flocal gzoltar into --flocal ochiai or --flocal dumb, the error occurs:

ochiai_fault_alltestcases

I cannot find the reason why it fails. Thanks.

DehengYang avatar Oct 31 '17 02:10 DehengYang

Sorry for that the website link cannot be displayed in the last comment, so I would like to add as follow: I still have some questions and new findings about Nopol's repairing defects4j programs, Mr Durieux. I found that your command to run nopol without "test" parameter include all test classes ( such as the 27870 test cases in Math_24) can generate valid patches. However, the nopol command with "test" parameter in "https://github.com/SpoonLabs/nopol/blob/master/.travis_run_defects4j.sh" cannot generate valid patch, as the command just include failing test classes (for example, only 1 failing test classe and 9 test cases in Math_24), the patch generated by which will just repair this failing test but result in other failing tests at the same time. So I think the command in "https://github.com/SpoonLabs/nopol/blob/master/.travis_run_defects4j.sh" needs some modifications.

Thanks!

DehengYang avatar Oct 31 '17 02:10 DehengYang