JaBUTi command line

De Software testing
Ir para: navegação, pesquisa


  • JaBUTi-CLI is a set of scripts that provides a command line interface to use JaBUTi.


  • The configuration of the JaBUTi-CLI is defined in a .jbt file. This file is a shell script that provides the following information as variables:
    • JABUTI_HOME: Directory where JaBUTi is installed.
    • ORIG_DIR: Directory with the original classes of the software under testing.
    • TEST_SCRIPT: The build.xml (Ant build file) that contains the targets the run the test cases.
    • TEST_SCRIPT_OUT: Directory where the outputs from the execution of the test cases are saved to.
    • TEST_EXEC_CMD: Tha target that run the test cases.
    • SPAGO_DIR: Directory where the SPAGO4Q xml file will be saved to.
    • SPAGO_ID: The project ID, in the SPAGO4Q, of the software under testing.
  • The configuration of the JaBUTi-CLI can define the following optional variables:
    • ORIG_JAR: Jar package with original classes.
    • INSTRUM_JAR: Jar package name that will be generated by instrumentation.
  • Each script of the JaBUTi-CLI has to receive a "-cfg" argument that corresponds to the configuration file (e.g., "jabuti-instrument -cfg example.jbt").


  • Test an application
    1. Analyze the application to be tested and gather the following information:
      • Directory that contains the compiled classes or the filename of the package with the compiled classes.
      • Dependencies of the application (usually Jar packages stored in the lib directory).
      • Directory that contains the test cases.
      • Scrips and commands required to run the test cases.
    2. Instrument the application's classes using jabuti-cli -cfg project.cfg -action instrument.
    3. Execute the test cases using jabuti-cli -cfg project.cfg -action execute.
    4. Analyze the trace files (generated by the instrumented classes when running the test cases) and create a test report of the coverage and metrics of the application under testing. Use the command jabuti-cli -cfg project.cfg -action report.