© Paul Gerrard 2016
Paul GerrardLean Python10.1007/978-1-4842-2385-7_8

8. Testing Your Code

Paul Gerrard
(1)
Maidenhead, Berkshire, UK
 

Modularizing Code and Testing It1

So far, we have explained how to make use of the features of Python to create software that has some purpose and hopefully, value. When you write a little code, the natural thing to do then is to try it out, or test it.
The programs I have used to illustrate Python features run without any intervention, or require some user input via the input() function. As you get better at programming, you will become more ambitious and create larger programs. Then you realize that testing becomes more difficult, and more important. Splitting programs into functions and modules will make testing ...

Get Lean Python: Learn Just Enough Python to Build Useful Tools 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.