Test Strategy
We recommend the following test strategy which can be customised as per your specific needs.
- Test the code for runnability (System integrity Testing)
- Fix if there are missing imports
- Test the code with sample data by loading the data models.( Functional Testing)
- Fix the story, prompt or code for functional issues.
- Test the software for hosting environment for environment testing (Environment Testing)
- Fix the library versions through prompt or code.
- Finally, perform the end user testing (UAT)
- Fix the story, prompt or code.
Unit testing :
The promptset should include the unit test code generation, especially because the test cases can be built in the promptset itself.
Backend Testing
The test strategy for backend like in NodeJS framework should be add the testing of each API endpoints.
You can add the prompt for testing in the path of testing with each endpoint tester name @Asset-Action-‘test.js’. Rest of the details are common.
Frontend Testing
The test strategy for an AI generated software should have automated unit testing. You can add the test coding framework in the promptset itself to add code in the component.spec.ts file for each of the components. Therefore the first step should be to ensure that the unit tests are able to call the APIs with dummy data generated by the code generator itself.
Test Backend & Frontend together
Run the backend and frontend together in their respective directories:
Backend: npm run start
Frontend: npm run start
And then fire the test from frontend in a separate console. You should see the number of successful and failed tests.
Handling failures:
If a set of tests are failing, you need to follow your testing strategy.
- Fix code for immediate debugging.
- Improve story if the gap was in story.
- Improve prompt if the gap was in the prompt set.
- Improve AI if the generated code is faulty. This is the toughest.
Next : How to stage the codebase for collaborative testing, improvement and deployment?
Updated: Oct 9, 2024