Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to ignore tests in command line execution #134

Open
surli opened this issue Mar 6, 2017 · 9 comments
Open

Allow to ignore tests in command line execution #134

surli opened this issue Mar 6, 2017 · 9 comments

Comments

@surli
Copy link
Collaborator

surli commented Mar 6, 2017

No description provided.

@DehengYang
Copy link
Contributor

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!

@tdurieux
Copy link
Contributor

Can you give the output of the execution?

Sometime the fault localization technique takes a lot of time

@DehengYang
Copy link
Contributor

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.

@tdurieux
Copy link
Contributor

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

@DehengYang
Copy link
Contributor

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!

@tdurieux
Copy link
Contributor

tdurieux commented Oct 27, 2017

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

@DehengYang
Copy link
Contributor

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

@DehengYang
Copy link
Contributor

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
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants