Chapter 75. Red, Green, Refactor for Infrastructure
Annie Hedgpeth
When a company decides to move to the cloud, I can guess what its main motivation is: velocity! I’m sure you’ve been there. You plan a new project and begin implementation. You get excited about seeing it come to life as you deliver new features one after another. Pretty soon, however, the feature requests start piling up, and you slip behind schedule. But what changed? The growing complexity of your project forces you to spend more time testing your changes than you spend on actually making the changes. To meet your stakeholders’ expectations, you begrudgingly accumulate tech debt and promise to start integration testing as soon as you get a free cycle. Still, you’re frustrated that nothing works, and your team is burning out. That free cycle never comes.
Unfortunately, this is an all-too-common scenario in cloud infrastructure development—but I promise you that there is a way to develop your infrastructure that is less stressful and more fun. This way is called test-driven development (TDD), or red, green, refactor (which I prefer because of the reassurance that a green passing test gives). TDD means that you will not write one line of code without first writing a test for it. The workflow is to write a test, run it, watch it fail (red), write the code to make ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access