prix-fixe

Expand History Expand History
Collapse History Collapse History

Complete the first TDD Red-Green-Refactor Cycle

After finishing this round of refactoring, we can pause and assess the code related to the original feature.

Depending on your design preferences or programming practices, there are more changes that could be made in the name of refactoring.

For the sake of maintaining forward momentum, it now feels like an appropriate time to consider this feature “ready” to be opened as a pull request and ultimately merged into the master branch.

If you’re feeling skeptical this this feature “works” as intended without any models, database queries, or persistence of any kind, that skepticism is justified!

One valuable aspect of practicing outside-in testing and TDD is that authors can feel confident that if the tests are well written and passing, the features are “working” for end-users.

Another aspect of practicing outside-in testing and TDD is that there will always another test to write. An inevitable outcome of writing that test is that the implementation will need to be extended to get that test to pass. We can expect that future features will demand more from Rails. When its appropriate, we will introduce more concepts and complexities.

For now, we can be confident that our application behaves exactly in the one way that we’ve specified. For now, let’s appreciate the simplicity of our system.

With that in mind, it’s time to move onto the next feature.

N.B.

In previous commits, this feature’s test-driven development steps have been thoroughly documented at a very granular level.

Future features will be test-driven, and those tests and their corresponding implementation changes will be introduced into the codebase through a similar process.

For the sake of the reader, subsequent test-driven development steps and Red-Green-Refactor Cycles may be omitted, undocumented, or combined into larger and less granular commits.