Max Guernsey is currently a Managing Member at Hexagon Software LLC. He has fifteen years of experience as a professional software developer. For nearly half that time, he has been blogging, writing, and delivering lectures on the topic of agile and test-driven database development.
Foreword xvii
Preface xix
Acknowledgments xxv
About the Authors xxvii
Chapter 1 Why, Who, and What 1
Why 1
Agility Progressively Invades Domains Every Day 2
Agility Cannot Work Without TDD 2
TDD in the Database World Is a Challenge 3
Who 3
TDD and OOP 4
Applications and Databases 4
What 4
Databases Are Objects 5
TDD Works on Classes, Not Objects 5
We Need Classes of Databases 6
Summary 7
Chapter 2 Establishing a Class of Databases 9
The Classs Role in TDD 9
A Reliable Instantiation Process 10
Tests Check Objects 10
Classes in Object-Oriented Programming Languages 11
Making Classes Is Easy: Just Make New Objects 11
One Path: Destroy If Necessary 11
Classes of Databases 12
Two Paths: Create or Change 12
The Hard Part: Unifying the Two Paths 13
Real Database Growth 13
How About Making Every Database Build Like Production Databases? 14
All DBs Would Follow the Exact Same Path 15
Incremental Build 15
Document Each Database Change 15
Identify Current Version 16
Apply Changes in Order as Needed 16
Implementation 16
Requirements 16
Pseudocode Database Instantiation Mechanism 17
Pseudocode Input 17
Summary 18
Chapter 3 A Little TDD 19
The Test-First Technique 19
Write the Test 20
Stub Out Enough to See a Failure 22
See the Test Pass 22
Repeat 23
Tests as Specifications 24
Tests Arent Tests, They Are Specifications 24
Tests Arent Specifications, They Are Tests 25
Tests Are Executable Specifications 26
Incremental Design 27
Building Good Specifications 28
Specify Behavior, Not Structure 28
Drive Design In from Without, Not the Other Way Around 29
Defining the Design Inside Out 30
Defining the Design Outside In 32
Summary 34
Chapter 4 Safely Changing Design 37
What Is Safe? 38
Breaking a Contract Is a Little Bad 38
Losing Data Wi...