Processed online by Toolvito
AI Test Case Generator
Paste your code. Get test cases with inputs and expected results, as a pytest or unittest file for Python, or as plain test cases for other languages.
How it works
- Paste the code and choose pytest or unittest (Python), or plain, Jest or JUnit test cases.
- Press Write the tests. A language model that runs on the Toolvito server writes the cases.
- For Python, code checks every case: the function exists, the number of arguments fits its signature, the arguments and the expected value are plain Python values (no code), and an exception is one Python has or your code raises. The test file is then written by code and checked to parse.
- Run the tests. The expected values are the model’s reading of your code and were not run here, so a failing test can mean a wrong expectation or a real bug.
A skeleton without AI
Make a test skeleton writes a pytest or unittest file from your function signatures: inputs chosen by type hint (0, 1 and −1 for numbers, an empty and a short string …), one value changed at a time, and a ... where you write the expected value.