ChatTester is a framework designed for generating test methods automatically based on large models such as ChatGPT.
To run this experiment successfully, ensure that the following environment requirements are met:
- Python version >= 3.7
- JDK version = jdk1.8.0_131
To reproduce the effectiveness of ChatTester on the project, follow these steps:
-
Navigate to the
./ExperimentCodedirectory. -
Run the
InitialPhrase_Experiment.pyfile.- Note: When running this
.pyfile, make sure to set up your JDK environment andopen_key(marked with TODO). - The functionality implemented by
InitialPhrase_Experimentcorresponds to the "Initial Test Generator" in the figure.
- Note: When running this
-
Run the
ChatGptTester.pyfile located in the./ExperimentCodedirectory.- This file implements the functionality of the "Iterative Test Refiner" in the figure.
-
After running the experiment, you can find the test methods generated by ChatTester for the given project in the
./ExperimentCode/IterateResultDealdirectory.
To calculate the coverage of the generated test methods in each project, follow these steps:
- Navigate to the
CoverageCaldirectory. - Run the
Mergy.pyfile. This action will place the generated test methods in the respective project directories. - Then, run the
jacoco.pyscript located in the./scriptdirectory. This script utilizes Jacoco to calculate the coverage of the generated test methods in each project.
Additional experimental data related to this paper can be found at the following link: ChatTESTER.git
@misc{yuan2023manual,
title={No More Manual Tests? Evaluating and Improving ChatGPT for Unit Test Generation},
author={Zhiqiang Yuan and Yiling Lou and Mingwei Liu and Shiji Ding and Kaixin Wang and Yixuan Chen and Xin Peng},
year={2023},
eprint={2305.04207},
archivePrefix={arXiv},
primaryClass={cs.SE}
}
