Home Segments Index Top Previous Next

285: Practice

You are said to practice defensive programming when you add tests to ensure that expected actions actually happen. For example, you should test array insertions to ensure that the indices are all within bounds. Add such a defensive-programming test to the program in Segment 280.