Download - Continuous Integration
Agenda
Warm UpWhat’s CIBenefits of CI – WhyWhen to implement CIWho need to use CIHow to CIDemo
Warm Up
Do no harmPay me now or pay me more laterAgile: Working software vs. comprehensive documents
Do no harm!
Hippocratic oath – “First, do no harm!”
Pay me now or pay me more later
Working software vs. comprehensive documents
What is CI
A development methodologyOf daily developer integrationsVerified by automated builds
What is CI
- Is a software engineering practice in which isolated changes are immediately tested and reported on when they are added to a larger code base.
– A software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. -- Martin Flower
Martin Flower's Rules for CI
Maintain a single source repository.Automate the buildMake your build self-testingEveryone commits to the mainline every dayEvery commit should build the mainline on an integration mac
hineKeep the build fastTest in a clone of the production environmentMake it easy for anyone to get the latest executableEveryone can see what's happeningAutomate deployment
Value of CI
To make thingsBetterFaster Cheaper
Better
Better design– Make sure the software is testable
Better quality– That is tested early and often– Defects are detected and fixed sooner– Health of software is measurable– Always have a deployable software– That adheres to best practices– and coding standards– Greater software confidence
Better project visibility– “What do you mean the tests are failing?”– “What’s in version 1.2.3 of the build?”– “What’s our code coverage now?
Faster
Test in parallel, not at the endNo integration pointsBuilds become a non event
Cheaper
Identify defects earlierFix when least costlyEasily repeatable testingReduce repetitive manual effort
When to implement CI
When???
Implement early in the project
Who needs to use CI
DeveloperBuild masterQAProject managerAny others
How to Start
At least, daily checkin Automated build script A code repository A dedicated CI server Some rules
How to Start - Improve
Some more?- Code quality metric- Database integration- Document generation- Anything else?
How to Start - Martin Flower's Rule for CI
Maintain a single source repository.Automate the buildMake your build self-testingEveryone commits to the mainline every dayEvery commit should build the mainline on an integration mac
hineKeep the build fastTest in a clone of the production environmentMake it easy for anyone to get the latest executableEveryone can see what's happeningAutomate deployment
Best practices
Committing code frequently– Check in code at least daily
Categorizing developer testsMake the build fasterUsing a dedicated integration build machine
– Cruise Control, Hudson• Ant/xUnit/Maven/etc.
Using continuous feedback mechanisms (Email, SMS, etc)Staging builds
Best practices - Continued
Good practices - Attention!
Good process vs. Passive attitudeCI will be useless if developers always ignore CI reports
Demos -- Hudson Features
Easy installation – Written in Java
Easy configuration RSS/E-mail/IM integration JUnit/TestNG test reporting Distributed builds File fingerprinting Plug-in support Trend diagram shows build results
Demos – framework
Sonar for code qualityHudson for CISubversion for code repository
Demo
Now, Show me the Demo!
Open Discussion
Send email to [email protected] join the CI google wave
References
http://martinfowler.com/articles/continuousIntegration.htmlContinuous Integration: Improving Software Quality and Reducing Risk ---aut
hored by Paul Duvall http://www.integratebutton.com/index.htmlPractices of an Agile Developer https://hudson.dev.java.net/Appfuse: https://appfuse.dev.java.net
--Other stuffhttp://www.slideshare.net/carlo.bonamico/continuous-integration-with-hud
sonhttp://hudson.gotdns.com/wiki/ Using proxy:128.2.223.63, port:3128JBOSS's hudson website: http://hudson.jboss.org/hudson/ Lucene's hudson website: http://lucene.zones.apache.org:8080/hudson/http://www.selenic.com/mercurial/wiki/
Thanks