Code Smell: Using the Debugger

When you have a lot of code to look through to find an error, you often times use a debugger. You use the debugger to step through code to find out where it is failing. This is a code smell.

CODE SMELL: If you find yourself using the debugger, your tests are not fine-grained enough.

Using a debugger indicates that your tests are a poor targeting system for errors. They have failed to find the error and you have had to fall back to another system to locate it. Refine your tests by breaking them into smaller units that test less code. That way, you have a smaller “probable failure zone” to look in when you get a failure. Ditch that debugger!

This entry was posted in Test-Driven Development, Testing, Uncategorized and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*