Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I mostly agree. (Score:2, Interesting)

    by pdcawley (485) on 2003.10.31 3:11 (#25335) Homepage Journal
    The problem with the test that expected an exact match only becomes a bug in the test when you change the output. So, you roll back your changes, refactor the failing test to accept more generic input, make sure it still passes without your changes and then redo your changes (consider doing a quick smoke test by deliberately breaking the thing it's supposed to test to make sure it fails correctly too).

    With TDD you are holding your tests to the same standard as your code; tests should be good enough for right now. Keep it simple so you can change it easily. The original, fragile, test was Good Enough up 'til now. The time saved by not making it generic meant more stuff that added direct customer value could get done, and that's a Good Thing.

    However, rape and paste functions are Evil, Bad and Wrong and should be excised at every possible opportunity as part of your general refactoring. Accept the blame for letting it happen, fix it, and move on.