[LRUG] TDD when removing functionality

Ben Lovell benjamin.lovell at gmail.com
Wed Sep 19 04:40:32 PDT 2012


On 19 September 2012 12:20, Ian Kynnersley <iankynnersley at gmail.com> wrote:

> Cool, thanks everyone.
>
>
May I also suggest 'Working Effectively with Legacy Code' (Michael C.
Feathers)? Some great practical strategies for dealing with exactly these
kind of issues.

Cheers,
Ben




> Consensus seems to be that there isn't a "right" way to do this but that
> it's probably best not to add tests to verify that you have removed the
> code as the test suite should describe what the app should be doing not
> keeping a history of changes.
>
> I think I will remove the code first and verify that the breaking tests
> are the ones I'm expecting. It seems to make sense to remove the code from
> the view layer down so that I don't break everything all at once.
>
> Lots of commits also seems like a sensible plan.
>
> Thanks again,
>
> Ian
>
> On Wed, Sep 19, 2012 at 11:46 AM, Paul Battley <pbattley at gmail.com> wrote:
>
>> On 19 September 2012 10:45, Ian Kynnersley <iankynnersley at gmail.com>
>> wrote:
>> > ...
>> > Or should I just delete the code, delete the tests, make
>> > sure the remaining tests don't fail and stop worrying about it?
>>
>> This, I think. I don't see the value in testing the absence of
>> behaviour in most cases - about the only situation I can readily
>> imagine is where it's to fulfil a contractual, legal, or regulatory
>> requirement. I don't think a test suite needs to capture the history
>> of development, just the current set of operational parameters.
>>
>> I might do it the other way around, though: delete tests covering the
>> functionality, delete the code that satisfies them, then tidy up any
>> other breakages caused by unwanted side-effects.
>>
>> Paul.
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>
>
>
> --
>
> Ian Kynnersley
> http://iankynnersley.co.uk | +44 (0) 7973 420 829 |
> http://twitter.com/kpopper
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20120919/7ae4b3d0/attachment.html>


More information about the Chat mailing list