Continuous Integration Comes to China www.electric-cloud.com
Agenda Time Topic Presenter 2:00 Introduction Tracy Shi Emdoor Technology 2:15 Continuous Integration Anders Wallgren, Electric Cloud 3:00 Practical 2:00 Slide 2
Continuous Integration Anders Wallgren CTO, Electric Cloud www.electric-cloud.com
Integration Hell Teams spend weeks or longer working separately Developer changes are infrequently built into the trunk Code bases and build environments diverge At some point all changes are integrated Teams spend weeks or longer verifying that applications work Time spent integrating is tortuous, leads to integration storms of broken builds Developers have to track down bugs introduced months earlier Projects are often late, overbudget and are of poor quality Slide 4
What is needed Frequent integration builds (multiple times per day) Find build issues earlier Smaller changes mean troubleshooting is easier Quicker feedback means you address problems when they are fresh A common, shared build environment for all kinds of builds Environment settings are common Reduces localized errors Speed Fast compile/link times Parallel build job steps Immediate feedback on changes Slide 5
The Solution Continuous Integration Continuous Integration is the practice of integrating early and often, so as to avoid the pitfalls of "integration hell". The ultimate goal is to reduce or eliminate rework and thus reduce cost and time. Slide 6
Continuous Integration As soon as changes are made, they are integrated with the trunk and run through the build and test cycle The goal is to be able to build the code base at any time Catch problems early, when they are less expensive to fix Get instant feedback on integration problems, when the problems are fresh in everyone s mind Slide 7
Continuous Integration Theory Check-In SCM System ElectricCommander Production Servers Integration Build Developer runs local build and automated tests Developer checks tested code into SCM system Integration build run at frequent intervals or upon check-in Build Success QA Slide 8
How do you get there? 1. Deploy an automated build and test infrastructure Stimulus builds: caused by changes in the SCM system Scheduled builds: nightly or weekly builds 2. Accelerate your builds Goal: One hour build and test cycle If necessary, choose a subset of tests to run Run more complete test suites during nightly or weekly scheduled builds 3. Make results visible The results should be visible to the entire team: emails, reports, LCD screens 4. Change your mindset Everyone commits code every day Every commit should build the mainline on an integration machine A broken builds get immediate attention Slide 9
Next Generation Continuous Integration: Preflights Continuous Integration delivers quality and productivity benefits But CI can break down The it worked on my machine phenomenon in a multiplatform environment Continuously broken builds The answer: preflight builds and tests A pilot goes through a rigorous preflight check routine prior to takeoff ElectricCommander preflights perform a continuous integration build prior to checking in the code Slide 10
Continuous Integration Reality Wait X Check-In Back Out X Wait SCM System ElectricCommander Production Servers Integration Build Developer builds/tests on local system, checks in code Integration build started, breaks ( it worked on my machine ) Team impacted while check-in is backed out or build fixed Build Failure Slide 11
Preflight: Continuous Integration Evolved ElectricCommander Success Success SCM System Developers build and test across all targets/platforms Ensures successful integration build Developers can check in changes only upon successful preflight Developers Test Servers Production Servers Broken builds less likely to affect the entire team Build or Test Failure Slide 12
Case Studies www.electric-cloud.com
Case study 1: Global mobile phone developer Global mobile phone developer Disparate processes across development organization using different home-grown systems Vision to: Reduce cycle time down from hours or even days Introduce CI and enable Agile methodologies Centralize management and administration Enable global collaboration across sites all over the world Optimize use of hardware and software resources Develop a scalable solution to support future growth inclusive of technology trends and sites Evaluated other commercial vendors as well as proprietary and open source solutions, but chose EC primarily for its proven enterprise and scalability features Slide 14
Case study 1: Workflow Schedule SCM submission IDE Preflight Manual Setup environment Install a new clean baseline Synchronize SCM changelist Compilation (all required targets) Static Code Analysis Emulator tests Hardware tests Coverity build Coverity analyze SCA SCA scan scan SCA SCA scan scan SCA SCA scan scan Code st. scan Line count SCA1 build SCA2 analysis Build test code Build ROM s Code Coverage Run Emulator tests Run Hardware tests Result analysis, Report generation, Notification, Release Tear down environment Slide 15
Case study 1: Architecture Slide 16
Case study 1: Status Highly appreciated and have had a great impact to the groups where it has been put in production Higher quality of deliverables Increased productivity Typical cycle time now at ~90 minutes, target 60 Build time ~10m down from 60m Static Analysis ~30m down from 2h 45m Test time ~50m down from 13h 30m Slide 17
Case Study 2: Broken Builds at BioWare Game development studio at Electronic Arts with 40 developers Manual build-and-test system Hundreds of broken builds a month Frustrated developers, missed schedules Two-pronged automation and acceleration approach Enabled preflight builds and tests, continuous integration Reduced overall build and test cycle by 75% 90% fewer broken builds Internal ROI case built upon two key areas The more broken builds the higher the cost More builds could be executed and defects found faster. Customer calculated 6X the build volume = $100 saved on a per build basis Improved their ability to release on schedule Cost break-even achieved within 3.5 months
Case Study: BioWare Problem: Challenging, complicated build-test matrix (Xbox, PS3, PC) Slow builds kept QA waiting and Developers avoiding afternoon checkins 300 broken builds per month Solution: ElectricAccelerator & ElectricCommander enabled frequent build & test Reduced build times from 2.5 hrs. to 15 min ElectricCommander preflights provided integration-quality build and test before commit Build Failures by Month Implemented Electric Cloud Solutions
Thank you! Anders Wallgren anders@electric-cloud.com Slide 20