Many people have tried using ChatGPT to help them with various programming tasks and have achieved good results. However, there are some issues with using ChatGPT directly. Firstly, the generated code often fails to execute correctly, leading to the famous saying "five minutes to code, two hours to debug". Secondly, it is inconvenient to integrate with existing projects as it requires manual interaction with ChatGPT and switching between different platforms. To address these problems, we have proposed the "Generate-Validate-Repair" framework and implemented a prototype. Additionally, to make it easier for everyone to use, we have developed some plugins that can be seamlessly integrated into existing development workflows.
<dependency>
<groupId>io.github.ZJU-ACES-ISE</groupId>
<artifactId>chatunitest-core</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>io.github.ZJU-ACES-ISE</groupId>
<artifactId>chatunitest-starter</artifactId>
<version>1.4.0</version>
<type>pom</type>
</dependency>
Refer to the examples in src/main/resources/prompt
:
initial.ftl
serves as the initial prompt in the basic generation process.
initial_system.ftl
serves as the corresponding system prompt in the basic generation process.
extra.ftl
and extra_system.ftl
are designed for further extensions in the pipeline (currently not in use).
repair.ftl
serves as the repair prompt in the repair process.
PROMPT_TEMPLATE_INIT=initial.ftl
PROMPT_TEMPLATE_EXTRA=extra.ftl
PROMPT_TEMPLATE_REPAIR=repair.ftl
Refer to the example in ChatTester Github Repository
.
If you have any questions, please feel free to contact us via email. The email addresses of the authors are as follows:
- Corresponding author:
zjuzhichen AT zju.edu.cn
- Author:
yh_ch AT zju.edu.cn
,xiezhuokui AT zju.edu.cn