Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ZJU-ACES-ISE/chatunitest-core
A framework to generate unit tests using LLMs
https://github.com/ZJU-ACES-ISE/chatunitest-core
Last synced: 3 months ago
JSON representation
A framework to generate unit tests using LLMs
- Host: GitHub
- URL: https://github.com/ZJU-ACES-ISE/chatunitest-core
- Owner: ZJU-ACES-ISE
- License: mit
- Created: 2023-10-14T07:15:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-18T08:36:01.000Z (4 months ago)
- Last Synced: 2024-07-18T10:51:47.973Z (4 months ago)
- Language: Java
- Size: 3.87 MB
- Stars: 19
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :mega: ChatUnitest Core
![logo](docs/img/logo.png)
[English](./README.md) | [中文](./Readme_zh.md)
## Background
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.## Overview
![Overview](docs/img/overview.jpg)
## Steps to run
### 0. Add our dependency to `pom.xml` and config
```xmlio.github.ZJU-ACES-ISE
chatunitest-core
1.1.0```
### 1. Add the following dependency to pom.xml
```xml
io.github.ZJU-ACES-ISE
chatunitest-starter
1.4.0
pom```
## Design Your Custom Prompt
### 1.Create a Directory Containing Your Prompt Files Using Freemarker
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.
### 2. Update the Template Filenames in the `config.properties` File
```properties
PROMPT_TEMPLATE_INIT=initial.ftl
PROMPT_TEMPLATE_EXTRA=extra.ftl
PROMPT_TEMPLATE_REPAIR=repair.ftl
```### 3. To Use an Extra Template, Extend the `MethodRunner` and Override the `startRounds` Method
Refer to the example in `ChatTester Github Repository`.
## :email: Contact us
If you have any questions, please feel free to contact us via email. The email addresses of the authors are as follows:
1. Corresponding author: `zjuzhichen AT zju.edu.cn`
2. Author: `yh_ch AT zju.edu.cn`, `xiezhuokui AT zju.edu.cn`