Unleashing the Power of Test-Driven Development and Testing in Production
The Quest for Reliable Feedback
Imagine a world where teams embrace a unique approach to software development, prioritizing unit and integration tests over end-to-end tests. This is the story of Ola Hast and Asgaut Mjølne Söderbom, who, in their QCon London talk, unveiled a continuous delivery journey that challenges conventional wisdom.
The Secret Sauce: TDD, Pair Programming, and Design
Hast and Mjølne Söderbom emphasize the synergy between Test-Driven Development (TDD), pair programming, and good design principles. By adopting a modular, abstracted, and highly cohesive approach, they've achieved a domain-driven design with exceptional code quality. But here's where it gets controversial: they've ditched end-to-end tests altogether!
The Evolution of Testing
Hast explains their journey from HTTP application integration tests to more focused, shorter feedback loop tests. They've realized that testing the entire application running is less effective than testing specific components. And this is the part most people miss: test environments, with their long supply chains and bad test data, often provide low-quality feedback.
Testing in Production: The Bold Move
Mjölne Söderbom boldly states, "We prefer to test in production." This statement might raise eyebrows, but it's a strategy that has worked remarkably well for their team. By deploying small changes frequently and using feature toggles, they've minimized risks. If something breaks in production, it's a quick fix, and they can easily roll back or forward.
Pair Programming and Continuous Integration: A Match Made in Heaven
Hast and Mjølne Söderbom highlight the benefits of pair programming and continuous integration. Pushing code to the main branch multiple times a day is challenging in isolation, leading to delays and merge issues. Pairing, on the other hand, facilitates instant code review, easier refactoring, and higher team resilience. It's a win-win situation!
The Role of Feedback: Navigating the Development Journey
Mjølne Söderbom emphasizes the importance of feedback loops. Feedback is the compass that guides their development process, helping them choose and adjust directions. They've mastered the art of getting fast feedback from tests and the best feedback from production.
The Painful Truth: Embracing Challenges
Hast reveals their company's journey: by increasing the frequency of deployments to production, they received quick feedback on the most painful points. This iterative process has been their secret to success for over a decade.
The Takeaway: Fast Feedback Loops
Mjølne Söderbom concludes that TDD is their most valuable tool for early and fast feedback. He emphasizes that code that's difficult to test often indicates design issues. TDD, he believes, is not just a testing tool but a powerful design tool.
So, what's your take on their approach? Is testing in production a brave move or a risky one? Share your thoughts in the comments and let's spark a discussion!