Source code showing the ability of ChatGPT (GPT-3.5) and Google Bard to generate unit tests for a function that extracts information from raw METAR reports. In both cases, the chatbots were asked to generate 100 test cases for the code located in the main.py module.
The entire implementation was placed in one module (main.py), which is not a good practice, but it is much easier to provide such a single-module code to the chatbot.
- Open terminal
- Install all required packages:
pip install -r requirements.txt
- Run main script providing raw metar report in the international format:
python main.py [METAR REPORT]
Unfortunately, the tests generated by both chatbots are not valid and should not be run. I only included them for the sake of showing the full experiment.