Toradocu - automated generation of test oracles from Javadoc documentation
Java Shell Python Kotlin
Switch branches/tags
Clone or download
Latest commit fdadc89 Jul 13, 2018
Permalink
Failed to load latest commit information.
doc Update test infrastructure Aug 8, 2017
gradle/wrapper Update Gradle and dependencies version Nov 21, 2017
lib Fix dependences for semantic distance Aug 3, 2017
scripts Move scripts to their own folder Nov 22, 2017
src
stats Change CVS file name to reflect the new name in Toradocu version 0.1 (#… May 10, 2018
tutorial Fix tutorial instructions Jul 13, 2018
.gitignore Remove issta 2018 (it's created on the fly) May 14, 2018
.travis.yml Remove redundant style check Jul 13, 2018
LICENSE.md Update LICENSE.md Nov 23, 2017
README.md Skip shadowJar task when building on Travis Dec 12, 2017
build.gradle Update url of testing target systems source code Jul 13, 2018
clean.sh
git-pre-commit-hook.sh Use Gradle plugin to check code style Jul 13, 2018
gradlew Update Gradle and dependencies version Nov 21, 2017
gradlew.bat Upgrade Gradle version to 4.1 Aug 19, 2017

README.md

Toradocu: automated generation of test oracles from Javadoc documentation

Build Status

Toradocu generates test oracles from the Javadoc documentation of a class. Toradocu is described in the paper Automatic Generation of Oracles for Exceptional Behaviors by Alberto Goffi, Alessandra Gorla, Michael D. Ernst, and Mauro Pezzè (presented at ISSTA 2016).

Toradocu takes the source code of a class as input and produces a set of aspects that can be used as test oracles.

Tutorial

To see how to use Toradocu to automatically add test oracles to your test suite follow the tutorial instructions.

Building Toradocu

To compile Toradocu run the command: ./gradlew shadowJar

This will create the file build/libs/toradocu-1.0-all.jar. The size of file is approximately 1 GB.

Building Toradocu requires Java JDK 1.8+.

Running Toradocu

Toradocu is a command-line tool. The list of all Toradocu command-line options is available on the wiki. To get a list of available command-line parameters, execute

java -jar build/libs/toradocu-1.0-all.jar --help

A typical Toradocu invocation looks like this:

java -jar toradocu-1.0-all.jar \
   --target-class mypackage.MyClass \
   --test-class mypackage.MyTest \
   --source-dir project/src \
   --class-dir project/bin \
   --aspects-output-dir aspects

Using Toradocu Aspects

With those options, Toradocu generates AspectJ aspects in the directory specified with the option --aspects-output-dir. In the aspects output directory, Toradocu places the source code of the aspects and an aop.xml that lists the generated aspects and that is used by the AspectJ compiler.

Aspects generated by Toradocu are standard AspectJ aspects and can be used to instrument an existing test suite. This is done by using the AspectJ compiler to weave the source files under test with the aspects generated by Toradocu.

To augment an existing test suite with Toradocu's oracles you have to:

  1. Generate the aspects with Toradocu.
  2. Compile the generated aspects.
  3. Weave the existing test suites and the system under test.
  4. Run the weaved test suite.

To compile the generated aspects you can use javac. Just be sure that JUnit, the AspectJ weaver, and your system under test are on the classpath.

To weave the existing test suite and the system under test, you can use the AspectJ compiler.

Run the weaved test suite as as you would normally.

Please refer to the AspectJ documentation for more information.

Contributing to Toradocu

Information for contributors can be found on the wiki pages.