Skip to content

Commit 62a55a6

Browse files
authored
UTBot Java architecture - first version. (#1403)
UTBot Java overall architecture - fist version.
1 parent 04c85da commit 62a55a6

File tree

1 file changed

+179
-0
lines changed

1 file changed

+179
-0
lines changed

docs/OverallArchitecture.md

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# Overall Unit Test Bot Architecture
2+
3+
Unit Test Bot overall architecture can be presented as following bird-eye view. Look below to check each component's purpose.
4+
5+
```mermaid
6+
flowchart TB
7+
subgraph Clients
8+
direction LR
9+
IntellijPlugin
10+
MavenPlugin["Maven/Gradle plugins"]
11+
GithubAction-->MavenPlugin
12+
ExternalJavaClient[\External Java Client\]
13+
CLI
14+
ContestEstimator
15+
16+
end
17+
18+
subgraph Facades
19+
direction LR
20+
EngineMain[[EngineMain]]
21+
UtBotJavaApi[[UtBotJavaApi]]
22+
GenerateTestsAndSarifReport[[GenerateTestsAndSarifReport]]
23+
end
24+
IntellijPlugin--RD-->EngineMain
25+
MavenPlugin-->GenerateTestsAndSarifReport
26+
ExternalJavaClient-->UtBotJavaApi
27+
28+
subgraph API["Generation API"]
29+
direction LR
30+
TestCaseGenerator[[TestCaseGenerator]]
31+
CodeGenerator[[CodeGenerator]]
32+
end
33+
Facades-->API
34+
CLI-->API
35+
ContestEstimator-->API
36+
37+
38+
39+
subgraph Components
40+
direction LR
41+
SymbolicEngine-->jlearch
42+
SymbolicEngine-->ConcreteExecutor
43+
Fuzzer-->ConcreteExecutor
44+
SarifReport
45+
Minimizer
46+
CodeRenderer
47+
Summaries
48+
jlearch
49+
end
50+
CodeGenerator-->CodeRenderer
51+
TestCaseGenerator-->SymbolicEngine
52+
TestCaseGenerator-->Fuzzer
53+
TestCaseGenerator-->Minimizer
54+
TestCaseGenerator-->Summaries
55+
GenerateTestsAndSarifReport-->SarifReport
56+
57+
UTSettings((UTSettings))
58+
UTSettings<--RD/local-->Components
59+
UTSettings<---->Clients
60+
TestCaseGenerator--warmup-->ConcreteExecutor
61+
ConcreteExecutor--RD-->InstrumentedProcess
62+
63+
```
64+
65+
## Typical interraction between components
66+
67+
Interaction diagram started from Intellij plugin UI is presented below
68+
```mermaid
69+
sequenceDiagram
70+
autonumber
71+
actor user as User
72+
participant ij as Intellij plugin
73+
participant engine as Engine process
74+
participant concrete as Instrumented process
75+
76+
user ->> ij: Invoke "Generate tests with UTBot"
77+
ij ->> ij: Calculate methods, framework to show
78+
ij ->> user: Show UI
79+
80+
break user clicked "Cancel"
81+
user -->> user: Exit
82+
end
83+
user ->> ij: Click "Generate tests"
84+
ij ->> ij: Calculate what jar need to be installed
85+
86+
opt Some jars need to be installed
87+
ij ->> user: Do you accept new jars installed?
88+
user -->> ij: [Accept/reject]
89+
90+
alt Accepted
91+
ij ->> ij: Install jars
92+
end
93+
end
94+
95+
ij ->> engine: Start process
96+
activate engine
97+
ij ->> engine: Setup ut context
98+
99+
loop For all files
100+
ij ->> engine: Generate UtExecutions
101+
loop for all UtExecutions for method found by engine
102+
engine ->> concrete: Run concretely
103+
end
104+
engine --> engine: Minimize all tests for method
105+
engine --> engine: Summaries for method
106+
end
107+
ij ->> engine: Render code
108+
engine ->> ij: File with tests
109+
deactivate engine
110+
111+
112+
```
113+
114+
# Clients
115+
116+
### Intellij plugin
117+
> Module: [utbot-intellij](https://github.com/UnitTestBot/UTBotJava/tree/main/utbot-intellij)
118+
>
119+
> Purpose: UI interface for Java/Kotlin users
120+
121+
122+
TODO (Vassily Kudryashov)
123+
124+
### Maven/gradle plugin
125+
126+
TODO (Nikita Stroganov)
127+
128+
### Github action
129+
130+
TODO (Nikita Stroganov)
131+
132+
### CLI
133+
134+
TODO (Nikita Stroganov)
135+
136+
### Contest estimator
137+
138+
TODO (Rustam Sadykov)
139+
140+
141+
# Components
142+
143+
### Symbolic engine
144+
TODO (Alexey Menshutin)
145+
146+
### Concrete executor
147+
TODO (Sergey Pospelov)
148+
149+
### Instrumented process
150+
TODO (Rustam Sadykov)
151+
152+
### Code renderer
153+
TODO (Egor Kulikov)
154+
155+
### Fuzzer
156+
TODO (Maxim Pelevin)
157+
158+
### Minimizer
159+
TODO (Sergey Pospelov)
160+
161+
### Summaries
162+
TODO (Alexey Zinoviev)
163+
164+
### Sarif report
165+
TODO (Nikita Stroganov)
166+
167+
168+
169+
# Cross-cutting subsystems
170+
171+
### Logging
172+
TODO (Arteniy Kononov)
173+
174+
### RD
175+
TODO (Arteniy Kononov)
176+
177+
### UTSettings
178+
TODO (Vassily Kudryashov)
179+

0 commit comments

Comments
 (0)