Presented at STPcon 2011 on leveraging your automated tests by putting them under CI. Covers value proposition of CI, challenges to implement, and ideas for scaling.
2. WHY AM I QUALIFIED TO BE
UP HERE?
⢠President of OpenSource
Connections
⢠Contributor to CruiseControl
and Continuum CI projects
⢠Member of Apache Software
Foundation
⢠Presenter at conferences
(OSCON, ApacheCON, jTDS,
ExpoQA, STPcon 2009!)
9. DEFINITION
a fully automated and reproducible build, including testing, that
runs many times a day - Martin Fowler
http://martinfowler.com/articles/continuousIntegration.html
10. MARTIN FOWLER
⢠Coinedthe term
Continuous Integration
⢠Chief
Scientist for
ThoughtWorks
⢠Speaksand Blogs on
software:
⢠http://martinfowler.com/
12. MAPPING
diagram credit to Brian Di Croce @ http://blog.briandicroce.com/2008/03/17/setting-up-a-continuous-integration-
environment-preface/
13. FEEDBACK MECHANISM
From: cruisecontrol@opensourceconnections.com
Subject: [CruiseControl] agenda_direcciones build 370 ďŹxed
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.
15. ACTIVITY
Turn to the person next to you, and see how many
non-obvious things you have in common.
16. LIFE WITH OUT CI
⢠Unstable code, integration is difďŹcult
⢠Many build errors reported
⢠Only one person on the team can
build the entire project
⢠Getting âtest readyâ state is hard
⢠Feedback cycle is long
Every day is a struggle to be productive
17. LIFE WITH CI
⢠The build process is simple
and repeatable
⢠Elimination of Human Error
⢠Bugs stay ďŹxed!
⢠Feedback cycle is very rapid
Every day you know you can produce better software!
23. MAKE PAINFUL THINGS
PAINLESS!
photo credit to Paul Duvall @ http://www.integratebutton.com/
24. 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
37. FEAR OF COMMITMENT
⢠Developers and Testers need to
commit changes frequently!
⢠Incremental small changes make
ďŹnding integration issues simpler
drawing credit to Tom Armitage @ http://infovore.org/archives/2007/03/14/the-continuous-integration-barometer/
40. ⢠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 greenďŹeld project if possible
41. 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
42. credit to Paul Julius @ http://www.anthillpro.com/blogs/anthillpro-blog/2009/09/11/
enterprise_ci_cultural_maturity.html
44. TESTABILITY
⢠Modularity? ⢠Perform code complexity
analysis to see if some parts
⢠Coupling to underlying are more amenable to
platform? testing.
⢠Requiresexternal services
to be up and available for
testing?
47. 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!
⢠Gettinga cup of coffee or drink
of water breaks up your day
⢠Givesyou 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/
48. PAUL JULIUS
⢠co-founder of CITCON
⢠Original
developer of
CruiseControl
⢠Speaksand Blogs on CI
extensively
⢠http://pauljulius.com/blog/
52. INVEST IN CI SERVER
X
⢠The CI system must be as well 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 conďŹdence in the CI system.
â˘
59. MULTI STAGE CI
⢠Reduce the amount of
integration required
⢠Teamsintegrate 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
60. BREAK UP TESTS
⢠âpreďŹightâ or âsmokeâ tests
⢠longer integration tests
⢠periodic full site generation and report generation
62. PARALLELISM
⢠Ifyour suite of
tests take 24
hours to run, can
you spin it up on
24 machines and
take an hour?
⢠Testing a web
application with
Selenium?
Selenium Grid!
65. PREDICTIVE TESTING
⢠Some commercial tools support predicting which tests will fail
based on previous behavior, and running those ďŹrst!
66. DONâT DO IT ALL AT ONCE
⢠Justlike when embarking on a new exercise program, donât
just go full tilt, work up to it!
⢠Start
with the tests that are easily put under CI ďŹrst, then
move up the food chain.
67. SLIDING âWINDOWâ
⢠For a test suite that takes a
week to run, can you take a
sliding chunk, plus some
random tests?
⢠Ideas
from DNA
sequencing!
⢠http://en.wikipedia.org/
wiki/DNA_sequencing
72. Donât forget the people aspect!
credit to Paul Julius @ http://www.anthillpro.com/blogs/anthillpro-blog/2009/09/11/
enterprise_ci_cultural_maturity.html
Wrap up should have plenty of time for questions\n
\n
\n
\n
\n
\n
the build on the left for “agenda direcciones” produced the email on the right. \n
\n
Turns out that is what CI is for, discovering the non obvious!\n
\n
\n
\n
\n
checkability requires control and visibility into your app\n
\n
war file deployment is a pain\n
\n
\n
\n
\n
tester who knows that there are no silly integration bugs delaying work!\n
not what we are trying to do. \n
\n
Human error was behind major industrial disasters such as three mile island. NASA lost the 125 million dollar Mars Climate Orbiter because Lockheed used english units while Nasa used metric when working with navigation data. Clearly not enough integration between the teams!\n
Talk about Seymour, the build master, and the big weekend build, and you have to come in. And the time that I forgot to check in all my code. \n
\n
The CI book makes this point: if something is painful, do it often till you solve the problem.\n
\n
\n
\n
\n
\n
bangalore India...\n
\n
\n
\n
This is a “glanceable” device, or ambient information.\n
\n
\n
\n
\n
we need soemthing tell us how far away we are getting from mailine\n
\n
\n
\n
\n
not just a build loop, it’s a people loop!\n\nJames Shore touched on something really important back in his 2006 blog article "Continuous Integration on a Dollar a Day".\n
Mention the jesters cap at VA..\n
\n
Look at the Panopticode Report in dasher\n
\n
\n
\n
\n
\n
\n
\n
tell about CI system running great for 6 months... only cause the smtp server was rejecting all build status email from being sent!\n
\n
Remember the Ginsu Knife? “How much would you pay for this?” “But wait! There's more”. Sold between 2 and 3 million sets between 78 and 84 and invented the modern infomerical\n
\n
\n
\n
This is really about an existing suite of tests that are NOT under CI.\n
\n
some folks argue this isn’t really an issue if integration is constantly happening in very small chunks. \n
\n
\n
\n
\n
Of course you need virtualized servers to make this work\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
not just a build loop, it’s a people loop!\n\nJames Shore touched on something really important back in his 2006 blog article "Continuous Integration on a Dollar a Day".\n
\n
\n
\n
market for both open source and commercial has exploded.\n