As was emphasized in the last chapter, nobody’s perfect, including software developers. In Chapter 13 we talked about different things to look for when you know there are errors in your code. Now we’re going to talk about how to find those errors. Of the three types of errors in your code, the compiler will find the syntax errors and the occasional semantic error. In some language environments, the run-time system will find others (to your users chagrin). The rest of the errors are found in two different ways - testing, and code reviews and inspections. In this chapter, we’ll discuss testing, when to do it, what it is, how to do it, what your tests should cover, and the limitations of testing. In the next chapter we’ll talk about code reviews and inspections.
KeywordsUnit Testing Phone Contact Conditional Expression Instance Variable Code Coverage
Unable to display preview. Download preview PDF.
- Kernighan, B. W. and R. Pike. The Practice of Programming. (Boston, MA: Addison-Wesley, 1999.)Google Scholar
- Martin, R. C. Clean Code: A Handbook of Agile Software Craftsmanship. (Upper Saddle River, NJ: Prentice-Hall, 2009.)Google Scholar
- McConnell, S. Code Complete 2: A Practical Handbook of Software Construction. (Redmond, WA: Microsoft Press, 2004.)Google Scholar
- Newkirk, J. and R. C. Martin. Extreme Programming in Practice. (Boston, MA, Addison-Wesley, 2001.)Google Scholar