Summary


This chapter presented the best proactive programming techniques you can use to debug during coding. The best technique is to use assertions everywhere so that you gain control whenever a problem occurs. The .NET assertion code in BugslayerUtil.NET.DLL and the native SUPERASSERT code presented avoid all the problems associated with the assertions supplied by the Microsoft compilers. In addition to assertions, proper tracing and comments can make maintaining and debugging your code much easier for you and others. Finally, the most important quality gauges for engineers are unit tests. If you can properly test your code before you check it in, you can eliminate many of the bugs and problems that frustrate maintenance engineers later.

The only way to unit test properly is to run a code-coverage tool while you're doing your tests. You need to strive to get at least 85 to 90 percent coverage on your code before you ever check it in to the master sources. The more time you spend debugging your code during development, the less time you'll have to spend debugging it later.




Debugging Applications for Microsoft. NET and Microsoft Windows
Debugging Applications for MicrosoftВ® .NET and Microsoft WindowsВ® (Pro-Developer)
ISBN: 0735615365
EAN: 2147483647
Year: 2003
Pages: 177
Authors: John Robbins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net