From a073ba627f96bba3c76396dfbe80e731fa70917c Mon Sep 17 00:00:00 2001 From: Olga Naumenko <64418523+olganaumenko@users.noreply.github.com> Date: Wed, 21 Dec 2022 18:54:16 +0300 Subject: [PATCH 1/3] Typo fixed --- docs/CodeGenerationAndRendering.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CodeGenerationAndRendering.md b/docs/CodeGenerationAndRendering.md index 6e87166274..56578af438 100644 --- a/docs/CodeGenerationAndRendering.md +++ b/docs/CodeGenerationAndRendering.md @@ -1,6 +1,6 @@ # Code generation and rendering -Code generation and rendering is a part of test generation process in UnitTestBot (find the overall picture in the +Code generation and rendering are a part of test generation process in UnitTestBot (find the overall picture in the [UnitTestBot architecture overview](https://github.com/UnitTestBot/UTBotJava/blob/main/docs/OverallArchitecture.md)). UnitTestBot gets the synthetic representation of generated test cases from the fuzzer or the symbolic engine. This representation, or model, is From ae5112e78f02a46da5b3f6b16de9f9e4b4fcb296 Mon Sep 17 00:00:00 2001 From: Olga Naumenko <64418523+olganaumenko@users.noreply.github.com> Date: Thu, 22 Dec 2022 11:54:06 +0300 Subject: [PATCH 2/3] Typos fixed --- docs/CodeGenerationAndRendering.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/CodeGenerationAndRendering.md b/docs/CodeGenerationAndRendering.md index 56578af438..6b43e23eea 100644 --- a/docs/CodeGenerationAndRendering.md +++ b/docs/CodeGenerationAndRendering.md @@ -1,10 +1,10 @@ # Code generation and rendering -Code generation and rendering are a part of test generation process in UnitTestBot (find the overall picture in the +Code generation and rendering are a part of the test generation process in UnitTestBot (find the overall picture in the [UnitTestBot architecture overview](https://github.com/UnitTestBot/UTBotJava/blob/main/docs/OverallArchitecture.md)). -UnitTestBot gets the synthetic representation of generated test cases from the fuzzer or the symbolic engine. This representation, or model, is -implemented in the `UtExecution` class. +UnitTestBot gets the synthetic representation of generated test cases from the fuzzer or the symbolic engine. +This representation (or model) is implemented in the `UtExecution` class. The `codegen` module generates the real test code based on this `UtExecution` model and renders it in a human-readable form in accordance with the requested configuration (considering programming language, testing @@ -213,7 +213,7 @@ The further AST levels are created similarly. The AST leaves are `CgLiteral`, `C The below-mentioned functionality is implemented in `CgMethodConstructor`. To create a test method: -* store the initial values of the static fields and perform the seven steps for creating test method body mentioned later, +* store the initial values of the static fields and perform the seven steps for creating test method body mentioned later; * if the static field values undergo changes, perform these seven steps in the `try` block and recover these values in the `finally` block accordingly. To create test method body: @@ -225,14 +225,14 @@ To create test method body: 6. generate result assertions 7. for successful tests, generate field state assertions -_Note:_ generating assertions has pitfalls. In primitive cases like comparing two integers, we can use the standard +_Note:_ generating assertions has pitfalls. In primitive cases, like comparing two integers, we can use the standard assertions of a selected test framework. To compare two objects of an arbitrary type, we need a custom implementation of equality assertion, e.g. using `deepEquals()`. The `deepEquals()` method compares object structures field by field. The method is recursive: if the current field is not of the primitive type, we call `deepEquals()` for this field. The maximum recursion depth is limited. For the parameterized tests -- we do not support mocking, so we do not set up the initial environment, +- we do not support mocking, so we do not set up the initial environment; - we do not generate field state assertions. `UtExecution` usually represents a single test scenario, and one `UtExecution` instance is used to create a single @@ -256,7 +256,7 @@ From the group of `UtExecution` elements, we take the first successful execution ## Renderer -We have a general approach for rendering the code of test classes. `UtUtils` class is rendered differently: we +We have a general approach for rendering the code of test classes. `UtUtils` class is rendered differently: we hardcode the required method implementations for the specific code generation language. All the renderers implement `CgVisitor` interface. It has a separate `visit()` method for each supported @@ -284,7 +284,7 @@ While constructing the test class, we create test generation reports. It contain number of generated tests, the number of successful tests, etc. It also may contain information on potential problems like trying to use mocks when mocking framework is not installed. -The report is represented as an HTML-string allowing to include clickable links. +The report is represented as an HTML-string allowing one to include clickable links. _Note:_ no test generation reports are created for parameterized tests. From 5d890eb9306636de4fc10b0b91a1ce62c5b568ee Mon Sep 17 00:00:00 2001 From: Olga Naumenko <64418523+olganaumenko@users.noreply.github.com> Date: Thu, 22 Dec 2022 12:48:31 +0300 Subject: [PATCH 3/3] Minor fix --- docs/CodeGenerationAndRendering.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CodeGenerationAndRendering.md b/docs/CodeGenerationAndRendering.md index 6b43e23eea..eab4d56723 100644 --- a/docs/CodeGenerationAndRendering.md +++ b/docs/CodeGenerationAndRendering.md @@ -284,7 +284,7 @@ While constructing the test class, we create test generation reports. It contain number of generated tests, the number of successful tests, etc. It also may contain information on potential problems like trying to use mocks when mocking framework is not installed. -The report is represented as an HTML-string allowing one to include clickable links. +The report is an HTML string with clickable links. _Note:_ no test generation reports are created for parameterized tests.