ASTGen: Automated Testing of Refactoring Engines

Welcome to the ASTGen Project home page. ASTGen is an imperative, iterative, composable and generic test data generation framework used to create abstract syntax trees. It can be used to test many applications that take programs as input. We have applied it to testing the Eclipse and NetBeans refactoring engines.

Publications

Automated Testing of Refactoring Engines

Brett Daniel, Danny Dig, Kely Garcia, Darko Marinov.
In ESEC/FSE 2007: 6th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering
Dubrovnik, Croatia, September 2007.

Reducing the costs of bounded-exhaustive testing

Vilas Jagannath, Yun Young Lee, Brett Daniel, Darko Marinov.
In FASE 2009: Fundamental Approaches to Software Engineering
York, UK, March 2009.

Downloads

The following table contains source and binary downloads for the ASTGen projects. Compilation instructions and licenses are bundled with the download.

Version Source Compiled JARs Description
0.2 atre-0.2-projects.zip atre-0.2-jars.zip Fixed bugs and updated to use TestOrrery generators
0.1 atre-0.1-projects.zip Initial publication version

Supplemental Information

Results

The following links show the reports for all bugs that ASTGen found.

Eclipse Bugs

NetBeans Bugs

Generator List

The following list describes each of the complex generators used in the paper.

FieldReference
Generates many classes. Each class contains a field and a method that references the field in some way.
ClassRelationship
Generates pairs of classes that are related by inheritance, reference, or containment.
DoubleClassFieldReference
Generates pairs of classes related in some way. One class declares a field and the other references it in some way.
MethodReference
Generates many classes with two methods. One method calls the other and may overload it.
MethodParamReference
Generates method declarations, each of which has a parameter referenced.
ClassArrayField
Generates classes, each of which declares a field of some array type.
SingleClassTwoFields
Generates classes, each of which declares two fields. One field references the other in its initialization.
DoubleClassGetterSetter
Generates pairs of classes in an inheritance relationship. The superclass declares a field; either class declares a getter or setter for the field. The superclass declares a main method that references the getter or setter.
DoubleClassParentField
Generates pairs of classes in an inheritance relationship. The superclass declares a field. Either class declares another field that references the first in its initializer.
DoubleClassParentMethod
Generates pairs of classes in an inheritance relationship. The superclass declares a field; the subclass declares a method that optionally references the field. Either class declares a second method that references the first method.
DoubleClassChildField
Generates pairs of classes in a inheritance relationship. The superclass declares a field, and the subclass declares another field that optionally references the first in its initializer.
DoubleClassChildMethod
Generates pairs of classes in a inheritance relationship. The superclass declares a field and the subclass declares two methods. One method optionally references the field and the second method references the first method.
TripleClassChildField
Generates triplets of classes such that two of them have an inheritance relationship. The subclass declares a field that references another field declared in either of the other classes.
TripleClassChildMethod
Generates triples of classes such that two of them have a inheritance relationship. The subclass declares two methods. The first method references a field declared in one of the other two classes and the second method references the first method.

Experimental Data

This directory tree contains our raw experimental data. The tree has the following structure:

/<refactoring>/<generator>.zip/<generator>/test<#>/(in|out|outNB)/

The "in" directory contains the generated input file(s); "out" contains the result of the refactoring in Eclipse; and "outNB" contains the result of the refactoring in NetBeans (when applicable).

In addition, an "out" directory contains one of the following result files. Note that "outNB" does not contain analogous files because we used the reports built in to NetBeans' testing framework.

Result File Meaning Contents
PRE_REFACTOR_NOT_COMPILE Input program does not compile. Test is ignored. Compilation errors
REFACTORING_INAPPLICABLE The refactoring cannot be performed on the input file. Error messages from the IDE explaining why the refactoring could not be applied
REFACTORING_EXECUTION_ERROR The IDE crashed or could not complete refactoring. Error messages from the IDE
POST_REFACTOR_NOT_COMPILE The refactored program does not compile. Compilation errors
POSTCONDITION_FAILURE The refactored program does not satisfy custom or inverse oracles. Reasons why the program does not satisfy the oracles
SUCCESSFUL_REFACTORING The refactoring completed successfully.