[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Devin Mullins

7/5/2005 11:12:00 PM

> Typically you want to add a new test. This preserves your "history" of
> test cases. It also helps isolate tests so that they only test as
> little as possible, which will help you isolate the problem when things
> go wrong.

Agreed. You don't want duplicate tests, though, so I would simplify the string to the simplest thing that would force you to fix the error.

" " for instance, might do it

This helps you isolate one problem to one test method.

If you foresee other boundary cases that might break that you want to protect against in the future, make methods for those, too.

If you find you're duplicating a lot of code, it might be time to refactor your tests. :)

Devin