10000 GitHub - edward-qin/randoop-grt: Automatic test generation for Java
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

edward-qin/randoop-grt

 
 

Repository files navigation

Fork of Randoop unit test generator for Java

Randoop is a unit test generator for Java. It automatically creates unit tests for your classes, in JUnit format. This fork is focused on the implementation and evaluation of the GRT paper. In particular, it aims to verify the coverage/mutation score and defect detection (via Defects4j) evaluation results from the paper.

Setup

The main repositories used to evaluate GRT are as follows:

  • This repository: A fork of Randoop (with flags to enable GRT techniques)
  • Coverage and Mutation Score: Evaluation of code coverage, branch coverage, and mutation score on 32 open source programs from the original GRT paper
  • Defects4j: A fork of Defects4j, a dataset of known defects found in real open-source programs used in defect detection from the original GRT paper

Note that to contribute to this repository, on some platforms, you need to setup html5validator and modify build. gradle to actually run the command from the source path.

Coverage and Mutation Score Setup

  1. Clone the repository
git clone git@github.com:randoop/grt-testing.git
cd grt-testing
  1. Follow the steps in scripts/mutation-prerequisites.md and scripts/mutation-repro.md
    • You may need to copy the function definitions of usejdk8 and usejdk11 directly into mutation.sh or mutation-all.sh
    • You may need to run the example command with a time limit: ./mutation.sh -vr -t <num_seconds> commons-lang3-3.0
    • Instead of cloning the randoop repository and then removing it, you can instead copy from this fork of randoop.
usejdk11
cd <path_to_root_of_randoop-grt>
./gradlew shadowJar
mv -f build/libs/randoop-all-4.3.3.jar agent/replacecall/build/libs/replacecall-4.3.3.jar
<path_to_grt-testing>/scripts/build
usejdk8

Defects4j Setup

  1. Clone the repository
git clone git@github.com:edward-qin/defects4j-grt.git
cd defects4j-grt
  1. Follow the steps to setup Defects4j
  2. Setup using randoop-grt/scripts/defects4j_README.md from here
    • Skip steps 3-5 (no need to run the scripts from this repository)
  3. Run defects4j-grt/framework/test/test_run_tests.sh -p [Math|Lang|Chart|Time] -t [120|300|600]
    • Output results will live in the /tmp directory

Learn about Randoop:

Directory structure

  • agent - subprojects for Java agents (load-time bytecode rewriting)
  • gradle - the Gradle wrapper directory (Should not be edited)
  • lib - jar files for local copies of libraries not available via Maven
  • scripts - git hook scripts
  • src - source directories for Randoop, including
    • coveredTest - source for JUnit tests of the covered-class Java agent
    • distribution - resource files for creating the distribution zip file
    • docs - documentation, including the manual and resources
    • javadoc - resource files for creating API documentation
    • main - Randoop source code
    • replacecallTest - source for JUnit tests of the replacecall Java agent
    • systemTest - source for Randoop system tests
    • test - source for JUnit tests of Randoop
    • testInput - source for libraries used in Randoop testing

The source directories follow the conventions of the Gradle Java plugin, where each directory has a java subdirectory containing Java source, and, in some cases, a resources subdirectory containing other files.

About

Automatic test generation for Java

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 93.3%
  • HTML 5.1%
  • Other 1.6%
0