De Software testing
- JaBUTi is designed to support test set adequacy evaluation and to provide guidance in test case selection. <bibref>vincenzi-etal:2003, 18</bibref>
- JaBUTi works with the bytecode, thus not requiring the source code of the application to perform its activities. <bibref>vincenzi-etal:2003</bibref>
- JaBUTi is composed by a coverage analysis tool, a slicing tool, and a complexity measure tool. <bibref>vincenzi-etal:2003</bibref>
- JaBUTi architecture is comprised of program representation, instrumentation, trace collector, test case management, visualization, and report components.
- JaBUTi can be found at http://incubadora.fapesp.br/projects/jabuti and at http://ccsl.ime.usp.br/en/project/jabuti. <bibref>vincenzi-etal:slides:2007</bibref>
- JaBUTi requires some thirdy-party libraries: BCEL, ILOG JViews, Crimson, and JUnit. <bibref>vincenzi-etal:2003, 4</bibref>
- The test requirements in JaBUTi can be of the following types: active, inactive, covered, feasible, infeasible.
- Invoke JaBUTi's graphical interface.
- Supposing that JaBUTi is installed on ~/Tools/jabuti and the user's current directory is ~/Tools/jabuti, the following command causes the invocation of its graphical interface: java -cp ".;lib/BCEL.jar:lib/jviewsall.jar:lib/crimson.jar;lib/junit.jar" br.jabuti.gui.JabutiGUI
- Create a new project [script]
- Select a base Java class file from File/Open Class menu. A dialog window, as illustrated in Arquivo:JaBUTi Open Class dialog.png, appears.
- From this dialog window, select the directory where the base Java class file is located and then select the base Java class file itself, as ilustrated in Arquivo:JaBUTi Open Class dialog - base Java class selected.png.
- Once the base Java class file is selected, the tool automatically identifies the package that it belongs (if any) and fills out the Package field with the package’s name. The Classpath should contains only the path necessary to run the selected base class, as illustrated in Arquivo:JaBUTi Open Class dialog - base Java class information specified.png.
- Click the Open button. The Project Manager dialog is shown, as illustrated in Arquivo:JaBUTi Project Manager dialog.png.
- From the Project Manager dialog, select the Java class files that will be tested. At least one class file must be selected.
- Give a name to the project being created by clicking on the Select button. By clicking on the Ok button, JaBUTi creates a new project, constructs the DUG for each method of each class under testing, derives the complete set of testing requirements for each criterion, calculates the weight of each testing requirement, and presents the bytecode of a given class under testing.
- Import JUnit test set (<bibref>vincenzi-etal:2003, 22</bibref>) script
- Once compiled, a JUnit test case can be imported by JaBUTi from the Test Case ! Import from JUnit menu option. A dialog, as illustrated in Arquivo:JaBUTi Import from JUnit dialog.png, will be shown. The fields to be entered are:
- Path to application: automatically filled by JaBUTi.
- Path to JUnit test suite source/binary code: if you followed the manual it should be your current path; otherwise it’s the path to your application’s source and binary codes.
- Test suite full qualified name: the full name of the JUnit test which will be used.
- JaBUTi’s library: the .jar used to run JaBUTi.
- Other application specific libraries: other libraries your application may need.
- javac: full path to your java compiler.
- Trace file name: automatically filled by JaBUTi.
- Instrument a class using the command line tool:
- Set the environment variable JABUTI_HOME:
$ export JABUTI_HOME=/home/auri/workspace/Jabuti
- Run the prober:
$ java -Xmx512M -cp $JABUTI_HOME/bin:$JABUTI_HOME/lib/bcel-5.2.jar:../classes/:. br.jabuti.probe.ProberInstrum -jar your_package.jar -o your_package-instr.jar
- Test the instrumented classes using the command line tool:
- Set up the environment variable BATCH_MODE.
$ export BATCH_MODE=""
- Organize the instrument classes.
- The package generated by JaBUTi contains only the class files. If the original package (passed as parameter in step 1.1) contains other types of files, these files have to be manually added in the package generated by JaBUTi;
- If the tests search for the class files in a specific folder, the package generated by JaBUTi have to be uncompressed in this folder, replacing the non instrumented files;
- If the tests of application use the original jar package, switch the jar package name generated by JaBUTi by this name;
- Sometimes is possible to use a property of ant to configure to test the classes/package instrumented without any modification.
- Collect test data:
- List every class that have been tested and save the filenames to a file (file which will be used by the script Arquivo:Test-session.sh). You my use the script Arquivo:List-classes.sh, as follows:
$ ./list-classes.sh <the .class files directory> classes.txt
- Generate the report for the listed files. Use the Arquivo:Test-session.sh script, as follows:
- Collect measures for the application under testing: