[LRUG] TDD when removing functionality

Garry Shutler garry at robustsoftware.co.uk
Wed Sep 19 02:54:52 PDT 2012


I go the route that you didn't think was useful!

I look at what tests I expect to fail, remove the code, check that
*only*the tests I expected to fail did fail
*and* failed in the way I expected, and then remove/alter the tests
accordingly. Kind of the reverse of the process you use to TDD new code.

Green, red, refactor!

Garry Shutler

www.robustsoftware.co.uk | @gshutler <http://twitter.com/gshutler>


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

> This is something I regularly come up against and am never sure how best
> to go about it.
>
> I have RSpec coverage for an app I'm making some changes to. The changes
> I'm making are to remove a section of the app.
>
> I can identify which behaviour I'm removing by going through my tests but
> I can't figure out how to test the removal of the functionality. I guess I
> could add a load more tests in to test that the app no longer does
> something but this seems to be complicating the act of removing stuff.
>
> Do I remove the code and ensure that the tests I'm expecting to break do
> indeed break? This doesn't seem like it would be that useful.
>
> I understand the value of the tests showing me whether the changes are
> breaking things I don't want to break but I can't see how to actually
> test-drive the removal of the code. Does anyone have any good experience of
> using TDD for this? Or should I just delete the code, delete the tests,
> make sure the remaining tests don't fail and stop worrying about it?
>
> Thanks!
>
> Ian
>
> --
>
> Ian Kynnersley
> http://iankynnersley.co.uk | 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/960801ea/attachment.html>


More information about the Chat mailing list