Found bug - need new test? or modify existing test?

Discussion in 'Ruby' started by Joe Van Dyk, Jul 5, 2005.

  1. Joe Van Dyk

    Joe Van Dyk Guest

    So, I'm developing some software. It's still pretty early in
    development. I have a bunch of tests for the software.

    Say I come across a bug that exposes a boundry condition that I didn't
    test for.

    Should I=20

    a. Modify the test that is responsible for that area of the code to
    test for that extra condition.
    b. Add a new test that duplicates everything of the test that
    supposed to test that area correctly and also tests for the boundry
    condition?

    In my case, I have a function that's responsible for scanning a string like

    "id: 1, x_pos: 23, y_pos: 34 | id: 2, x_pos: 34, y_pos: 34 | "

    I was splitting the string at "|" and then doing a regex for id and so
    on. But if there's a " | ", then the last thing String#split will
    return is a space, and doing a regex on that space for /id:/ messes
    things up. So either I could modify the test function to include that
    extra " | " at the end, or have a new function that tests for that.
     
    Joe Van Dyk, Jul 5, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marco Aschwanden
    Replies:
    4
    Views:
    895
  2. gsal
    Replies:
    1
    Views:
    919
    Mike Driscoll
    Jan 15, 2008
  3. Stephen Brown
    Replies:
    1
    Views:
    1,001
    John Machin
    Jan 31, 2008
  4. socamb
    Replies:
    2
    Views:
    619
    socamb
    Apr 3, 2008
  5. Vikash Yadav

    How to modify appearance of existing web server control

    Vikash Yadav, Feb 2, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    131
    Vikash Yadav
    Feb 2, 2005
Loading...

Share This Page