Skip to content

Commit 2b912f3

Browse files
committed
docs: add documentation for executable unit validation.
This commit introduces a new documentation file that explains the concept of executable unit validation and its importance in ensuring the accuracy and executability of generated code in AutoDev. The documentation covers various validation mechanisms implemented or planned for different functionalities, such as SQL syntax validation, unit test execution, and functional code generation validation.
1 parent 31c96e4 commit 2b912f3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: default
3+
title: Executable Unit Validation
4+
nav_order: 4
5+
parent: Design Patterns
6+
---
7+
8+
Executable unit validation refers to the process of testing and verifying the generated code to ensure that it can be
9+
compiled and executed by the compiler. The aim of executable unit validation is to enhance the accuracy and
10+
executability of the generated code, ensuring that the generated code units meet expectations and can be effectively
11+
utilized.
12+
13+
In AutoDev, corresponding to functionalities such as SQL combined with the database, unit testing, and functional code
14+
generation, we have preliminarily designed the following validation mechanisms:
15+
16+
- Unit Test Syntax (TODO): Check whether the generated unit test code complies with language syntax specifications to
17+
ensure it can be compiled correctly by the compiler.
18+
- Unit Test Execution: Execute the generated unit test cases to test the generated code, ensuring it can be compiled and
19+
executed correctly by the compiler.
20+
- SQL Syntax Validation: Generate SQL statements based on different model capabilities and handle any resulting errors.
21+
- SQL Schema Validation (TODO): Combine with the connected database to check the generated SQL statements, ensuring they
22+
comply with the database schema specifications.
23+
- Functional Code Generation Validation (TODO): Adopt a test-driven validation mechanism to check the generated code,
24+
ensuring it meets development requirements and can be compiled correctly by the compiler.
25+
- Frontend Code Generation Validation (TODO): Check the generated frontend code to ensure correctness in imports,
26+
syntax, etc.
27+
28+
Considering that unit tests are directly executable, in AutoDev, we directly execute unit tests (`RunService`), and with
29+
a fast enough IDE, the validation process is generally rapid. Through the aforementioned validation mechanisms, we can
30+
effectively enhance the accuracy and executability of the generated code, ensuring that the generated code units meet
31+
expectations and can be effectively utilized.

0 commit comments

Comments
 (0)