Foreword
I’ve been a Test-Driven Development practitioner for many years and have also been writing, lecturing, and teaching courses on the subject as part of my duties at Net Objectives. A question that often arises during classes or conference talks is this: TDD seems ideal for business logic and other “middle-tier” concerns, but what about the presentation (UI) tier and the persistence (database) tier?
My answer, typically, has been to point out that there are two issues in each case:
1. How to manage the dependencies from the middle tier to the other two, so as to make the middle tier behaviors more easily testable
2. How to test-drive the other layers themselves
For issue #1, this is a matter of interfaces and mock objects, design patterns, ...
Get Test-Driven Database Development: Unlocking Agility now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.