Note: This page describes EzUnit Version 4, which is very different from the original version, EzUnit Version 1.
to link JUnit test failures to locations in source code; to report logical errors analogously to compiler-generated errors and warnings
When the Eclipse compiler discovers an error (syntax error or semantic, i.e., typing, error), the IDE displays a description of the error (text associated with violated compiler rule) and the source location where it is assumed to have occured in the Problems View, allowing direct navigation to the (most likely) cause of the error. By contrast, when JUnit discovers a unit test failure (indicating a logical error in the program), it displays the name of the failed test case, leaving the task of localizing the cause of the failure to the programmer. EzUnit is a framework that offers an extension point for so called fault locators, methods to predict locations of logical errors in source code based on information gathered from the tested program and its test cases.
Given a Java project with JUnit tests that fail,
Remark: If EzUnit shall be used with Windows 7, the Eclipse environment might possibly be run as admin to ensure its functionality.
Potentially faulty source locations (methods) are displayed, ranked according to their computed likelihood of failure. By double-clicking on an entry, the corresponding source location is shown in the editor. <Was ist mit Location -1?> The results of each individual fault locator can be obtained by clicking the yellow (T) in the tab pane (right; see above).
Not all present fault locators need be queried for fault localization, and not all queried fault locators need be given the same weight.
The Weigth column specifies the given linear weight of the fault locator relative to the others. <Wie bekomme ich die Properties?> Inactive fault locators are not considered. <Wie unterscheidet sich inactive von Weight = 0?> Note that certain fault locators are capable of computing their own, individual weight (based on the strength of the evidence they rely on), which is combined with the given weight.
The possible fault locations are usually restricted to methods called by one or more failed unit tests. To get a quick overview of all methods called by a test case, EzUnit provides an optional call graph view. It requires the prior installation of Zest (see Installation).
Each node has a tooltip showing some tracing information. Double clicking opens the corresponding method in the editor. <Was ist mit der Schachtelungstiefe?>
To constrain the possible fault locations to code from selected sources, open the preferences/properties page:
<fehlt; hier sollte es auch möglich sein, Preferences mit Project-Properties zu überschreiben>
<fehlt, Marker sollten rot sein.>
EzUnit does not rely on a fixed set of fault locators rather, it provides an extension point for including as many different fault locators as desired. The result of each activated fault locator is combined with that of the others to provide a joint error diagnosis.
EzUnit also provides an extension point for computing the minimum number of contained errors and the set of MUTs to which each error can be confined (called an error circle). <Each fault locator is then evaluated for each error circle separately.???>
The following list of fault locator plugins is included with the standard update of EzUnit:
New fault locators can be added by writing a new fault locator plugin for the extension point desribed here <eigene Seite> and copying it into Eclipse's plugin directory <reicht das?>.
Currently, EzUnit ships with one plugin to compute error circles:
New pluigns to compute error circles can be added by implementing the extension point described <here>.
To collect information from test execution, EzUnit uses the open source Java profiler JIP. It is automatically installed when installing EzUnit.
EzUnit configures JIP to trace the execution of every test case (currently only the methods called) and to report the trace to the EzUnit plugin.
For the installation of EzUnit, use its update site http://www.fernuni-hagen.de/ps/prjs/EzUnit4/update/. The following updates are available from this site:
Work on fault location is currently prospering. Tarantula is perhaps the best know fault locator tool. However, it is a standalone tool and currently available only for C source code.