slides - Neal Ford

Continuous Delivery Workshop
Tests, Synergistic
Practices, &
Deployment
Workshop materials created by Jez Humble, Martin Fowler, Tom Sulston, & Neal Ford
deployment pipelines
tests, synergistic practices,
incremental deployment
data & infrastructure
effort
audience
feedback
Testing
3
Testing
quadrants
business facing
functional
acceptance
integration
manual
showcases
showcases
usability
usability
exploratory
exploratory
automated
unit
automated
critique project
support programming
automated
nonfunctional acceptance /
quality of service
manual/automated
technology facing
source: Brian Marrick, Continuous Delivery (Humble/Farley), with modifications
4
Testing
quadrants
business facing
functional
acceptance
integration
manual
showcases
usability
exploratory
automated
critique project
support programming
automated
nonfunctional
acceptance/
nonfunctional acceptance
/
unit
quality
of service
quality
of
service
automated
manual/automated
technology facing
source: Brian Marrick, Continuous Delivery (Humble/Farley), with modifications
5
Testing
quadrants
business facing
functional
acceptance
integration
manual
showcases
usability
exploratory
automated
unit
unit
automated
critique project
support programming
automated
nonfunctional acceptance /
quality of service
manual/automated
technology facing
source: Brian Marrick, Continuous Delivery (Humble/Farley), with modifications
6
unit
Testing
prefer test-driven to test-after development
prefer pragmatism over dogmatic metrics
optimize for the target audience
use sharp tools
how much time?
7
Common Anti-pattern
mixed unit/
functional tests
Fast/Slow Tests
mixed unit/
functional tests
functional
unit
Fast/Slow Tests Redux
mixed unit/
functional tests
Unit Tests
11
Functional Tests
12
code.google.com/p/infinitest/
13
14
15
Testing
quadrants
business facing
functional
acceptance
integration
integration
automated
unit
automated
manual
showcases
usability
exploratory
contracts
heartbeats
critique project
support programming
automated
nonfunctional acceptance /
quality of service
manual/automated
technology facing
plumbing
source: Brian Marrick, Continuous Delivery (Humble/Farley), with modifications
16
Testing
quadrants
business facing
functional
functional
acceptance
acceptance
integration
manual
showcases
usability
exploratory
automated
unit
automated
critique project
support programming
automated
nonfunctional acceptance /
quality of service
manual/automated
technology facing
source: Brian Marrick, Continuous Delivery (Humble/Farley), with modifications
17
evolution of functional testing
extension of
unit tests
wiki
BA/SME
fixture
developer
FIT/FITnesse
auto-generation of fixtures
cross-platform for step
definitions
BA/SME
developer
18
User Interface
(Web, Swing)
2 styles of functional tests
Business Analysts
QA
Domain Logic
(Model)
Application Server / Spring
Persistance
(OR Mapper)
Firewall
External
Stuff
Storage
Application
External Endpoints
everything below user interface
everything.
Mainframe Computer
19
Test Style
declarative
imperative
20
To Cuke or not to Cuke…
BDD ≠
use when it provides useful
feedback to the target audience
http://www.thoughtworks.com/insights/blog/3-misconceptions-about-bdd
21
Testing Ratios
UI
functional
Succeeding with
Agile (Mike Cohn)
unit
22
23
Anti-pattern: Ice-cream Cone
24
Cupcake Anti-pattern
http://www.thoughtworks.com/insights/blog/introducing-software-testing-cupcake-anti-pattern
25
Avoiding Cupcakes
collaborate
work in sync
cross-role pair programming
story kickoff
test at the lowest level
merge teams
when possible
agree on goals
and metrics
26
Prefer journeys to stories
27
Continuous
Integration
machinery
Continuous
Integration
29
develop
local
workstation
continuous integration
server
version
control
30
continuous integration
server
build
version
control
31
continuous integration
server
version
control
build
32
continuous integration
server
version
control
build
33
everyone commits
continuous integration
server
to trunk at least
version
control
build
once a day
34
P1
P3-4
P1-2
Professor Plum
P2
P4
P3
B2
B1
Mainline
B1
B2
B1
G1
Reverend Green
P5
B2
G3
G2
G1-2
G4
G5
G6
G3
Feature Branching
35
P1
P3-4
P1-2
Professor Plum
P2
P4
P3
P1-5
B2
B1
Mainline
P5
B1
B2
P1-5
B1
B2
G1-6
G1
Reverend Green
G3
G2
G1-2
G4
G5
G6
G3
G1-6
Feature Branching
36
P1
P3-4
P1-2
Professor Plum
P2
P4
P3
P1-5
B2
B1
Mainline
P5
B1
B2
P1-5
B1
B2
G1-6
G1
Reverend Green
G3
G2
G1-2
G4
G5
G6
G3
G1-6
Feature Branching
37
P3-4
P1-2
Professor Plum
P1
copy/paste
reuse !!
P2
P4
P3
P1-5
B2
B1
Mainline
P5
B1
B2
P1-5
B1
B2
G1-6
G1
Reverend Green
G3
G2
G1-2
G4
G5
G6
G3
merge
ambush!
G1-6
Feature Branching
38
trunk-based development
Professor Plum P1
P2
P1
Mainline
P3
P2
G1
P1
P3
P2
B1
G1
Reverend Green
P4
P4
P3
P5
B2
G2
G3
P4
P5
B2
B1
G1
P4
B1
P1-2
G2
B2
P3
G2
P4-5
G3
G2
G4
G3
G4
G3
G5
G5
G6
G6
G4
Continuous Integration removes the pain…
39
paulhammant.com/2013/04/05/what-is-trunk-based-development/
Feature Branching
Big Scary
Merge
Continuous Integration
P3-4
P1-2
Professor Plum
P1
P2
P4
P3
B1
Mainline
P5
Feature Branch
B1
P1-5
B2
B2
P1-5
B1
B2
G1-6
G1
G3
G2
G4
G5
G6
Eager vs. late
Professor Plum P1
P2
P1
Mainline
P3
P2
G1
G3
G1-2
Reverend Green
P1
P3
P2
B1
G1
Reverend Green
P4
P4
P3
G1-6
P5
B2
G2
G3
P4
P5
B2
B1
G1
P4
B1
P1-2
G2
B2
P3
G2
P4-5
G3
G2
G4
G3
G4
G3
Continuous Integration
G5
G5
G4
G6
G6
Feature Branching
Big Scary
Merge
Untrusted
Contributors
Continuous Integration
Feature Branching
Big Scary
Merge
Cherry Picking
Untrusted
Contributors
Continuous Integration
Config File
[featureToggles]
wobblyFoobars: true
flightyForkHandles: false
some.jsp
feature toggles
<toggle name=wobblyFoobars>
... various UI elements
</toggle>
other.java
forkHandle = (featureConfig.isOn(‘flightlyForkHandles)) ?
new FlightyForkHander(aCandle) :
new ForkHandler(aCandle)
www.togglz.org
feature toggles
removed as soon as feature decision is
resolved
build-time vs. run-time
taxonomy (features vs. infrastructure)
works on all platforms & technology
stacks
ubiquitous
Branch by
Abstraction
Library
Application
New
Library
Library
Application
Interface
implements
New
Library
Library
Application
Interface
implements
New
Library
Library
Application
Interface
implements
New
Library
Application
Interface
implements
New
Library
“strangler” pattern
make something new that obsoletes a
small percentage of something old
put them live together
rinse, repeat
“strangler” pattern
“We never told the
users that they must
use the new system.
Nor did we remove
access to the old
system. We relied
on making the system so compelling that there was no
reason to use the old. This also meant that we stayed
focused on the users real requirements”
paulhammant.com/2013/07/14/legacy-application-strangulation-case-studies/
Feature Branching
No
Refactoring
Big Scary
Merge
Untrusted
Contributors
Cherry Picking
Continuous Integration
Feature Branching
No
Refactoring
No combined
features
Big Scary
Merge
Untrusted
Contributors
Cherry Picking
Continuous Integration
meta-work is
more interesting
than work
make sure your practices support your
goals (and don’t become goals unto
themselves)
Release
Strategies
blue-green deployments
canary releases
Incremental Release
Strategies
dark launching
production immune system
DEPENDENT SERVICE
1.0
1.1
Database
Abstraction layer
Abstraction layer
STATIC CONTENT
/static/1.1
APPLICATION
/static/1.0
Router /
Load balancer
Interwebs
blue-green
deployments
1.1
1.1
1.1
1.2
1.2
1.2
Web server
Application
server
Database
server
Message Router
1.1
1.1
1.1
1.2
1.2
1.2
Web server
Application
server
Database
server
Message Router
Canary
Releasing
canary releasing
reduce risk of release
multi-variant testing
performance testing
www.togglz.org
immune system
What if a developer accidentally
replaced the “Buy” button with
“spacer.gif” ?
Dark Launching
www.mysite.com
www.mysite.com
Blue. No, yel…
Blue. No, yel…
Old
Burn her! Did you dress her up like this? Found them? In Mercia?!
The coconut's tropical! Bloody Peasant! I'm not a witch. A newt?
Burn her! Did you dress her up like this? Found them? In Mercia?!
The coconut's tropical! Bloody Peasant! I'm not a witch. A newt?
The Knights Who Say Ni
demand a sacrifice!
The Knights Who Say Ni
demand a sacrifice!
The swallow may fly south with the sun, and the house martin or
the plover may seek warmer climes in winter, yet these are not
strangers to our land. We found them. The nose?
The swallow may fly south with the sun, and the house martin or
the plover may seek warmer climes in winter, yet these are not
strangers to our land. We found them. The nose?
•
•
•
Boring
What a strange person.
Now, look here, my good man.
We want a shrubbery!!
•
•
•
What a strange person.
Now, look here, my good man.
We want a shrubbery!!
New & exciting
request page
returns page v1
returns page v2
All servers have the
same software
Old
Boring
Emergency
Fixes?
Remediation?
nealford.com
@neal4d