You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we refactor our tests in the book, we often begin by implementing new structs/functions before using them in the test cases. For example, see the Still Some Problems section in the Mocking chapter. Here we implement the new spies for checking the order of operations prior to using them in the sleep before every print test.
In my opinion, we should continue to use a TDD approach in refactors by specifying the usage of the new code before the implementation of it. In other words, we use write the sleep before every print test first and then let the errors guide us to the implementation of the SpyCountdownOperations spy. This "specify, then implement" process reinforces the notion that TDD is a design technique as much as a testing technique.
The text was updated successfully, but these errors were encountered:
When we refactor our tests in the book, we often begin by implementing new structs/functions before using them in the test cases. For example, see the Still Some Problems section in the Mocking chapter. Here we implement the new spies for checking the order of operations prior to using them in the
sleep before every print
test.In my opinion, we should continue to use a TDD approach in refactors by specifying the usage of the new code before the implementation of it. In other words, we use write the
sleep before every print
test first and then let the errors guide us to the implementation of theSpyCountdownOperations
spy. This "specify, then implement" process reinforces the notion that TDD is a design technique as much as a testing technique.The text was updated successfully, but these errors were encountered: