Code, Test, Debug, Repeat

When you are writing code, you should include testing and debugging in your workflow. First write some code, then run your tests, then debug the test failures, and then write some more code. When you have written enough code, you can do some integration testing (manual or automated) by actually using your program. You can debug any problems you find while doing integration testing and then repeat the entire cycle. When you find a bug, create a new automated test to ensure that the bug never shows up again. Including testing and debugging in your workflow helps you write high-quality code much more quickly.

Get Learning to Program 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.