You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clean Code Discussion
You've got a set of tests that were running green. You are off the project for a while (just hypothetical example) and you pop back on. You notice you test drive again some new features on it. Some changes you made test driving new features broke some existing tests.
Should you:
a) change the implementation of your new code or change the implementation of the existing code to get the old tests to run red again
-or-
b) write a new tests that forces you to somehow fix the old tests that are bombing out
I guess my question is, with TDD when should you write a test, to force you to fix broken tests. I remember seeing UB write new tests and other people to fix broken code...when are those scenarios and how do you go about that properly. Or am I just not making sense whatsoever, you tell me.
Jakob Holderbaum
unread,
Oct 14, 2015, 2:10:45 AM10/14/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clean-code...@googlegroups.com
I think that depends. As always :)
If the new functionality is clearly contrary to the old one, the older
contrary tests have become superfluous. If the new functionality is an
add-on to your existing functionality, you probably are better off to
iterate your code in a way that does not break the old but still valid
tests.
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clean Code Discussion
You have 2 scenarios on your hand: 1) The specs changed and the old tests have become bad tests and should be fixed/deleted. 2) Your implementation is buggy and you need another test to fix the bug. (Unless it's the UI we're talking about)
Phil Markgraf
unread,
Oct 14, 2015, 5:53:16 PM10/14/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clean-code...@googlegroups.com
Or the specs are incomplete and need to be updated to support both functionalities.
> --
> The only way to go fast is to go well.
> ---
> You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.