Ben Reich - Continuous Integration Best Practices in Agile Environments

37
Continuous Integration Best Practices in Agile Environments Ben Reich @ AgileSparks

description

 

Transcript of Ben Reich - Continuous Integration Best Practices in Agile Environments

Page 1: Ben Reich - Continuous Integration Best Practices in Agile Environments

Continuous Integration

Best Practices in Agile Environments

Ben Reich @ AgileSparks

Page 2: Ben Reich - Continuous Integration Best Practices in Agile Environments

Who Am I?

www.linkedin.com/in/benreichE-mail:

[email protected]

15 years leadership experience in software development & startup operations with Gantt charts

7 Years of searching and finding ways to improve life quality, predictability and efficiency

Page 3: Ben Reich - Continuous Integration Best Practices in Agile Environments

Ideas and best practices on implementing continuous integration in an agile way

What is this about?

Page 4: Ben Reich - Continuous Integration Best Practices in Agile Environments

Continuous Integration 101

CodeRepositor

y

Production Clone

Build

AutoTest

ChangeAuto

Builder

FeedbackPublish

Build

• Small and Frequent changes• Fast and immediate build• Immediate feedback

Page 5: Ben Reich - Continuous Integration Best Practices in Agile Environments

So, why is it agile?

ContinuousIntegration

Small

Iteratio

ns

RapidDelivery

Working

Software

Encourage

Cooperation

Page 6: Ben Reich - Continuous Integration Best Practices in Agile Environments

But: Is a bunch of programmers constantly mixing some code

together really getting us where we want to be?

Page 7: Ben Reich - Continuous Integration Best Practices in Agile Environments

The Challenges of CI

• Distance from the end user• Automatic tests are difficult• Large and complex products• Diverse organization• Insufficient review• Inter-team synchronization

issues

Page 8: Ben Reich - Continuous Integration Best Practices in Agile Environments

You know its becoming

irrelevant if:

Nobody is consuming it and

people are waiting for your “real release”

Page 9: Ben Reich - Continuous Integration Best Practices in Agile Environments

Escaped bugsInstant ResponseWhat Happens here? And here?

Page 10: Ben Reich - Continuous Integration Best Practices in Agile Environments
Page 11: Ben Reich - Continuous Integration Best Practices in Agile Environments

“Holy Place” Culture – Done means Released

• Identify the “holy place”• Designated delivery

target• Always up and running• As Releasable as possible• Replica of Production• Demo-able and

accessible

• Identify the Stakeholder• Represents the customer• Is motivated to succeed• Can deliver UAT• Has the bandwidth to

review

Page 12: Ben Reich - Continuous Integration Best Practices in Agile Environments

Put it where its accessible, demoable, won’t break but will be updated regularly in days

Page 13: Ben Reich - Continuous Integration Best Practices in Agile Environments

The Delivery Gap

• Manual testing takes longer and there is no synchronization

• Developers need to program before testers need to test

• Large projects need constant integration testing

• Too many changes can disrupt the flow

Page 14: Ben Reich - Continuous Integration Best Practices in Agile Environments

Ingredients to Fill the GAP

WIP Limits Time Box

Agile Communication

Page 15: Ben Reich - Continuous Integration Best Practices in Agile Environments

Case Study – The Demo Cycle

• 8 man team• 1 month sprint• 1 week demo cycle• 1 week deployment cycle• Typically 2-4 user stories deployed per

weekDay 1 Day 2 Day 3 Day 4 Day 5

CoordinateCommitTest

CommitTest

CommitTest

CommitTestEvaluateFreeze

DemoDecideDeploy

Page 16: Ben Reich - Continuous Integration Best Practices in Agile Environments

The Continuous Delivery Train Station Cycle

The Holy Trunk

Branch

Integration Area

WeeklyBranch

Deploy

Holy PlaceTeam

Commits

Tests

BranchUpdated

WeeklyBranch Deploy

Commits

Tests

?

Page 17: Ben Reich - Continuous Integration Best Practices in Agile Environments

The Continuous Delivery Train Station Cycle

The Holy Trunk

Branch

Integration Area

WeeklyBranch

Holy PlaceTeam

Commits

Tests

BranchLast Good

BranchDeploy

Commits

Tests

?XRejectWhew!!

Page 18: Ben Reich - Continuous Integration Best Practices in Agile Environments

The Continuous Delivery Train Station Cycle

The Holy Trunk

Branch

Integration Area

WeeklyBranch

Holy PlaceTeam

Commits

Tests

BranchLast Good

Branch

Commits

Tests

?XReject

XReject

Page 19: Ben Reich - Continuous Integration Best Practices in Agile Environments
Page 20: Ben Reich - Continuous Integration Best Practices in Agile Environments
Page 21: Ben Reich - Continuous Integration Best Practices in Agile Environments

Swarm!!

Page 22: Ben Reich - Continuous Integration Best Practices in Agile Environments

Electronic WIP dashboard

Page 23: Ben Reich - Continuous Integration Best Practices in Agile Environments

Large Projects - Scrum of Scrum• Frequency – 1 to 3 days

• What is discussed?– What has your team done since we last met?– What will your team do before we meet again?– Is anything slowing your team down or getting in their way?– Are you about to put something in another team’s way?

• The last two items will feature:– Broken APIs– Synchronization issues– Current build status– Story and Epic issues

Page 24: Ben Reich - Continuous Integration Best Practices in Agile Environments

Working with Large Remote Teams

Is it Impossible?

RailsPython

Django

Linux jQuery

Page 25: Ben Reich - Continuous Integration Best Practices in Agile Environments

Learning from Open Source

• Manage by committee• Dedicate resources to CI• Set strict rules and enforce

them• Enforce and encourage

communication• Never go home with a broken

build

Page 26: Ben Reich - Continuous Integration Best Practices in Agile Environments

Rules of engagement - Example

Page 27: Ben Reich - Continuous Integration Best Practices in Agile Environments

Github Change log – Social coding

Page 28: Ben Reich - Continuous Integration Best Practices in Agile Environments

Source Control Management Recipes

Eshel Brosh

1 trunk – No Deviations

Quiz - Which Tree Looks More Target Oriented?

Page 29: Ben Reich - Continuous Integration Best Practices in Agile Environments

Incremental changes

Main Trunk

Rev 1

Feat. 1 Rev 3Rev 2

Feat. 1 Rev 3

• Rule no. 1 – Do not branch for features.• Rule no. 2 – If you breached Rule no. 1:

• Merge quickly – Put an expiration date on branches

• Only one level• Police the branches• Pull Trunk before merging• Test branches before merging

Page 30: Ben Reich - Continuous Integration Best Practices in Agile Environments

Hiding New Features

• Not usually recommended

• Better than Branching– Gradual integration– Passes some tests– Lower Stabilization Cost

Page 31: Ben Reich - Continuous Integration Best Practices in Agile Environments

Branching by Abstraction

Logic Functionality

Persistence Functionality

Spaghet

ti

Page 32: Ben Reich - Continuous Integration Best Practices in Agile Environments

Branching by AbstractionAbst

ract

ion

Page 33: Ben Reich - Continuous Integration Best Practices in Agile Environments

Branching by Abstraction

Old Layer

Repla

cem

ent

New Layer

Page 34: Ben Reich - Continuous Integration Best Practices in Agile Environments

Branching by AbstractionRep

lace

men

t

Page 35: Ben Reich - Continuous Integration Best Practices in Agile Environments

Auto testing – The Key to Success

Test Auto-mated?

Build Tests

Unit Tests

Functional Test

Non-Functional tests

Acceptance tests

• Automate in order• Automate the happy

path first• Maximize coverage with

data and not complex scripting

• Look for repeating manual tests

• Spec test together with PO

• Automate when functionality is frozen

Page 36: Ben Reich - Continuous Integration Best Practices in Agile Environments

What Next?

• Visualize your value stream• Choose tools

– Continuous Integration– Auto testing– Deployment

• Invest in automatic testing• Tailor fit a process to your

needs

Page 37: Ben Reich - Continuous Integration Best Practices in Agile Environments

www.linkedin.com/in/benreichE-mail:

[email protected]

Questions?

Thank You!