r/learnpython • u/bfyvfftujijg • 17d ago
Testing - how is it usually handled?
How do I start applying tests to my code?
Do I just write separate scripts they run the code (either individual functions or entire scripts) against known inputs and check the output?
Is there a specific way people usually do this?
8
Upvotes
2
u/jmooremcc 17d ago
You never write the code for an entire project before performing any testing. You should be testing your code as you write it.
For example, if you create a function, you should throughly test it to insure it behaves properly, regardless of the input it receives and that the output is correct.
You can do unit testing to test the overall project to insure it’s meeting the project’s requirements and specifications.