The CATTO Project

Commit Adaptive Tool for Test Optimization

The Cat that lives in CATTO is a skilled hunter: no test escapes his lasso!


  • Created: 15 June, 2022
  • Update: 5 September, 2022

If you have any questions that are beyond the scope of this guide, Please feel free to email dario.amorosodaragona@tuni.fi.


What is it

A tool for Test Case Optimization. CATTO selects the tests to execute based on the changes performed in the code between two commits. When the user commits the project CATTO analyzes the source code and identifies the change between the version of the project that the user is committing and the version of the project at the previous commit. CATTO identifies and uses these informations to select and execute the tests that cover these changes.


Requirements

To use CATTO you need:

  1. Java 8
  2. Intellij IDEA (v.2021.2 - 2022.2)
  3. Catto supports project using all version of Java until Java 8

We are working to upgrade our tool. Soon wiil be possible to use CATTO on every Java project


Installation and Setup

Follow the steps below to setup the CATTO plugin:

  1. Install a compatible JetBrains IDE, such as IntelliJ IDEA, CLion, PyCharm, or other IntelliJ-based IDEs.
  2. Launch the IDE and open plugin settings
  3. Search for "CATTO" and click install or download Catto from Jetbrains marketplace and install it from disk
  4. Wait for the initialization of the plugin, in this phase the plugin creates some folders, please do not delete/modify them.
  5. The plugin creates a config.yaml file. To start using CATTO please configure it as follow:
    •  #defines the absolute output path of the built project (the place where Intellij saves the .class files), 
       #please for each line specify the production path and the test path. You can easily find this path in the project settings.
       outputPath:
       - /Users/ncdaam/IdeaProjects/demo/out/production/demo
       - /Users/ncdaam/IdeaProjects/demo/out/test/demo
                    
       #CATTO to work needs JAVA 1.8 installed. Please put here, one per line, the absolute path of the jce.jar and rt.jar 
       #contained in the JAVA 1.8 installation folder.
       #Then insert also the absolute path of the folder that contains the external libraries used in your project.
       dependencies:
       - /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/jce.jar
       - /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/rt.jar
       - /Users/ncdaam/IdeaProjects/demo/lib
                     
       #this is a relative path of a temporary folder. the default value is ".tmp".
       tempFolderPath: .tmp
       
       
  6. Start to modify your code and commit safely.

Source Code

The CATTO project is composed by two components:

  1. Catto Intellij Idea Plugin: this code wraps the Catto features in Intellij Idea Environment
  2. Catto Core: the core of the project. Catto Core is responsable of the analysis of the code, the selction and the eectution of the tests. This compoents strictly depends on Soot

Demo Video

A quick demo on how CATTO can upgrade your programming workflow!