3. Who Am I?
• Principal of OpenSource
Connections
• Contributer to CruiseControl
and Continuum CI projects
• Member of Apache Software
Foundation
• Presenter at conferences
(OSCON, ApacheCON, jTDS,
ExpoQA, STPcon)
• Fascinated by the art of
software development
3
11. Definition
a fully automated and reproducible build, including testing, that
runs many times a day - Martin Fowler
http://martinfowler.com/articles/continuousIntegration.html
11
12. Martin Fowler
• Coined the term
Continuous Integration
• Chief Scientist for
ThoughtWorks
• Speaks and Blogs on
software:
• http://martinfowler.com/
12
13. Mapping
diagram credit to Brian Di Croce @ http://blog.briandicroce.com/2008/03/17/setting-up-a-continuous-
integration-environment-preface/
13
14. Activity
Turn to the person next to you, and see how many
non-obvious things you have in common.
14
15. Arm Bands!
• Elisabeth Hendrickson is
TestObsessed.com
• Focuses on Testing in the Agile
community
• Really great blogger: Specialized
Test Management Systems are an
Agile Impediment and Adventures
with Auto-Generated Tests and
RSpec are typical posts
15
22. Feedback Mechanism
From:
cruisecontrol@opensourceconnections.com
ubject:
[CruiseControl] agenda_direcciones build 370 fixed
S
Date:
October 7, 2008 2:22:50 PM EDT
To:
epugh@opensourceconnections.com
The build has been fixed.
CHANGES
-------
New revision 370 detected
Revision 370 committed by epugh on 2008-10-07 18:22:03
mysql esta mejor que sqlite
M /branches/ERIC_EXPO_08_DEMO/agenda_direcciones/config/database.yml
See http://cruise.opensourceconnections.com:3333/builds/agenda_direcciones/370 for details.
22
23. photo credit to Jay Grieves @ www.bigswingingdeveloper.com
23
25. Source Code
Compilation
• Eclipse “Export to War”
is NOT the solution
25
26. Database Integration
• Database is integral to • Don’t require a multi gig
your code database file to run
tests!
• DDL, stored
procedures are • Look at techniques like
treated as source fixtures or mock objects
to reduce database
• Involve your DBA in coupling
your project
• Developers need
• DBUnit for Java database sandbox
projects!
26
27. Testing
with out testing, CI is just a glorified compiler- Eric Pugh
• Testing proves the intent
of the programmer was
met.
• Typically provides the
“checkability” that James
Bach talks about
• Multiple Levels of testing
27
33. Life with out CI
• Unstable code, integration is difficult
• Many build errors reported
• Only one person on the team can build
the entire project
• Getting “test ready” product is hard
• Feedback cycle is long
• Same bug keeps coming back
Every day is a struggle to be productive
33
34. Life with CI
• The build process is simple and
repeatable
• Elimination of Human Error
• Bugs stay fixed!
• Feedback cycle is very rapid
Every day you know you can produce better software!
34
35. Risk Reduction
• What is in the build?
• What has changed
between builds?
• How do I verify
functionality?
35
39. Make Painful Things
Painless!
photo credit to Paul Duvall @ http://www.integratebutton.com/
39
40. Produce Deployable
Software
• It’s what we are here to do!
• Always in a “Demo Ready” state
• No last minute administrivia tasks to get
the product ready
• Installer is built
• Documentation is written
• Changelog is written
40
50. Activity
Exquisite corpse (also known as "exquisite
cadaver" or "rotating corpse") is a method
by which a collection of words or images is
collectively assembled, the result being
known as the exquisite corpse or cadavre
exquis in French.
50
53. Fear of Commitment
• Developers and Testers
need to commit changes
frequently!
• Incremental small changes
make finding integration
issues simpler
drawing credit to Tom Armitage @ http://infovore.org/archives/2007/03/14/the-continuous-integration-
barometer/
53
56. • CI needs a champion who acts as the
ambassador to the leaders of the
organization.
• Thought leaders in the organization who
can help encourage team to accept the
process changes that CI brings
• A very successful test case
• A greenfield project if possible
56
59. Testability
• Modularity? • Perform code
complexity analysis to
• Coupling to underlying see if some parts are
more amenable to
platform?
testing.
• Requires external
services to be up and
available for testing?
59
62. Invest in CI Server
• The CI system must be as well
X
maintained as the Source Control
system.
• The CI system performs builds very
✓
quickly.
• Who has responsibility for CI? It’s very
important to have a “throat to choke”.
• No false alarms. If there are false
alarms then the team loses confidence
in the CI system.
62
67. Multi Stage CI
• Reduce the amount of
integration required
• Teams integrate as
modules are marked as
ready.
• Maven2 was built with
this in mind!
Damon Poole @ http://damonpoole.blogspot.com/2008/01/advanced-multi-stage-continous.html
67
68. Break up Tests
• “preflight” or “smoke” tests
• longer integration tests
• periodic full site generation and report
generation
68
69. Predictive Testing
• Some commercial tools support predicting
which tests will fail based on previous
behavior, and running those first!
69
70. Cup of Coffee Metric
What happens in the time it takes to get a cup of coffee can
tell you a lot about the quality of your continuous integration
system. - Paul Julius
• Builds shouldn’t take any longer!
• Getting a cup of coffee or drink of
water breaks up your day
• Gives you a chance to review your
work
• Requires a moduler fast build
http://pauljulius.com/blog/2009/09/14/cup-of-coffee-metric-for-continuous-integration/
70
71. Paul Julius
• co-founder of CITCON
• Original developer of
CruiseControl
• Speaks and Blogs on CI
extensively
• http://pauljulius.com/blog/
71
72. Virtuous Circle
• Metrics are hard to get
• Teams (Developers?)
rebel against on high
management
• Need good processes
that support and
encourage other good
processes
72
81. CI on a Dollar a Day
"From now on, our code in revision control will always build
successfully and pass its tests.". - James Shore
• Build Computer
• Ridiculous Toy
• Annoying Bell
• Automated Build
• Group Agreement
http://jamesshore.com/Blog/Continuous-Integration-on-a-Dollar-a-Day.html
81
82. credit to Paul Julius @ http://www.anthillpro.com/blogs/anthillpro-blog/2009/09/11/
enterprise_ci_cultural_maturity.html
82
83. Lots of
advanced
techniques!
credit to Christine Mitterbauer @ Microdoc
83
90. Hand Rolled System
Pros Cons
Complete control of Rolling your own can take
configuration more work
Data and code inside Dealing with disparate
firewall platform elements is harder
Works with any type of Multiple kinds of projects can
system be hard to manage
Must provide Sys Admin
Cheapest
work
90
91. CI Matrix
Matrix of differences between CI tools: http://tinyurl.com/39hol7
91
92. Cloud Based Solution
Pros Cons
Data and Code outside
Very Scalable
firewall
Use CPU resources only
Cloud computing still new
when needed
Deal well with multiple
GUI apps hard to test
kinds of projects
Must provide Sys Admin
?
work
92
93. CI in a Box
• Amazon EC2 Hosted
instance
• http://www.ciinabox.com/
93
94. Hosted Solution
Pros Cons
Typically limited in language
Very Scalable
support
data and code outside
No Sys Admin tasks
firewall
Pricing is fairly
GUI apps hard to test
straightforward
? vendors are still new
94