MCPcopy Index your code
hub / github.com/albertogoffi/toradocu

github.com/albertogoffi/toradocu @v3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.0 ↗ · + Follow
952 symbols 2,881 edges 128 files 389 documented · 41% updated 2y agov3.0 · 2018-06-08★ 4436 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.

Extension points exported contracts — how you extend this code

PreprocessingPhase (Interface)
(no doc) [23 implementers]
src/main/java/org/toradocu/translator/preprocess/PreprocessingPhase.java
Builder (Interface)
This interface specifies that the implementing class is a builder for other class objects. @param the type of objec
src/main/java/org/toradocu/util/Builder.java

Core symbols most depended-on inside this repo

add
called by 168
src/main/java/org/toradocu/translator/PropositionSeries.java
isEmpty
called by 98
src/main/java/org/toradocu/translator/PropositionSeries.java
contains
called by 63
src/main/java/org/toradocu/translator/PropositionSeries.java
equals
called by 62
src/main/java/org/toradocu/translator/Subject.java
toString
called by 62
src/main/java/org/toradocu/translator/Subject.java
getName
called by 55
src/main/java/org/toradocu/output/util/Parameter.java
getText
called by 44
src/main/java/org/toradocu/extractor/Comment.java
getClass
called by 44
src/main/java/org/toradocu/util/Reflection.java

Shape

Method 822
Class 119
Function 5
Enum 4
Interface 2

Languages

Java99%
Kotlin1%
Python1%

Modules by API surface

src/test/java/org/toradocu/accuracy/paper/AccuracyCommonsMath3.java54 symbols
src/test/java/org/toradocu/accuracy/AccuracyCommonsMath3.java54 symbols
src/main/java/org/toradocu/extractor/DocumentedExecutable.java25 symbols
src/test/java/org/toradocu/util/old/GoalFileConverterTest.java22 symbols
src/test/java/org/toradocu/accuracy/paper/AccuracyCommonsCollections4.java22 symbols
src/test/java/org/toradocu/accuracy/AccuracyGuava19.java22 symbols
src/test/java/org/toradocu/accuracy/AccuracyCommonsCollections4.java22 symbols
src/main/java/org/toradocu/extractor/JavadocExtractor.java22 symbols
src/main/java/org/toradocu/conf/Configuration.java22 symbols
src/test/java/org/toradocu/accuracy/paper/AccuracyGuava19.java21 symbols
src/test/resources/example/AClass.java19 symbols
src/test/java/org/toradocu/translator/PropositionSeriesTest.java17 symbols

For agents

$ claude mcp add toradocu \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact