28

Continuous Integration

Embed Size (px)

DESCRIPTION

Continuous Integration

Citation preview

Page 1: Continuous Integration
Page 2: Continuous Integration

Continuous Integration

Perficient ChinaJoseph Wang

[email protected]

Page 3: Continuous Integration

Agenda

Warm UpWhat’s CIBenefits of CI – WhyWhen to implement CIWho need to use CIHow to CIDemo

Page 4: Continuous Integration

Warm Up

Do no harmPay me now or pay me more laterAgile: Working software vs. comprehensive documents

Page 5: Continuous Integration

Do no harm!

Hippocratic oath – “First, do no harm!”

Page 6: Continuous Integration

Pay me now or pay me more later

Page 7: Continuous Integration

Working software vs. comprehensive documents

Page 8: Continuous Integration

What is CI

A development methodologyOf daily developer integrationsVerified by automated builds

Page 9: Continuous Integration

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

Page 10: Continuous Integration

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

Page 11: Continuous Integration

Value of CI

To make thingsBetterFaster Cheaper

Page 12: Continuous Integration

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?

Page 13: Continuous Integration

Faster

Test in parallel, not at the endNo integration pointsBuilds become a non event

Page 14: Continuous Integration

Cheaper

Identify defects earlierFix when least costlyEasily repeatable testingReduce repetitive manual effort

Page 15: Continuous Integration

When to implement CI

When???

Implement early in the project

Page 16: Continuous Integration

Who needs to use CI

DeveloperBuild masterQAProject managerAny others

Page 17: Continuous Integration

How to Start

At least, daily checkin Automated build script A code repository A dedicated CI server Some rules

Page 18: Continuous Integration

How to Start - Improve

Some more?- Code quality metric- Database integration- Document generation- Anything else?

Page 19: Continuous Integration

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

Page 20: Continuous Integration

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

Page 21: Continuous Integration

Best practices - Continued

Page 22: Continuous Integration

Good practices - Attention!

Good process vs. Passive attitudeCI will be useless if developers always ignore CI reports

Page 23: Continuous Integration

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

Page 24: Continuous Integration

Demos – framework

Sonar for code qualityHudson for CISubversion for code repository

Page 25: Continuous Integration

Demo

Now, Show me the Demo!

Page 26: Continuous Integration

Open Discussion

Send email to [email protected] join the CI google wave

Page 27: Continuous Integration

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/

Page 28: Continuous Integration

Thanks