Slashdot Mirror


Not All Bugs Are Random

CowboyRobot writes "Andrew Koenig at Dr. Dobb's argues that by looking at a program's structure — as opposed to only looking at output — we can sometimes predict circumstances in which it is particularly likely to fail. 'For example, any time a program decides to use one or two (or more) algorithms depending on an aspect of its input such as size, we should verify that it works properly as close as possible to the decision boundary on both sides. I've seen quite a few programs that impose arbitrary length limits on, say, the size of an input line or the length of a name. I've also seen far too many such programs that fail when they are presented with input that fits the limit exactly, or is one greater (or less) than the limit. If you know by inspecting the code what those limits are, it is much easier to test for cases near the limits.'"

4 of 165 comments (clear)

  1. Obvious, but worth restating. by Animats · · Score: 5, Informative

    Fairly obvious statement, but one some newer programmers don't know. Koenig is talking about white-box testing, which is well understood.

    1. Re:Obvious, but worth restating. by Joce640k · · Score: 3, Informative

      Are any bugs truly "random"? I always thought computers were deterministic machines.

      OK, maybe process scheduling bugs are fairly random...the point is that the headline makes it sound like bugs just happen all by themselves.

      --
      No sig today...
  2. This is not new by Anonymous Coward · · Score: 2, Informative

    http://en.wikipedia.org/wiki/Boundary-value_analysis

  3. It's good to test the corner cases by Black+Parrot · · Score: 3, Informative

    News at 11.

    --
    Sheesh, evil *and* a jerk. -- Jade