Exercise 50
Automated Testing
This final exercise of Module 3 will teach you how to create automated tests. An automated test is code that runs other code and confirms it’s still working. As a programmer, your primary way to improve your work comes from automating things you do manually, and testing is one of the easiest things you can automate. Once you have a nice automated test suite, you can run it every time you make a change to test that everything is still working.
What Is the Purpose of Testing?
There’s a lot of people who advocate for various reasons and styles of testing, but in my experience there’s really only one big benefit of automated tests:
A complete automated test suite confirms that new code doesn’t break old code.
When ...
Get Learn Python the Hard Way: A Deceptively Simple Introduction to the Terrifyingly Beautiful World of Computers and Data Science, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.