Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 3
    Anything point could be made that if the developer hadn't used tdd, they would have been much more likely to miss other cases as well. Commented Jul 13, 2018 at 6:27
  • 77
    And, on top of that, think about how much time was saved when they we're fixing the bug? By having the existing tests in place, they knew instantly that their change didn't break existing behavior. And they were free to add the new test cases and refactor without having to run extensive manual tests afterward. Commented Jul 13, 2018 at 6:29
  • 15
    TDD is only as good as the tests written. Commented Jul 13, 2018 at 20:09
  • 1
    Another observation: adding the test for this case will improve the design, by forcing us to take that datetime.utcnow() out of the function, and instead to pass now as a (reproducible) argument instead. Commented Jul 16, 2018 at 12:21