Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.
This is the Rough Cut version of the printed book.
The practice of Test-Driven Development (TDD) has helped thousands of software developers improve quality, agility, productivity, and speed. In Test-Driven Database Development, Max Guernsey, III shows how to adapt TDD to achieve the same powerful benefits in database design and development.Test-Driven Database Development is the newest title in the highly respected NetObjectives Lean-Agile Series.
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 Class’s 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 Aren’t Tests, They Are Specifications” 24
“Tests Aren’t 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 Will Probably Get Yo