The Source for Java Technology Collaboration
User: Password:



Sue Spielman

Sue Spielman's Blog

Dear John…er...I Mean Debugger

Posted by sspielman on October 01, 2003 at 06:09 PM | Comments (10)

Dear John…er...I mean Debugger:

We’ve had a really good time together over the past 20 years. There’s never been just one of you of course. My debuggers have changed languages many times. First, it was Pascal, then C, then C++, and now, naturally, Java. But throughout our relationship, your purpose in my life has always remained the same. You helped me weed out those nasty bugs and make my code shine like the sun. Now the time has come to reevaluate the time we spend together.

We’ve spent hours and hours frolicking at breakpoints, contemplating the meaning of the stack, and chatting into the wee hours of the morning. We’ve danced, stepped into, and stepped over who knows how many methods and lines of code. As I look back, there is no development tool that could ever take your place in my heart. However, it seems over the last year or two we are spending less and less time with each other. How should I tell you this? My time is now spent with my test cases.

Test driven development has reduced the need, or requirement, for me to be in the debugger. While maybe not eliminating the need for you altogether, it recently dawned on me that I rarely have to fire up the debugger at all. After all, if you are writing test cases before you are writing code there’s nothing to debug. As you start writing the code, the test cases will validate your code for you. By doing frequent, short iterations and running your tests after each and every change, you find many bugs immediately. If you don’t find these bugs early, they can turn into hard to track down problems later on in the development cycle. With tools such as JUnit and the whole JUnit family (Cactus, HTTPUnit, etc) available, unit test cases have become automated and repeatable. The more I’ve gotten into the TDD habit; the less and less I’ve actually been in the debugger. Which is just fine by me. Because however much I loved my debugger, seeing the green bar is much more of a joy.

While I can’t tell you, my dear debugger, when we’ll meet again, I can tell you that you definitely served your purpose and your keystroke commands are ingrained in my brain for all eternity.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • not using the debugger?
    It's a good idea to step through your code in the debugger as part of unit testing.

    Having test cases already written facilitates this.

    Posted by: rstinejr on October 02, 2003 at 01:58 PM

  • not using the debugger?
    Care to elaborate on why it's a good idea? My first reaction is to disagree with you, but I'd like to here your justification.

    Posted by: kdenehy on October 03, 2003 at 06:34 AM

  • not using the debugger?
    I'd be interested in why you think it's a bad idea...

    The advantage is that walking through a unit test in the debugger is a "white box" rather than a black box test -- you can actually see how things work. This gives you a chance to spot redundant actions, unclosed connections, success by chance, etc., that you wouldn't see through a simple pass/fail test of the output. Also, if there is a problem that would cause the test to fail, you have a much better idea about what is going wrong.

    I first read about this approach in Seve McConnell's "Code Complete", one of the really outstanding books on software development.

    A complaint about this practice is the time it takes, but my experience has been that it saves time, since you trade off time in the debugger during unit test against time in the debugger during system integration.

    Posted by: rstinejr on October 03, 2003 at 08:40 AM

  • not using the debugger?
    I'm not saying that you shouldn't use the debugger if you want, what I'm saying is that I've found that I haven't had to use it much when doing TDD. The need to pop code into the debugger and step through line by line is greatly reduced when you are writing a test, running it, writing the code, running the test. Try it and you'll see what I mean.

    Posted by: sspielman on October 06, 2003 at 09:10 AM

  • not using the debugger?
    > Try it and you'll see what I mean.

    I imagine that _not_ walking thru the code in the debugger is the native mode. I've got years of practice doing that...

    I'd echo back your suggestion back to you: once you finish coding a method, try out walking thru the unit test code in the debugger. I've found this to be a help during development.

    Of course, after the method passes unit test, you rely on the automated tests for regression testing.

    Posted by: rstinejr on October 08, 2003 at 01:17 PM

  • not using the debugger?
    >I'd echo back your suggestion back to you: once you finish coding a method, try out walking thru the unit test code in the debugger

    Ok, I will, although I haven't found the need to do that, I'll give it a shot and see if it makes a difference during development.

    Posted by: sspielman on October 08, 2003 at 01:24 PM

  • Concur with the use of the debugger for unit test
    I have to concur with the developer who uses the
    debugger for running through the Unit tests.
    The unit test is "The Watcher".
    The paranoid person's question is
    "Who watches the watcher ?"
    The answer is in this case: The Debugger.

    None the less, the role of the debugger has changed,
    as has the frequency of its use.

    Combining the viewpoints of two of my coworkers:

    A Unit test is the modern equivalent of having printf's everywhere (this from a coder who flipped switches back in the Former Sovient Union way back when they were initially stealing --er borrowing our computer designs).

    Unit testing...Same as it ever was...

    Posted by: sswerdloff on October 10, 2003 at 10:11 PM

  • Compared to unit testing, using a debugger is a timesink. Since junit, I have almost completely stopped using the debugger.

    In a sense, when one uses a debugger is one is doing tiny units tests in one's head. The problem is when a debugging session is over, those new regression tests are lost, not added into the testing suite.

    Debugging is a transient, one-time only unit test.

    Brian

    Posted by: briankbuckley on December 20, 2004 at 09:50 AM

  • wow power leveling
    wow powerleveling
    wow power leveling
    wow gold
    wow items
    feelingame.com
    wow tips
    Most Valuable WOW Power Leveling Service
    wow power leveling faq
    cheap wow power leveling
    wow power leveling
    wow powerleveling
    wow power lvl

    Posted by: wowleveling3 on December 13, 2007 at 06:25 PM

  • 网络è¥é”€è½¯ä»¶
    网络è¥é”€è½¯ä»¶
    网络è¥é”€è½¯ä»¶
    群å‘软件
    群å‘软件
    ---
    群å‘软件
    网络è¥é”€è½¯ä»¶
    论å›ç¾¤å‘软件
    网站排å软件
    群å‘软件
    推广å°åŠ©æ‰‹ç ´è§£ç‰ˆ
    论å›ç¾¤å‘软件
    网站排å软件
    群å‘软件
    网络è¥é”€è½¯ä»¶
    网站推广软件
    ä¿¡æ¯ç¾¤å‘软件
    论å›ç¾¤å‘软件
    ä¿¡æ¯ç¾¤å‘软件
    åšå®¢ç¾¤å‘软件
    qq群å‘软件
    邮件群å‘软件
    åšå®¢ç¾¤å»ºè½¯ä»¶
    ä¼ä¸šå录æœç´¢è½¯ä»¶
    ä¿¡æ¯ç¾¤å‘软件
    邮件群å‘软件
    论å›ç¾¤å‘软件
    åšå®¢ç¾¤å‘软件
    网站推广软件
    网络è¥é”€è½¯ä»¶
    全能è¥é”€ç ´è§£ç‰ˆ

    Posted by: bininine on December 16, 2007 at 01:18 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds