|
| 1 | +# Contest estimator |
| 2 | + |
| 3 | +Contest estimator runs UnitTestBot on the provided projects and returns the generation statistics such as instruction coverage. |
| 4 | + |
| 5 | +There are two entry points: |
| 6 | +- [ContestEstimator.kt][ep 1] 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. |
| 7 | +- [StatisticsMonitoring.kt][ep 2] 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. |
| 8 | +It is used to [monitor and chart][monitoring] statistics nightly. |
| 9 | + |
| 10 | + |
| 11 | +[ep 1]: src/main/kotlin/org/utbot/contest/ContestEstimator.kt |
| 12 | +[ep 2]: src/main/kotlin/org/utbot/monitoring/StatisticsMonitoring.kt |
| 13 | +[monitoring]: ../docs/NightStatisticsMonitoring.md |
| 14 | + |
| 15 | +## Key functions |
| 16 | + |
| 17 | +| Function name | File name | Description | |
| 18 | +|---------------|---------------------|----------------------------------------------------------------------------------------| |
| 19 | +| runGeneration | Contest.kt | Runs UnitTestBot and manages its work | |
| 20 | +| runEstimator | ContestEstimator.kt | Configures a project classpath, runs the main generation loop, and collects statistics | |
| 21 | + |
| 22 | + |
| 23 | +## Projects |
| 24 | + |
| 25 | +The projects are provided to Contest estimator in advance. |
| 26 | + |
| 27 | +### Structure |
| 28 | +All available projects are placed in the [resources][resources] folder, which contains: |
| 29 | +- [projects][projects] consisting of the folders with the project JAR files in them. |
| 30 | +- [classes][classes] consisting of the folders — each named after the project and containing the `list` file with the fully qualified class names. |
| 31 | + |
| 32 | +### How to add a new project |
| 33 | +You should add both the JAR files to the `projects` folder and the file with a list of classes to the `classes` folder. |
| 34 | + |
| 35 | +[resources]: src/main/resources |
| 36 | +[projects]: src/main/resources/projects |
| 37 | +[classes]: src/main/resources/classes |
| 38 | + |
| 39 | +## Statistics |
| 40 | +Statistics are collected and memorized by the corresponding classes placed in [Statistics.kt][statistics]. |
| 41 | +Then [monitoring][ep 2] dumps them using auxiliary classes that are defined in [MonitoringReport.kt][report] — they describe the format of output data. |
| 42 | + |
| 43 | +[statistics]: src/main/kotlin/org/utbot/contest/Statistics.kt |
| 44 | +[report]: src/main/kotlin/org/utbot/monitoring/MonitoringReport.kt |
0 commit comments