CONTINUOUS INTEGRATION

IN AGILE SOFTWARE DEVELOPMENT
Presented by Onur Yaman 2010719258 Bogazici University – Software Engineering

Overview
•  General Definitions •  Problem Statement •  Solution Proposal •  Continuous Integration Description •  Why Continuous Integration? •  Martin Fowler’s 10 CI Practices •  Example Scenario •  Conclusion

Definition: What is software integration?
•  Integration is combining parts so that they work together

or form a whole.
•  In software integration, we: •  Combine separately produced components/subsystems •  Address problems in their interactions •  Ensure that the components/ subsystems function together as a system

Problem: Integration is hard!
•  Integration is a long and unpredictable process •  Bugs are always there •  Integration efforts increase exponentially with: •  Number of bugs •  Number of components •  Time since last integration •  Results of long integration process: •  Overhead in development process •  Loss of money •  Loss of market opportunity

Solution: Continuous Integration (CI)
•  A software development practice •  Members of a team integrate their works frequently (at

least daily), hence multiple integrations per day •  Controlled source code repository
•  Don’t commit broken code •  Fix broken code immediately •  Avoid getting broken code

•  Integration verification by an automated build •  Write automated developer tests •  All tests and inspections must pass •  Run private builds •  No particular tooling required to deploy

Solution: Continuous Integration (CI)
•  Build software at every change: •  Compilation •  Testing •  Inspection •  Deployment

Why use CI?
•  Benefits of Continuous Integration: •  Reduce risks •  Reduce repetitive manual processes •  Generate deployable software at any time and at any place •  Enable better project visibility
•  Effective decisions •  Noticing trends

•  Establish greater confidence in

the software product from the development team

Fowler’s CI Practices
1.  Maintain a single source repository 2.  Automate the build 3.  Make your build self-testing 4.  Everyone commits to the mainline every day 5.  Every commit should build the mainline on an

integration machine 6.  Keep the build fast 7.  Test in a clone of the production environment 8.  Make it easy for anyone to get the latest executable 9.  Everyone can see what’s happening 10.  Automate deployment

How does it work?
•  Example workflow:
1.  2.  3.  4. 

5.  6. 

7. 

Tim sees that the last integration build is successful (a few mins ago) He was said to fix the too much duplicate code (based on reports) He refactors code He runs a private build (it compiles and runs unit tests against the newest source code) After the build is successful, he commits his changes In a few minutes, the CI server discover the changes and runs an integration build (inspection tools are used) The CI server tells that the operation was successful

Conclusion
•  Continuous Integration has many benefits for a project

team •  It’s not a must; but a better-win •  Various CI server exist (some of them are open-source projects) and their usage is offered
•  Examples: CruiseControl, Go, Hudson, Apache Continuum