3 ms·
> RED is as important as other in Red-Green-Refactor cycle. If next test does not fail, it is either: already implemented, or has to wait until a later time (un
by jgalt212 10y ago
> RED is as important as other in Red-Green-Refactor cycle. If next test does not fail, it is either: already implemented, or has to wait until a later time (until it will fail).
I strenuously disagree with this point in the following scenario: your new test could validate an edge case that your current implementation may only pass by happenstance. i.e. it's important for whomever refactors the code to pass your new test and all the old tests.
- waterlink 10y agoIf the production code does something by happenstance I will consider it a bug and fix it (unless in Legacy Code, where a bug could mean hidden super-valuable-for-customers feature). I.e.: I will make sure that this test fail and all other tests pass. Production code doing something, that is not defined by tests is generally not a good idea, because this is clearly an untested functionality. And it has to be eradicated if nobody needs it (business and customers) or it should be covered with a test, and I want to see this test fail (by applying Mutational Testing).
- waterlink 10y agoAdditionally I would like to stress that RED step is ultimately important - we have to see the test fail in an expected manner, otherwise we would never know that test is actually working as we expect it to. (for example it does not have any assertions, or they do not execute for some reason).