2. What is Continuous Integration? CI is a software development practice invented to: Ease integration Self test builds Reduce bug build up Increase automation Give greater project state visibility Allow developers to concentrate on coding
3. How is this achieved? It’s achieved by continually integrating (in other words checking in with the main branchfrequently) and then having every integration verified by automatically kicking off a tested build
5. Avoiding late bugs By integrating continually you know about more bugs in code ahead of time rather than just before release
6. Creating a more cohesive team Everybody integrates with everyone else frequently Avoid development ‘islands’ Know about merging difficulties ahead of time Avoid people saying “When did we decide to upgrade that jar to 2.0-alpha pre-release?” “I thought you fixed that months ago”
7. Enhancing project visibility Everyone (even non-developers!) can see the state of a project at any given time; now or in the past Generated reports for projects for things such as code test coverage, code style/warnings, change logs, bug checking etc Know what made (and broke!) a particular version of a deployed release
8. Create deployable software Software should, as much as possible, work CI helps developers keep their software deployable Which keeps release cycles short Which is good for business Stops “Well, it works on my machine”
9. Create better software Code is tested early and often Reports can show progress in meeting coding standards Test are done in parallel, not at the end No integration points Builds become a no-brainer Defects are identified earlier Defects are fixed when less costly Easily repeatable testing
10. This is the cool dude that came up with it: Martin Fowler http://www.martinfowler.com/articles/continuousIntegration.html
11. Martin Fowler’s 10 Principles of CI Maintain a single source repository Automate the build Make your build self testing Everyone commits all day, every day Every commit is built
12. Martin Fowler’s Principles cont… Keep the build fast Test in a clone of the production environment Make it easy for anyone to get the latest executable Everyone can see what is happening Automate deployment
13. Maintaining a Single Source Repository A version control repository has to include ALL needed sources to build And nothing else CVS, SVN, Git, etc… Issue: external dependencies Keep in repository, or Dependency management with repository of referenced binaries, e.g. maven, ivy
15. When to do a build At every check-in Not simply over night! Whenever a dependency changes
16. How to do a build Using a single build script Could use Ant Maven Make … Should be able to be run from the command line Should have no external dependency such as an IDE
17. When the build fails… Make sure it fails fast Fix it immediately! The world will continue to turn
18. Code inspections Test coverage tools reports highlight where to focus testing efforts Clover Cobertura Static Analysis tools read source code to check for best practices and identify weak spots Checkstyle Findbugs CI helps you track these over time Metrics can be established to ensure quality
19. Generating documentation CI can automatically generate documentation for every build Ensuring it is always current Removes the burden from developers Code inspection reports add to documentation