Paul M. Duvall is chief technology officer of Stelligent Incorporated, a consulting firm that helps development teams reliably and rapidly produce better software by optimizing software production. He has worked in virtually every role on software development projects, from developer and tester to architect and project manager. Duvall consults in various industries, including finance, housing, government, health care, and software. He is the author and coauthor of many books, and actively blogs on http://testearly.com. Stephen M. Matyas III is vice president of AutomateIT, a service branch of 5AM Solutions. He has a varied background in applied software engineering, with much of his professional, hands-on experience being in the areas of enterprise Java and custom software development and services. Andrew Glover, president of Stelligent Incorporated, is a frequent speaker at conferences throughout North America, as well as author and coauthor of many books and online articles.
Foreword by Martin Fowler xiiiForeword by Paul Julius xv Preface xixAbout the Authors xxxiAbout the Contributors xxxiiiPart I: A Background on CI: Principles and Practices 1Chapter 1: Getting Started 3 Build Software at Every Change 4 Features of CI 12 Summary 20 Questions 20 Chapter 2: Introducing Continuous Integration 23 A Day in the Life of CI 25 What Is the Value of CI? 29 What Prevents Teams from Using CI? 32 How Do I Get to Continuous Integration? 33 When and How Should a Project Implement CI? 35 The Evolution of Integration 36 How Does CI Complement Other Development Practices? 37 How Long Does CI Take to Set Up? 38 CI and You 39 Commit Code Frequently 39 Don't Commit Broken Code 41 Fix Broken Builds Immediately 41 Write Automated Developer Tests 41 All Tests and Inspections Must Pass 42 Run Private Builds 42 Avoid Getting Broken Code 43 Summary 44 Questions 44 Chapter 3: Reducing Risks Using CI 47 Risk: Lack of Deployable Software 49 Risk: Late Discovery of Defects 53 Risk: Lack of Project Visibility 55 Risk: Low-Quality Software 57 Summary 62 Questions 62 Chapter 4: Building Software at Every Change 65 Automate Builds 67 Perform Single Command Builds 69 Separate Build Scripts from Your IDE 73 Centralize Software Assets 74 Create a Consistent Directory Structure 75 Fail Builds Fast 76 Build for Any Environment 77 Build Types and Mechanisms 78 Use a Dedicated Integration Build Machine 81 Use a CI Server 85 Run Manual Integration Builds 86 Run Fast Builds 87 Stage Builds 92 How Will This Work for You? 96 Summary 101 Questions 102 Part II: Creating a Full-Featured CI System 105Chapter 5: Continuous Database Integration 107 Automate Database Integration 110 Use a Local Database Sandbox 117 Use a Version Control Repository to Share Database Assets 119 Continuous Database Integration 121 Give Developers the Capability to Modify the Database 123 The Team Focuses Together on Fixing Broken Builds 124 Make the DBA Part of the Development Team 124 Database Integration and the Integrate Button 125 Summary 126 Questions 128 Chapter 6: Continuous Testing 129 Automate Unit Tests 132 Automate Component Tests 134 Automate System Tests 136 Automate Functional Tests 137 Categorize Developer Tests 138 Run Faster Tests First 141 Write Tests for Defects 143 Make Component Tests Repeatable 148 Limit Test Cases to One Assert 156 Summary 158 Questions 159 Chapter 7: Continuous Inspection 161 What Is the Difference between Inspection and Testing? 164 How Often Should You Run Inspectors? 165 Code Metrics: A History 166 Reduce Code Complexity 167 Perform Design Reviews Continuously 170 Maintain Organizational Standards with Code Audits 173 Reduce Duplicate Code 176 Assess Code Coverage 180 Evaluate Code Quality Continuously 182 Summary 185 Questions 186 Chapter 8: Continuous Deployment 189 Release Working Software Any Time, Any Place 191 Label a Repository's Assets 191 Produce a Clean Environment 194 Label Each Build 195 Run All Tests 196 Create Build Feedback Reports 196 Possess Capability to Roll Back Release 199 Summary 199 Questions 200 Chapter 9: Continuous Feedback 203 All the Right Stuff 205 Use Continuous Feedback Mechanisms 209 Summary 222 Questions 222 Epilogue: The Future of CI 223Appendix A: CI Resources 227 Continuous Integration Web Sites/Articles 227 CI Tools/Product Resources 229 Build Scripting Resources 232 Version Control Resources 233 Database Resources 234 Testing Resources 236 Automated Inspection Resources 239 Deployment Resources 241 Feedback Resources 241 Documentation Resources 243 Appendix B: Evaluating CI Tools 245 Considerations When Evaluating Tools 247 Automated Build Tools 255 Build Scheduler Tools 263 Conclusion 272 Bibliography 273Index 275