Skip to Content
Test-Driven Infrastructure with Chef
book

Test-Driven Infrastructure with Chef

by Stephen Nelson-Smith
June 2011
Intermediate to advanced
90 pages
2h 21m
English
O'Reilly Media, Inc.
Content preview from Test-Driven Infrastructure with Chef

Test-Driven Development

Out of the Agile movement emerged a number of core practices which were felt to be important to guarantee not only quality software but also an enjoyable working experience for developers. Ron Jeffries summarises these excellently in his article introducing Extreme Programming,[11] one of a family of Agile approaches that emerged in the early 2000s. Some of these practices can be introduced as good habits, and don’t require much technology to support their implementation. Of this family, the practice most crucial for creating a supportable structure for imminent change, providing insurance and warning against unwanted side effects, is that of test-driven development (TDD). For infrastructure developers, the practice is both the most difficult to introduce and implement, and also the one which promises the biggest return on investment.

TDD is a widely-adopted way of working that facilitates the creation of highly reliable and maintainable code. The philosophy of TDD is encapsulated in the phrase Red, Green, Refactor. This is an iterative approach that follows these six steps:

  1. Write a test based on requirements.

  2. Run the test, and watch it fail.

  3. Write the simplest code you can to make the test pass.

  4. Run the test and watch it pass.

  5. Improve the code as required to make it perform well, be readable and reusable, but without changing its behavior.

  6. Repeat the cycle.

Kent Beck[12] suggests this way of working brings benefits in four clear areas:

  1. It helps prevent scope from ...

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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Test-Driven Infrastructure with Chef, 2nd Edition

Test-Driven Infrastructure with Chef, 2nd Edition

Stephen Nelson-Smith
Chef: Powerful Infrastructure Automation

Chef: Powerful Infrastructure Automation

John Ewart, Matthias Marschall, Earl Waud
Coaching for High Performance

Coaching for High Performance

MIT Sloan Management Review

Publisher Resources

ISBN: 9781449309718Errata