Loading
Current section: Principles 4 exercises
solution

Trusting Your Test

Transcript

00:00 In situations like this, when the test is failing but both the test and the code look trustworthy enough, I have a simple rule to follow. Always trust your test, because the test was written to describe the intention behind the code, not the other way around. So in this case, the intention was to return the string "Hello John". This means that the implementation has a bug, and instead of "Howdy",

00:19 it should return "Hello". With this change, I can rerun the test, and I can see them passing, because now the implementation fulfills the intention.