Where to Begin

Ah, where to begin. How do you begin to test a body of code? Start by analyzing assumptions. Bugs tend to result from two kinds of errors: errors in logic and errors in assumptions. Every time you call a function, you make assumptions about what the function's valid parameters are and the valid contexts in which it may be called. This is especially true when you're calling code you didn't write such as operating system or library routines. Contrary to what may seem obvious, the most challenging aspect of working through a large body of code is not figuring out the logic behind each line of code. The most challenging aspect is understanding the assumptions in place when the code was written. You have to analyze the assumptions being ...

Get Guru's Guide to SQL Server™ Stored Procedures, XML, and HTML, The 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.