Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Found bug - need new test? or modify existing test?

Reply
Thread Tools

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

 
 
Joe Van Dyk
Guest
Posts: n/a
 
      07-05-2005
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify an existing schema for a strongly typed dataset socamb ASP .Net 2 04-03-2008 09:14 PM
pyExcelerator - Can I read and modify an existing Excel-WorkBook? Stephen Brown Python 1 01-31-2008 10:11 PM
Open existing Word document, modify and save. gsal Python 1 01-15-2008 06:51 PM
pyExcelerator - Can I read and modify an existing Excel-WorkBook? Marco Aschwanden Python 4 07-13-2006 07:09 AM
How to modify appearance of existing web server control Vikash Yadav ASP .Net Building Controls 0 02-02-2005 10:20 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57