You are previewing Continuous Integration: Improving Software Quality and Reducing Risk.
O'Reilly logo
Continuous Integration: Improving Software Quality and Reducing Risk

Book Description

For any software developer who has spent days in “integration hell,” cobbling together myriad software components, Continuous Integration: Improving Software Quality and Reducing Risk illustrates how to transform integration from a necessary evil into an everyday part of the development process. The key, as the authors show, is to integrate regularly and often using continuous integration (CI) practices and techniques.

The authors first examine the concept of CI and its practices from the ground up and then move on to explore other effective processes performed by CI systems, such as database integration, testing, inspection, deployment, and feedback. Through more than forty CI-related practices using application examples in different languages, readers learn that CI leads to more rapid software development, produces deployable software at every step in the development lifecycle, and reduces the time between defect introduction and detection, saving time and lowering costs. With successful implementation of CI, developers reduce risks and repetitive manual processes, and teams receive better project visibility.

The book covers

  • How to make integration a “non-event” on your software development projects

  • How to reduce the amount of repetitive processes you perform when building your software

  • Practices and techniques for using CI effectively with your teams

  • Reducing the risks of late defect discovery, low-quality software, lack of visibility, and lack of deployable software

  • Assessments of different CI servers and related tools on the market

  • The book’s companion Web site, www.integratebutton.com, provides updates and code examples.

    Table of Contents

    1. Copyright
      1. Dedication
    2. The Addison-Wesley Signature Series
      1. The Addison–Wesley Signature Series
        1. Signers: Kent Beck and Martin Fowler
    3. Foreword by Martin Fowler
    4. Foreword by Paul Julius
    5. Preface
      1. What Is This Book About?
      2. What Is Continuous Integration?
      3. Who Should Read This Book?
        1. Developers
        2. Build/Configuration/Release Management
        3. Testers
        4. Managers
      4. Organization of This Book
        1. Part I: A Background on CI—Principles and Practices
        2. Part II: Creating a Full-Featured CI System
        3. Appendixes
        4. Other Features
      5. What You Will Learn
      6. What This Book Does Not Cover
      7. Authorship
      8. About the Cover
      9. Acknowledgments
    6. About the Authors
    7. About the Contributors
    8. I. A Background on CI: Principles and Practices
      1. 1. Getting Started
        1. Build Software at Every Change
          1. Developer
          2. Version Control Repository
          3. CI Server
          4. Build Script
          5. Feedback Mechanism
          6. Integration Build Machine
        2. Features of CI
          1. Source Code Compilation
          2. Database Integration
          3. Testing
          4. Inspection
          5. Deployment
          6. Documentation and Feedback
        3. Summary
        4. Questions
      2. 2. Introducing Continuous Integration
        1. A Day in the Life of CI
        2. What Is the Value of CI?
          1. Reduce Risks
          2. Reduce Repetitive Processes
          3. Generate Deployable Software
          4. Enable Better Project Visibility
          5. Establish Greater Product Confidence
        3. What Prevents Teams from Using CI?
        4. How Do I Get to “Continuous” Integration?
        5. When and How Should a Project Implement CI?
        6. The Evolution of Integration
        7. How Does CI Complement Other Development Practices?
        8. How Long Does CI Take to Set Up?
        9. CI and You
        10. Commit Code Frequently
        11. Don’t Commit Broken Code
        12. Fix Broken Builds Immediately
        13. Write Automated Developer Tests
        14. All Tests and Inspections Must Pass
        15. Run Private Builds
        16. Avoid Getting Broken Code
        17. Summary
        18. Questions
      3. 3. Reducing Risks Using CI
        1. Risk: Lack of Deployable Software
          1. Scenario: “It Works on My Machine”
            1. Solution
          2. Scenario: Synching with the Database
            1. Solution
          3. Scenario: The Missing Click
            1. Solution
        2. Risk: Late Discovery of Defects
          1. Scenario: Regression Testing
            1. Solution
          2. Scenario: Test Coverage
            1. Solution
        3. Risk: Lack of Project Visibility
          1. Scenario: “Did You Get the Memo?”
            1. Solution
          2. Scenario: Inability to Visualize Software
            1. Solution
        4. Risk: Low-Quality Software
          1. Scenario: Coding Standard Adherence
            1. Solution
          2. Scenario: Architectural Adherence
            1. Solution
          3. Scenario: Duplicate Code
            1. Solution
        5. Summary
        6. Questions
      4. 4. Building Software at Every Change
        1. Automate Builds
        2. Perform Single Command Builds
        3. Separate Build Scripts from Your IDE
        4. Centralize Software Assets
        5. Create a Consistent Directory Structure
        6. Fail Builds Fast
        7. Build for Any Environment
        8. Build Types and Mechanisms
          1. Build Types
            1. Private Build
            2. Integration Build
            3. Release Build
          2. Build Mechanisms
          3. Triggering Builds
        9. Use a Dedicated Integration Build Machine
        10. Use a CI Server
        11. Run Manual Integration Builds
        12. Run Fast Builds
          1. Gather Build Metrics
          2. Analyze Build Metrics
          3. Choose and Implement Improvements
            1. Use a Dedicated Integration Build Machine
            2. Increase Integration Build Machine(s) Hardware Capacity
            3. Improve Test Performance
        13. Stage Builds
          1. Examine Infrastructure
          2. Optimize the Build Process
          3. Build System Components Separately
          4. Improve Software Inspection Performance
          5. Perform Distributed Integration Builds
          6. Reevaluate
        14. How Will This Work for You?
          1. “My project has seven billion lines of code. How is this going to work for me?”
          2. “I have a legacy application, so how will this work for me?”
          3. “What if our source code is in multiple version control repositories?”
          4. “Our project is separated geographically, so how can we practice CI?”
          5. “My integration builds are taking too long!”
          6. “We frequently get build failures. Are we doing something wrong?”
          7. “We can’t afford a separate build machine.”
          8. “Our software is too complex; we have to do things manually” or “No—we have all sorts of stuff going on.”
          9. “Our software uses a version control repository, but we need to support multiple versions using branching. How will this work?”
        15. Summary
        16. Questions
    9. II. Creating a Full-Featured CI System
      1. 5. Continuous Database Integration
        1. Automate Database Integration
          1. Creating Your Database
          2. Manipulating Your Database
          3. Creating a Build Database Orchestration Script
        2. Use a Local Database Sandbox
        3. Use a Version Control Repository to Share Database Assets
        4. Continuous Database Integration
        5. Give Developers the Capability to Modify the Database
        6. The Team Focuses Together on Fixing Broken Builds
        7. Make the DBA Part of the Development Team
        8. Database Integration and the Integrate Button
          1. Testing
          2. Inspection
          3. Deployment
          4. Feedback and Documentation
        9. Summary
        10. Questions
      2. 6. Continuous Testing
        1. Automate Unit Tests
        2. Automate Component Tests
        3. Automate System Tests
        4. Automate Functional Tests
        5. Categorize Developer Tests
        6. Run Faster Tests First
          1. Unit Tests
          2. Component Tests
          3. System Tests
        7. Write Tests for Defects
        8. Make Component Tests Repeatable
        9. Limit Test Cases to One Assert
        10. Summary
        11. Questions
      3. 7. Continuous Inspection
        1. What Is the Difference between Inspection and Testing?
        2. How Often Should You Run Inspectors?
        3. Code Metrics: A History
        4. Reduce Code Complexity
        5. Perform Design Reviews Continuously
        6. Maintain Organizational Standards with Code Audits
        7. Reduce Duplicate Code
          1. Using PMD-CPD
          2. Using Simian
        8. Assess Code Coverage
        9. Evaluate Code Quality Continuously
          1. Coverage Frequency
          2. Coverage and Performance
        10. Summary
        11. Questions
      4. 8. Continuous Deployment
        1. Release Working Software Any Time, Any Place
        2. Label a Repository’s Assets
        3. Produce a Clean Environment
        4. Label Each Build
        5. Run All Tests
        6. Create Build Feedback Reports
        7. Possess Capability to Roll Back Release
        8. Summary
        9. Questions
      5. 9. Continuous Feedback
        1. All the Right Stuff
          1. The Right Information
          2. The Right People
          3. The Right Time
          4. The Right Way
        2. Use Continuous Feedback Mechanisms
          1. E-mail
          2. SMS (Text Messages)
          3. Ambient Orb and X10 Devices
            1. Ambient Orb
            2. X10 Devices
          4. Windows Taskbar
          5. Sounds
          6. Wide-Screen Monitors
        3. Summary
        4. Questions
      6. The Future of CI
    10. A. CI Resources
      1. Continuous Integration Web Sites/Articles
        1. Automation for the people: Continuous feedback
        2. Automation for the people: Continuous Inspection
        3. Automation for the people: Remove the smell from your build scripts
        4. Continuous Integration
        5. Continuous Integration
        6. Daily Build and Smoke Test
        7. IntegrateButton.com
        8. Realizing continuous integration
      2. CI Tools/Product Resources
        1. AnthillPro
        2. Apache Continuum
        3. Bamboo
        4. BuildForge
        5. Continuous Integration Server Matrix
        6. CruiseControl
        7. CruiseControl.NET
        8. Draco.NET
        9. Gauntlet
        10. Luntbuild
        11. ParaBuild
        12. PMEase QuickBuild
        13. Sin
        14. Other CI Tools and Product Resources
      3. Build Scripting Resources
        1. Ant
        2. Groovy
        3. Maven
        4. NAnt
        5. Rake
      4. Version Control Resources
        1. ClearCase
        2. Concurrent Versions System (CVS)
        3. MKS
        4. Subversion
        5. Other Version Control Resources
      5. Database Resources
        1. Hypersonic DB
        2. Mckoi
        3. MySQL
        4. Oracle
        5. PostgreSQL
      6. Testing Resources
        1. Agitator
        2. DbUnit
        3. Fit
        4. FitNesse
        5. Floyd
        6. HtmlUnit
        7. JUnit
        8. JWebUnit
        9. NDbUnit
        10. NUnit
        11. Selenium
        12. SQLUnit
        13. TestEarly.com
        14. TestNG
        15. utPLSQL
        16. Watir
        17. xUnit Test Patterns
      7. Automated Inspection Resources
        1. Checkstyle
        2. Clover
        3. Cobertura
        4. EMMA
        5. FindBugs
        6. FxCop
        7. JavaNCSS
        8. JDepend
        9. NCover
        10. NDepend
        11. PMD
        12. Simian
        13. SourceMonitor
      8. Deployment Resources
        1. Capistrano (formerly SwitchTower)
      9. Feedback Resources
        1. Ambient Devices
        2. GoogleTalk
        3. Jabber
        4. X10
        5. Others
      10. Documentation Resources
        1. Doxygen
        2. Javadoc
        3. NDoc
    11. B. Evaluating CI Tools
      1. Considerations When Evaluating Tools
        1. Functionality
          1. Build Tools—Essential Functionality
          2. Build Tools—Extended Functionality
          3. Build Schedulers—Essential Functionality
          4. Build Schedulers—Extended Functionality
        2. Compatibility with Your Environment
        3. Reliability
        4. Longevity
        5. Usability
      2. Automated Build Tools
        1. Ant
        2. Maven 1
        3. Maven 2
        4. NAnt
        5. Rake
      3. Build Scheduler Tools
        1. AnthillPro
        2. Continuum
        3. CruiseControl
        4. CruiseControl.NET
        5. Draco.NET
        6. Luntbuild
      4. Conclusion
    12. Bibliography