Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous...

28
Continuous Integration [email protected] 1 Monday, 29 September 2008

Transcript of Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous...

Page 1: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Continuous [email protected]

1Monday, 29 September 2008

Page 2: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Why?

• Catch bugs

• Get rid of merge hell

• Make teams more efficient

Photo by Osama ALASSIRY

2Monday, 29 September 2008

Page 3: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

How?

• Fast Feedback

• Repeatability

• Collective Ownership

3Monday, 29 September 2008

Page 4: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Core Practices

• Single Source Repository

• Automate Build

• Automate Testing

• Publish the Latest Distributable

Photo by teclasorg

4Monday, 29 September 2008

Page 5: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Single Source Repository

• Single point of truth

• Everyone's code in the same place

• NOT a branch per developer

• Shared ownership

5Monday, 29 September 2008

Page 6: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Automate Build

• Using the IDE is not automating!

• Use a build tool

• Compile, package, test

6Monday, 29 September 2008

Page 7: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Automate Testing

• Not just Unit Tests

• Failing tests fail the build

• Fix it if it’s broken or you’re wasting your time

7Monday, 29 September 2008

Page 8: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Publish Latest Distributable

• Make it easy to get the final product

• Should only be built once

• Configuration is separate

8Monday, 29 September 2008

Page 9: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Evolution

• Practice

• Language

• Tools

9Monday, 29 September 2008

Page 10: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Practice Evolution• Everyone commits more

often

• Every commit should build

• Test in production clone

• Keep the build fast

• Everyone sees what’s happening

• Automate deployment

10Monday, 29 September 2008

Page 11: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Commit More Often

• “At least once a day” - aim for at least once an hour

• Needs a small unit of work

• To commit cleanly you need to update first

11Monday, 29 September 2008

Page 12: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Every Commit Builds

• It’s all about fast feedback

• Small changes

• Less to merge and/or fix

12Monday, 29 September 2008

Page 13: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Test in Production Clone

• Detect multi-threaded or cluster issues

• Tests system architecture

• Includes databases!

13Monday, 29 September 2008

Page 14: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Keep Build Fast

• It really is all about feedback

• If things break you find out about it while it’s still fresh in your mind

• Keep up with frequent check ins

14Monday, 29 September 2008

Page 15: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Everyone Sees What’s Happening

• Reduce time to fix

• No excuse to check in on broken build

• It’s not about blame, it’s about feedback

15Monday, 29 September 2008

Page 16: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Automate Deployment

• Reduce Human Error

• Verify you can get it running somewhere other than “my machine”

• Test not only the code but your deployment mechanism too

16Monday, 29 September 2008

Page 17: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Language Evolution

• Repository

• Build

• Integrate

• Test

17Monday, 29 September 2008

Page 18: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Build• Compile

• Link

• Run Tests

• Analyse Code

• Package

• Deploy

18Monday, 29 September 2008

Page 19: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Integrate• Team members on a

project getting their code to work together

• Getting projects working together

• Other systems

• Other libraries

19Monday, 29 September 2008

Page 20: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Test• Just test my code in

isolation

• It compiles, I’m done

• Manual testing

• Unit Tests

• Integration Tests

• Acceptance Tests

20Monday, 29 September 2008

Page 21: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Making CI Work

• Can’t be done in isolation

• Pick the right tools for the job

• It’s not a silver bullet

Image by LiminalMike

21Monday, 29 September 2008

Page 22: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Tools Evolution & Trends

• Source Control

• Build Analytics

• Metrics

• Testing Tools

• CI Servers

Photo by docman

22Monday, 29 September 2008

Page 23: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Source Control

• Inter-SCM Integration

• See which revision broke the build

• Cope with the load

• Artefact versioning

23Monday, 29 September 2008

Page 24: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Build Analytics

• Test Code Coverage

• Bugs

• Style

• Complexity

• Visualisation

24Monday, 29 September 2008

Page 25: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Metrics

• Interesting code stats

• Track quality trends

• Performance

• Code coverage

• Build times

25Monday, 29 September 2008

Page 26: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Testing Tools

• Test doubles - test interaction

• Stubs

• Mocking

• BDD

• FIT

• Selenium

26Monday, 29 September 2008

Page 27: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

CI Servers

• Agents and Build Grids

• Personal Builds

• Pipelines

• Reporting

• Ease of use

27Monday, 29 September 2008

Page 28: Continuous Integrationjaoo.dk/.../slides/ChrisRead_ContinuousIntegration.pdf · Continuous Integration Chris.Read@ThoughtWorks.com Monday, 29 September 2008 1. Why?

Q&AThanks for participating...

28Monday, 29 September 2008