[LRUG] TDD when removing functionality

Ian Kynnersley iankynnersley at gmail.com
Wed Sep 19 02:45:30 PDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20120919/a7e92594/attachment-0003.html>


More information about the Chat mailing list