Skip to Main Content
Test-Driven Database Development: Unlocking Agility
book

Test-Driven Database Development: Unlocking Agility

by Max Guernsey III
February 2013
Intermediate to advanced content levelIntermediate to advanced
352 pages
7h 45m
English
Addison-Wesley Professional
Content preview from Test-Driven Database Development: Unlocking Agility

Chapter 5. Enforcing Interface

An important part of doing test-driven development is defining the right interface. I’ve been drumming for a while now on the fact that a database is really an object and that it has a class. One of the properties of a class is that it tends to have a fairly strong interface.

In compiled languages, the validity of most coupling is enforced at compile-time. In dynamic languages, it’s validated shortly before you access part of an object. In databases, though, coupling isn’t validated until a command is transmitted to a database. This makes testing objects that talk to the database harder because mocking a database robs you of the feedback you get when coupling to it.

A way exists to give clients coupling to a database ...

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.
Start your free trial

You might also like

Test-Driven Database Development

Test-Driven Database Development

David Wheeler

Publisher Resources

ISBN: 9780132776486Purchase book