If we’ve learned the Three Steps of TDD and the Three Laws of TDD, what keeps us from doing Test-Driven Development? Maybe it’s not knowing how to write unit tests. Or more specifically, not knowing how to write unit tests against “real” code.
And what keeps us from writing unit tests against our own code? I bet it’s not knowing what our many options are.
Dependency Injection can unlock your code.
That was the thought process I had when I was first asked to speak at a technical conference.
My talk Test-Driven Development for iOS (and anything) …by Controlling Dependencies at MCE 2014 in Warsaw could have crashed and burned:
But it was rated “Best Talk at MCE”!
Here’s a rough outline:
When have an hour, pour yourself a drink and watch. Or take it in sections. The talk itself is 42 minutes, followed by Q&A.
Here are the books on my last slide.
In addition to the video, I’m making my slides available as a bonus. You can access the bonus PDF here.
What successes have you had applying Dependency Injection to your code? Did it help you test something that used to resist testing? Did it help in other ways? Share your story in the comments below.
Programming was fun when I was a kid. But working in Silicon Valley, I saw poor code lead to fear, with real human costs. Looking for ways to make my life better, I learned about Design Patterns, Refactoring, and Test-Driven Development (TDD). Programming became fun again! I've now been doing TDD in Apple environments for 17 years. I'm committed to software crafting as a discipline, hoping we can all reach greater effectiveness and joy.
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.