Skip to content

Latest commit

 

History

History

utbot-junit-contest

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Contest estimator

Contest estimator runs UnitTestBot on the provided projects and returns the generation statistics such as instruction coverage.

There are two entry points:

  • ContestEstimator.kt is the main entry point. It runs UnitTestBot on the specified projects, calculates statistics for the target classes and projects, and outputs them to a console.
  • StatisticsMonitoring.kt is an additional entry point, which does the same as the previous one but can be configured from a file and dumps the resulting statistics to a file. It is used to monitor and chart statistics nightly.

Key functions

Function name File name Description
runGeneration Contest.kt Runs UnitTestBot and manages its work
runEstimator ContestEstimator.kt Configures a project classpath, runs the main generation loop, and collects statistics

Projects

The projects are provided to Contest estimator in advance.

Structure

All available projects are placed in the resources folder, which contains:

  • projects consisting of the folders with the project JAR files in them.
  • classes consisting of the folders — each named after the project and containing the list file with the fully qualified class names. It also may contain an exceptions file with the description of the expected exceptions, that utbot should find.
    Description is presented in the format: <class fully qualified name>.<method name>: <expected exception fqn> <another fqn> .... For example, see this file.

How to add a new project

You should add both the JAR files to the projects folder and the file with a list of classes to the classes folder.

Statistics

Statistics are collected and memorized by the corresponding classes placed in Statistics.kt. Then monitoring dumps them using auxiliary classes that are defined in MonitoringReport.kt — they describe the format of output data.