Where did that bug come from?


Posted in: software, testing | Save to del.icio.us | Twit This! 16 Nov 2009

This is the second time this week that I encountered a annoying bug, introduced just by a small change in the code. Just when you think you can get away with minor changes without testing, you are in for a surprise.

The most common sense thing you can do is to test your code even for small changes; whether you are testing it yourself or sending it to the testing team. Seems simple, but how many times have you really done that. Its not that we are stupid, rather software was never so simple. Maybe we are careless sometimes. The moral is plain - treat even small changes important, and move it through a test before committing it to a version control.

The following figure from Steve Mcconnell’s Code Complete shows the relation between lines of code changed and errors introduced.

bug_source




Share this post

Share on Facebook
Share on Twitter
Share on StumbleUpon
Share on Delicious
Share on Digg
Share on Technorati
Share on Reddit
Feeds RSS Subscribe to site Feed

Other related posts



1 Response

1

Jani Hartikainen

November 17th, 2009 at 2:03 pm

I find I write mostly bug-free code when I use test-driven development. I don’t know if it’s because of the tests that catch them, or because I pay more attention to detail because I know the tests will fail if there’s a problem, but I think it’s a really good methodology.

ps. your comment form tab-ordering is wonky. Hitting tab in this comment box jumps to the search box, not to the spam protection box under this.

Comment Form

Use the html <code> tag to insert small source code snippets

For longer code examples use http://pastie.org/.

Get latest updates by E-mail

About this blog

This site is a digital habitat of Sameer, a freelance web developer working from Pune.More

Recent Comments

  • sameer: Check to see if the 'IDE > options > format' is set to HTML. [...]
  • sameer: Google strips any newline characters form the text. Although it does accept it with the online trans [...]
  • Arjan: Fiddler is a debugging tool for IE (not Microsoft's Fiddler) [...]
  • Susan Martin: while creating a test for site, command icons on IDE greyed out and do not respond when selected. I [...]
  • Saar: Thanks for this example. helped me a lot. I have 1 problem, I am translating chunks of code, but I [...]
  • sameer: You can add extra GET variables in the options array as below: $pager_options = array( 'mode [...]
  • Martin: How can you carry over your own variables into the URL? I am using a form to POST a couple of var [...]
  • nancy: thanks very much ! first tools [...]

  • Users Online

    • 15 Users Online
    • 12 Guests, 3 Bots