Buy Test-Driven Database Development by Max Guernsey
close menu
Bookswagon
search
My Account
Home > Computing and Information Technology Books > Databases > Test-Driven Database Development: Unlocking Agility
Test-Driven Database Development: Unlocking Agility

Test-Driven Database Development: Unlocking Agility


     0     
5
4
3
2
1



Out of Stock


Notify me when this book is in stock
X
About the 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.

Guernsey first explains why TDD offers so much potential to database practitioners, and how to overcome obstacles such as the lack of conventional “testable classes.” You’ll learn how to use “classes of databases” to manage change more effectively; how to define testable database behaviors; how to maximize long-term maintainability by limiting a database’s current scope; and how to use “emergent design” to simplify future expansion.

Building on this foundation, the author guides you through implementing modern TDD processes and database refactoring. He presents practical techniques for improving legacy databases; for deviating from strict TDD when necessary; and for adapting TDD to applications that persist data in file systems, XML, or serialized objects. Guernsey shows how to

•  Build a simple infrastructure to track and standardize scripts and databases
•  Define a sustainable TDD process for database design
•  Safely change a design without losing data
•  Design new databases that are lighter, leaner, simpler, more testable, and easier to change
•  Reduce design costs by eliminating duplication
•  Gradually bring the benefits of TDD, agility, and modern design to legacy databases
•  Remediate errors that find their way into database designs
•  Isolate behaviors and avoid unwanted dependencies that cause tests to fail

With this book as a guide, you will learn how to apply the proven practice of TDD to your database needs, and organize and optimize your organization’s data for a significant competitive advantage.
 

Test-Driven Database Development is the newest title in the highly respected NetObjectives Lean-Agile Series.



Table of Contents:
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 You Fired 39
Not Changing Design Is Also Dangerous 40
Solution: Transition Testing 44
Test-Driving Instantiation 44
Transition Testing Creation 44
Transition Testing Addition 47
Transition Testing Metamorphosis 51
Why Not Use the Public Interface? 56
Transition Safeguards 56
Read/Read Transition Tests 56
Run by the Class of Databases on Every Upgrade 60
Backup and Rollback on Fail 60
Making Transition Tests Leverage Transition Safeguards 60
Summary 61

Chapter 5 Enforcing Interface 63
Interface Strength 64
Stronger Coupling Languages 64
Weaker Coupling Languages 65
The Common Thread 66
Coupling to Database Classes 66
The Problem Is Duplication 66
Client-Object-Like Enforcement 67
Creating Demand for a DatabaseDesign Class 67
Specifying the DatabaseDesign Class 68
Getting Rid of Duplication with Multiple Client Platforms 70
What Happens When Coupling Goes Bad? 71
Eliminating Duplication Between Database Build and Client Code 71
Decoupling Implementation from Design 72
Sticking Point: Change 73
Designs Change Over Time 74
Document All Versions of Design 75
Couple to the Correct Version of the Design 77
Sticking Point: Coupling 78
Various Clients Couple to Various Versions 78
Having to Change Everything All the Time Is Duplication, Too 79
Introducing the Lens Concept 83
Virtual Lenses 85
The “Current” Lens 89
The “New” Lens 89
Summary 93

Chapter 6 Defining Behaviors 95
A New Group of Problems 96
No Encapsulation 96
Hide Everything 97
Business Logic in the Database 97
Knowledge, Information, and Behavior 98
Information 99
Knowledge 102
Behavior 102
Outside-In Development 106
Defining the Test 106
Growing Interface 108
Growing Behavior and Structures 109
Justification by Specification 111
Work Against Present Requirements, Not Future 111
Build in Increments 112
Limit Access to What Is Specified 112
Summary 113

Chapter 7 Building for Maintainability 115
Never Worry About the Future 116
Look for Opportunities in the Now 116
Design to Information 117
Translate Info and Knowledge with Behavior 121
Guard Knowledge with Fervor and Zeal 124
Not Changing Is the Most Dangerous Choice 124
Keep Your Design Natural 126
Deal with the Future When It Happens 127
Define New Design 128
Introduce Minimal Changes 129
Get Tests Passing 131
Stop, Think, Refactor 133
Summary 136

Chapter 8 Error and Remediation 137
Kinds of Errors 137
Axis: Is the Error Good or Bad? 138
Axis: Is the Error Released or Not? 140
Dealing with Good Errors 142
Just Fix It 142
Document Behavior Now 143
Trace Feature Back to Its Genesis 145
Dealing with Bad Errors 146
Unreleased Errors 147
Released Errors 150
Catastrophic Errors 156
Summary 157

Chapter 9 Design 159
Structures Versus Design 160
Structures: Execution Details 160
Tests and Class Information 162
What Is Design? 163
Buckets of Concepts 163
Mandatory Part of True TDD 166
Composition and Aggregation 167
Composition: One Thing with Multiple Parts 168
Aggregation: Connecting Distinct Things 172
Reuse 175
Avoid Developing the Same Thing Twice 175
Reuse by Composition or Aggregation 177
Abstraction 178
Identifying Opportunities for Abstraction 178
Encapsulating Behaviors 179
Finding Ways to Allow Variation in Dependencies 185
Dealing with the Time Problem 186
Summary 190

Chapter 10 Mocking 191
Testing Individual Behaviors 191
Why Encapsulate 192
Tests Test Everything Not Under Their Control 193
Controlling Irrelevant Behaviors from Tests 194
Mocking Controls Behaviors 194
Mocking in Object-Oriented Programming 195
Setup 195
Decoupling 199
Isolation 202
Integration 202
Mocking in Database Design 203
Example Problem 204
Example Solution 205
Composition 208
Aggregation 210
Designing for Testability 210
Summary 210

Chapter 11 Refactoring 213
What Refactoring Is 214
Changing Design Without Changing Behavior 214
In the Context of Passing Tests 215
Lower and Higher Risk Design Changes 222
Lower Risk: Changing Class-Level Design 222
Medium Risk: Rearranging Behavior Logic 223
Higher Risk: Altering Knowledge Containers 225
This Is Not an Invitation to Skip Testing 226
Summary 226

Chapter 12 Legacy Databases 227
Promoting to a Class 228
Deducing Initial Version 228
Pinning the Transition Behavior with Tests 231
Controlling Coupling 231
Identifying and Locking Down to Existing Uses 232
Encapsulating on Demand 234
Controlling Change 235
Test-Driving New Behaviors 235
Pinning Construction on Demand 237
Pinning Behavior on Demand 238
Implementing New Behavior 239
Finding Seams and Components 240
Finding Seams 240
Encapsulating Components 243
Summary 247

Chapter 13 The Façade Pattern 249
Encapsulation with a Façade 249
Explanation of Façade Pattern 250
New Test-Driven Façade Database 254
Compositional Alternative 261
To Encapsulate or Not 261
Strangling the Old Interface 262
Transferring Changing Behaviors to Façade 262
Removing Access and Features When No Longer Needed 263
Test-Driving Behaviors in the Façade Database 264
Exposing Legacy Behaviors 265
Another Way to Do It 265
New Behaviors 266
Summary 266

Chapter 14 Variations 269
Having a Class Is Important—Implementation Is Not 270
Scenario: Skipping Steps 270
Problem 271
Solution 272
The Right Amount of Work 273
Scenario: Deviations 274
Problem 274
Solution 275
Solution Applied 277
Common Solution 281
Summary 281

Chapter 15 Other Applications 283
XML 284
Encapsulation 284
XSD Schemas 284
XSLT Transitions 286
Transition Test XSLT Changes 287
File Systems and Other Object Directories 288
Transition Test File System Manipulations 289
Shell Script Transitions 291
Data Objects 292
Class Definitions Are Schemas 292
Transition Test the Ugrader Class 294
Code Transitions 296
Summary and Send Off 300

Index 301




About the Author :
Max Guernsey is currently a Managing Member at Hexagon Software LLC. He has 15 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. For much of Max’s professional career, he has been a consultant, advising a variety of software companies in many different industries using multiple programming and database technologies. In most of these engagements, he spent months or even years helping teams implement cutting-edge techniques such as test-driven development, object-oriented design, acceptance-test-driven development, and agile planning.

Max has always been a “hands-on” consultant, working with teams for long periods of time to help them build both software and skills. This series of diverse, yet deep, engagements helped him gain a unique understanding of the database-related testing and design problems that impede most agile teams. Since 2005, he has been thinking, writing, blogging, lecturing, and creating developer-facing software dedicated to resolving these issues.

Max posts regularly on his Twitter account (@MaxGuernseyIII) and his blog ( maxg3prog.blogspot.com).


Best Sellers


Product Details
  • ISBN-13: 9780321784124
  • Publisher: Pearson Education (US)
  • Publisher Imprint: Addison-Wesley Educational Publishers Inc
  • Height: 230 mm
  • No of Pages: 352
  • Sub Title: Unlocking Agility
  • Width: 177 mm
  • ISBN-10: 032178412X
  • Publisher Date: 07 Mar 2013
  • Binding: Paperback
  • Language: English
  • Spine Width: 18 mm
  • Weight: 542 gr


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
Test-Driven Database Development: Unlocking Agility
Pearson Education (US) -
Test-Driven Database Development: Unlocking Agility
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Test-Driven Database Development: Unlocking Agility

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    Fresh on the Shelf


    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!
    Your IP: 216.73.216.43 IN