Skip to content

Commit e4fd552

Browse files
authored
Contest estimator design-doc (#1428)
1 parent dd5179b commit e4fd552

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

docs/OverallArchitecture.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,17 @@ TODO (Nikita Stroganov)
129129
TODO (Nikita Stroganov)
130130

131131
### Contest estimator
132+
Contest estimator runs UnitTestBot on the provided projects and returns the generation statistics such as instruction coverage.
132133

133-
TODO (Rustam Sadykov)
134+
Contest estimator is placed in the [utbot-junit-contest][contest estimator 1] module and has two entry points:
135+
- [ContestEstimator.kt][contest estimator 2] 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.
136+
- [StatisticsMonitoring.kt][contest estimator 3] 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.
137+
It is used to [monitor and chart][contest estimator 4] statistics nightly.
134138

139+
[contest estimator 1]: ../utbot-junit-contest
140+
[contest estimator 2]: ../utbot-junit-contest/src/main/kotlin/org/utbot/contest/ContestEstimator.kt
141+
[contest estimator 3]: ../utbot-junit-contest/src/main/kotlin/org/utbot/monitoring/StatisticsMonitoring.kt
142+
[contest estimator 4]: NightStatisticsMonitoring.md
135143

136144
# Components
137145

utbot-junit-contest/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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

Comments
 (0)