Wednesday, April 14, 2010

Start With the Bug

Many times when we test, we start by looking at a feature or a module. We start with a thing we're trying to do:
  • an action we're trying to take
  • a configuration we're attempting to run
  • etc.
This action then either completes successfully or it reveals a bug. Great!

Sometimes, though, it's useful to start with the bug. When approaching the system, conceive of a bug that you might find. Use your knowledge of the architecture of the system to seek out some potential issue. For example, you might believe that there could be a race condition in saving data and reporting. Then design a test that would reveal the bug if it's present.

Starting with the bug is a valuable technique for when only a narrow range of tests or conditions will expose the bug. You're unlikely to stumble across it because the conditions that trigger it are fewer, so you need to start with the bug and then go hunting for it. Think of starting with the bug when you're testing for deadlocks, race conditions, and security tests in particular.

Give it a shot. Maybe you'll get lucky and the bug you imagine doesn't exist... but maybe it will, and you'll have found it because you're looking for it.


  1. Hi, I am agree with your thought for notifying bug at the point of start. Finding bug from the starting point may reduce testing.

  2. Yes, yes and yes! When dealing with third party vendors, testing against requirements is usually the first target simply because of the contractual obligations. However, one thing I try to instill in my testers is to call on their experience and to think about how the application was architected and coded. Then, think about what could've gotten screwed up along the way.

    I also encourage them to document these as part of the test approach document which is reviewed by the development team. There have been occasions where we bring up the additional things we'll be testing outside of the requirements and you see one developer cast a sideways glance at his manager who gives him a knowing nod. As much satisfaction as I get from finding bugs while testing, it's thrilling to be able to prevent one.