Testing

The programs that we write can quickly become complicated, and with complexity comes bugs. Programmers have long accepted that every program will have its share of bugs. To deal with this, we have come up with many ways to defend against avoidable bugs. Learning to write tests is one of the best things you can do to guard against avoidable bugs creeping into your own programs. Basically, you write a set of tests that you then run against your program every time you or someone else changes the program. These tests, if written correctly, prove that changes to the code do not break anything that was working previously.

Contents

top