Continuous Delivery for Agile Teams

53
CONTINUOUS DELIVERY (IN AN AGILE CONTEXT) Mike Bowler, Agile & Technical Coach Tweeting? Use @mike_bowler and #atmtl2013

description

Slide deck for the talk given at Agile Tours in Toronto, Montreal and Ottawa.

Transcript of Continuous Delivery for Agile Teams

Page 1: Continuous Delivery for Agile Teams

CONTINUOUS DELIVERY (IN AN AGILE CONTEXT)

Mike Bowler, Agile & Technical CoachTweeting? Use @mike_bowler and #atmtl2013

Page 2: Continuous Delivery for Agile Teams

Have a question?!Don’t wait, ask it!

Page 3: Continuous Delivery for Agile Teams

WHAT IS CONTINUOUS DELIVERY AND WHY

SHOULD I CARE?

Page 4: Continuous Delivery for Agile Teams

“Our highest priority is to satisfy the customer through early and

continuous delivery of valuable software.”

AGILE PRINCIPLES SAY:

Page 5: Continuous Delivery for Agile Teams

“Deliver working software frequently, from a couple of

weeks to a couple of months, with a preference to the

shorter timescale.”

AGILE PRINCIPLES SAY:

Page 6: Continuous Delivery for Agile Teams

“Wait a minute! My company doesn’t want to deploy that often!”

What’s important is that

you CAN deliver fast

Page 7: Continuous Delivery for Agile Teams

WHAT IS CONTINUOUS DELIVERY?

Page 8: Continuous Delivery for Agile Teams

Pull from master branch

Compile and Package

Verify expected behaviour

Deploy to production

Monitoring and Alerts

Rollbacks on error

Production

One master branch

Jenkins / Hudson, TFS, Capistrano, Homemade shell

scripts, etc.

Nagios, Tivoli, OPenView, etc.

Page 9: Continuous Delivery for Agile Teams

WHAT COULD GO WRONG?

We could put something new in production that doesn’t work or we could break something that used to work!

We could put a half finished feature into production before it was ready and confuse the users!

We could kick the users off the system in the middle of doing their work

Page 10: Continuous Delivery for Agile Teams

HOW DID WE DEAL WITH THESE IN THE PAST?

We had long manual test cycles between releases!

We typically deployed off-hours when nobody was using the system

Not feasible if we’re

deploying every 15 minutes

Page 11: Continuous Delivery for Agile Teams

PRE-REQUISITES ARE HARD

Able to deploy to production at the busiest time of the day with no visible changes - no unexpected changes, no downtime!

Have sufficient monitoring to know when something goes wrong and the ability to rapidly fix it or roll back to a known good state!

No manual processes after code has been checked in. Every step is automated.!

Holistic view of the process, from customer request to production support. Team is bigger than just the devs.

Page 12: Continuous Delivery for Agile Teams

Continuous

Delivery

Individuals

Courage

Pride of work

Design

Agile modeling

Evolutionary design

Simple design

Usability

Engaged people

Continuous improvement

Sustainable pace

Regular retrospectives

Executable specifications

ATDD

BDD

TDD

Exploratory testing

Functional

Performance

Incremental development

Pair programming

Refactoring

Dev Team

Configuration management

Version control

Frequent check-ins

Single codebase

Dependency managementCross-functional teams

High communication

Co-located teams

Daily standups

Shared understanding

Coding standards

Collective code ownership

Informational workspace

Simple architectureSmall Stories

Whole

Team

Automation

Continuous integrationDB migration

One click deploy

One click rollback

Zero downtime deploy

Configuration management

Provisioning

Cluster immune

system

Common Goal

Feature flags

Measurements

Comparative testing

Stress testing

MonitoringAlerts

Planning

Capacity

Compliance

Scalability

Rapid Feedback

© 2013 Gargoyle Software Inc

Craftsmansh

ip

Working within

your team

Working with people outside your dev team

Page 13: Continuous Delivery for Agile Teams

INDIVIDUALS !

“CRAFTSMANSHIP”

Page 14: Continuous Delivery for Agile Teams

COURAGE

Courage to say no to requests that compromise the teams values!

Courage to say code quality isn’t high enough!

Courage to say these deadlines aren’t realistic!

Courage to escalate issues that nobody wants to talk about

Page 15: Continuous Delivery for Agile Teams

“Take pride in what you do. The kind of pride I'm talking about is not the arrogant puffed-up kind; it's just the whole idea of

caring - fiercely caring.”

Arnold Jacob "Red" Auerbach was an American basketball coach of the Washington Capitols, the Tri-Cities Blackhawks and the Boston Celtics.

http://en.wikipedia.org/wiki/Red_Auerbach

Page 16: Continuous Delivery for Agile Teams

EVOLUTIONARY DESIGN & INCREMENTAL DEVELOPMENT

Design and build only what you need today!

YAGNI : “You aren’t going to need it”

Page 17: Continuous Delivery for Agile Teams

SIMPLE DESIGN

“A complex system that works is invariably found to have evolved from a simple system that worked. The inverse proposition also appears to be true: A

complex system designed from scratch never works and cannot be made to

work. You have to start over, beginning with a working simple system.”

-- Gall's Law

Page 18: Continuous Delivery for Agile Teams

ENGAGED PEOPLE

Continuous improvement (Sharpening the saw)!

Sustainable Pace!

Regular retrospectives

Page 19: Continuous Delivery for Agile Teams

AUTOMATED TESTS

A section of executable code that can be run repeatedly to ensure that our production code does what it is supposed to do!

Why is it important to automate these?

Executable Specifications

Page 20: Continuous Delivery for Agile Teams

AUTOMATED TESTS

Techniques!

ATDD (Acceptance Test Driven Development)!

BDD (Behaviour Driven Development)!

TDD (Test Driven Development)!

All write specifications first. Why is this important?

Executable Specifications

Page 21: Continuous Delivery for Agile Teams

EXPLORATORY TESTING

Looking for issues!

Done earlier in the process

Page 22: Continuous Delivery for Agile Teams

PAIR PROGRAMMING

Page 23: Continuous Delivery for Agile Teams

REFACTORING

Code refactoring is a “disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behaviour”, undertaken in order to improve some of the nonfunctional attributes of the software. !!Advantages include improved code readability and reduced complexity to improve the maintainability of the source code, as well as a more expressive internal architecture or object model to improve extensibility.!!-- Wikipedia entry on Refactoring

Page 24: Continuous Delivery for Agile Teams

“The trouble with quick and dirty is that dirty remains long after

quick has been forgotten.”

Steven C. McConnell is an author of many software engineering textbooks including Code Complete, Rapid Development, and Software Estimation.

http://en.wikipedia.org/wiki/Steve_McConnell

Page 25: Continuous Delivery for Agile Teams

DEVELOPMENT TEAM WORKING TOGETHER

Page 26: Continuous Delivery for Agile Teams

SMALL STORIES

Page 27: Continuous Delivery for Agile Teams

SHARED UNDERSTANDING

Agreed standards!

Coding conventions!

Shared design!

Simple architecture

Page 28: Continuous Delivery for Agile Teams

COLLECTIVE CODE OWNERSHIP

We all own the code!

We all keep it clean!

Clean up the garbage, no matter who left it like that!

Freedom to make any change, anywhere in the code base

Page 29: Continuous Delivery for Agile Teams

HIGH COMMUNICATION

Page 30: Continuous Delivery for Agile Teams

Informational Workspace

Page 31: Continuous Delivery for Agile Teams

CROSS FUNCTIONAL TEAMS

Everyone should know a little of everything!

Should everyone be able to take a vacation? Even the specialists?

Page 32: Continuous Delivery for Agile Teams

CONFIGURATION MANAGEMENT

Use version control!

Check in everything that can’t be regenerated!

Check in frequently

Page 33: Continuous Delivery for Agile Teams

BRANCHING

Avoid feature branches!

Avoid anything that requires manual merging

Page 34: Continuous Delivery for Agile Teams

Pull from master branch

Compile and Package

Verify expected behaviour

Deploy to production

Monitoring and Alerts

Rollbacks on error

ProductionThis model assumes one !branch. !!Avoid feature branches.

Page 35: Continuous Delivery for Agile Teams

Pull from Amy’s branch

Compile and Package

Verify expected behaviour

Deploy to production

Monitoring and Alerts

Rollbacks on error

Production

Merge with master branch

Compile and package

Verify expected behaviour

One branch !per developer

Merge with local copy of master

Pull from Bob’s branch

Compile and Package

Verify expected behaviour

Merge with local copy of master

Pull from Carol’s branch

Compile and Package

Verify expected behaviour

Merge with local copy of master

Page 36: Continuous Delivery for Agile Teams

DEVELOPMENT TEAM WORKING WITH EVERYONE ELSE

Page 37: Continuous Delivery for Agile Teams

RAPID FEEDBACK

Page 38: Continuous Delivery for Agile Teams

PLANNING & MEASUREMENT

Plan for production usage!

Capacity planning!

Compliance!

Scalability!

!

Stress testing!

Comparative measurements

Page 39: Continuous Delivery for Agile Teams

MONITORING & ALERTSMonitor all production usage and trigger alerts for abnormal conditions.!

How do operations know what conditions are abnormal?

Page 40: Continuous Delivery for Agile Teams

FEATURE FLAGS

A/B testing!

Hiding incomplete features!

Enabling features based on permissions

Page 41: Continuous Delivery for Agile Teams

COMMON GOAL

How does each group get measured?!

Developers!

Testers!

DBA’s!

Operations staff!

Are those measurements helping or hurting the overall goal?

Page 42: Continuous Delivery for Agile Teams

AUTOMATION

No more manual processes!

Full automation of deploy and rollback, including database changes

Page 43: Continuous Delivery for Agile Teams

MORE ADVANCED AUTOMATION

Provisioning!

Getting a new machine up and running !

Configuration management!

Making changes to a machine already running!

Cluster immune system!

Automated rollbacks if the new deploy doesn’t meet defined acceptable thresholds

Page 44: Continuous Delivery for Agile Teams

RECAP

Page 45: Continuous Delivery for Agile Teams

Pull from master branch

Compile and Package

Verify expected behaviour

Deploy to production

Monitoring and Alerts

Rollbacks on error

Production

Page 46: Continuous Delivery for Agile Teams

PRE-REQUISITES Able to deploy to production at the busiest time of the day with no visible changes - no unexpected changes, no downtime!

Have sufficient monitoring to know when something goes wrong and the ability to rapidly fix it or roll back to a known good state!

No manual processes after code has been checked in. Every step is automated.!

Holistic view of the process, from customer request to production support. Team is bigger than just the devs.

Page 47: Continuous Delivery for Agile Teams

Continuous

Delivery

Individuals

Courage

Pride of work

Design

Agile modeling

Evolutionary design

Simple design

Usability

Engaged people

Continuous improvement

Sustainable pace

Regular retrospectives

Executable specifications

ATDD

BDD

TDD

Exploratory testing

Functional

Performance

Incremental development

Pair programming

Refactoring

Dev Team

Configuration management

Version control

Frequent check-ins

Single codebase

Dependency managementCross-functional teams

High communication

Co-located teams

Daily standups

Shared understanding

Coding standards

Collective code ownership

Informational workspace

Simple architectureSmall Stories

Whole

Team

Automation

Continuous integrationDB migration

One click deploy

One click rollback

Zero downtime deploy

Configuration management

Provisioning

Cluster immune

system

Common Goal

Feature flags

Measurements

Comparative testing

Stress testing

MonitoringAlerts

Planning

Capacity

Compliance

Scalability

Rapid Feedback

© 2013 Gargoyle Software Inc

Craftsmansh

ip

Working within

your team

Working with people outside your dev team

Page 48: Continuous Delivery for Agile Teams

“Design and programming are human activities; forget that and all is lost.”

Bjarne Stroustrup is a Danish computer scientist, most notable for the creation and the development of the widely used C++ programming language.

http://en.wikipedia.org/wiki/Bjarne_Stroustrup

Page 49: Continuous Delivery for Agile Teams

MORE READING

Page 50: Continuous Delivery for Agile Teams

CONTACTING ME

Mike Bowler!Agile & Technical Coach !

!

[email protected]!Cell: 905 409-7052!

Twitter: @mike_bowler!!

Other links for me on Facebook, Google+ etc at!http://www.GargoyleSoftware.com/mike_bowler

Page 51: Continuous Delivery for Agile Teams

HANDOUTS

Page 52: Continuous Delivery for Agile Teams

Continuous

Delivery

Individuals

Courage

Pride of work

Design

Agile modeling

Evolutionary design

Simple design

Usability

Engaged people

Continuous improvement

Sustainable pace

Regular retrospectives

Executable specifications

ATDD

BDD

TDD

Exploratory testing

Functional

Performance

Incremental development

Pair programming

Refactoring

Dev Team

Configuration management

Version control

Frequent check-ins

Single codebase

Dependency managementCross-functional teams

High communication

Co-located teams

Daily standups

Shared understanding

Coding standards

Collective code ownership

Informational workspace

Simple architectureSmall Stories

Whole

Team

Automation

Continuous integrationDB migration

One click deploy

One click rollback

Zero downtime deploy

Configuration management

Provisioning

Cluster immune

system

Common Goal

Feature flags

Measurements

Comparative testing

Stress testing

MonitoringAlerts

Planning

Capacity

Compliance

Scalability

Rapid Feedback

© 2013 Gargoyle Software Inc

Craftsmansh

ip

Working within

your team

Working with people outside your dev team

Mike Bowler Agile & Technical Coach

(905) 409-7052 [email protected]

@mike_bowler

Page 53: Continuous Delivery for Agile Teams

Pull from master branch

Compile and Package

Verify expected behaviour

Deploy to production

Monitoring and Alerts

Rollbacks on error

Production

Mike Bowler Agile & Technical Coach

(905) 409-7052 [email protected]

@mike_bowler