You are on page 1of 29

June 8, 2009 @ USC

Architecture and Agility

TH E U N IVERS ITY O F BR ITIS H C OLU M BIA

Software Architecture
and Agile Software Development
An Oxymoron?
Philippe Kruchten
USC, June 8th 2009

Copyright 2004-2009 by Philippe Kruchten

Philippe Kruchten, Ph.D., P.Eng., CSDP


Professor of Software Engineering
Department of Electrical and Computer Engineering

University of British Columbia


pbk@ece.ubc.ca
@
+1 604 827-5654
Founder and president
Kruchten Engineering Services Ltd
philippe@kruchten.com
+1 604 418-2006
Cofounder and secretary of IFIP WG2.10 on
Software architecture
Cofounder of Agile Vancouver
Associate Editor of IEEE Software for
architecture and design
Kruchten - 2009

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Agile & Architecture? Oil & Water?

Paradox
Oxymoron
O
Conflict
Incompatibility

Kruchten - 2009

Agility
A definition
Agility is the ability to both create and respond to
h
iin order
d tto profit
fit iin a tturbulent
b l tb
i
change
business
environment.
Jim Highsmith (2002)

Characteristics

Iterative and incremental


Small
S ll release
l
Collocation
Release plan/ feature backlog
Iteration plan/task backlog

Sanjiv Augustine (2004)

Kruchten - 2009

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Agile Values: the Agile Manifesto

We have come to value:


Individuals and interactions over process and
tools,
Working software over comprehensive
documents,
Customer collaboration over contract
negotiation,
Responding to change over following a plan.
That is, while there is value in the items on the
right, we value the items on the left more

Source: http://www.agilemanifesto.org/
Kruchten - 2009

Software Architecture: A Definition


Software architecture encompasses the
significant decisions about
the organization of a software system,
the selection of the structural elements and
their interfaces by which the system is
composed together with their behavior as
g those
specified in the collaboration among
elements,
the composition of these elements into
progressively larger subsystems,
Grady Booch, Philippe Kruchten, Rich Reitman, Kurt Bittner; Rational, circa 1995
Kruchten - 2009
(derived from Mary Shaw)

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Software Architecture (cont.)


the architectural style that guides this
organization, these elements and their
interfaces, their collaborations, and their
composition.
Software architecture is not only concerned
with structure and behavior, but also with
usage functionality
usage,
functionality, performance
performance,
resilience, reuse, comprehensibility,
economic and technological constraints and
tradeoffs, and aesthetics.
Kruchten - 2009

Perceived Tensions Agility- Architecture

Architecture = Big Up-Front Design


Architecture = massive documentation
Role of architect(s)
Low perceived or visible value of
architecture

Adaptation versus Anticipation

Kruchten - 2009

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Story of a failure
Large re-engineering of
a complex distributed
y
;
world-wide system;
2 millions LOC in C,
C++, Cobol and VB
Multiple sites, dozens of data repositories,
hundreds of users, 24 hours operation, missioncritical ($billions)
xP+Scrum, 1-week iterations, 30 then up to 50
d
developers
l
Rapid progress, early success, features are
demo-able
Direct access to customer, etc.
A poster project for scalable agile development
Kruchten - 2009

Hitting the wall


After 4 months, difficulties
to keep with the 1-week
iterations
Refactoring takes longer
than one iteration
Scrap and rework ratio
increases dramatically
No externally visible progress anymore
Iterations stretched to 3 weeks
Staff turn-over increases; Project comes to a halt
Lots of code, no clear architecture, no obvious way
forward

Kruchten - 2009

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Issues
1.
2
2.
3.
4.
5.
6.
7.

Semantics
Scope
Lifecycle
Role
Description
Methods
Value & cost
Kruchten - 2009

Issues
1.
2
2.
3.
4.
5.
6.
7.

Semantics
Scope
Lifecycle
Role
Description
Methods
Value & cost
Kruchten - 2009

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Semantics
What do we mean by architecture?

Kruchten - 2009

Software Architecture: A Definition


Software architecture encompasses the
significant decisions about
the organization of a software system,
the selection of the structural elements and
their interfaces by which the system is
composed together with their behavior as
g those
specified in the collaboration among
elements,
the composition of these elements into
progressively larger subsystems,
Grady Booch, Philippe Kruchten, Rich Reitman, Kurt Bittner; Rational, circa 1995
Kruchten - 2009
(derived from Mary Shaw)

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Software Architecture (cont.)


the architectural style that guides this
organization, these elements and their
interfaces, their collaborations, and their
composition.
Software architecture is not only concerned
with structure and behavior, but also with
usage functionality
usage,
functionality, performance
performance,
resilience, reuse, comprehensibility,
economic and technological constraints and
tradeoffs, and aesthetics.
Kruchten - 2009

Architecture = design decisions


Software
Architecture

Software
design
Decisions
Design decisions
Architectural decisions
Requirements constraints

Requ
uire
men
nts

Code etc.

A choice that is binding in the final product


Kruchten - 2009

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Architecture = Design? Not

Do not dilute the meaning


of the term architecture
by applying it to everything
in sight.
Mary Shaw

Kruchten - 2009

Issues
1.
2
2.
3.
4.
5.
6.
7.

Semantics
Scope
Lifecycle
Role
Description
Methods
Value & cost
Kruchten - 2009

Philippe Kruchten

June 8, 2009 @ USC

Architecture and Agility

Scope
How much architecture stuff do you really
need?
It depends
It depends
on yyour context
p

Kruchten - 2009

Environment Context Practice


Environment Conditions (organization)
Drive/constrain

Context Attributes (software project)


Drive

Practices

(actual process)
Kruchten - 2009

Philippe Kruchten

10

June 8, 2009 @ USC

Architecture and Agility

Context attributes affecting practices


1.
2.
3.
4.
5.
6.
7.
8.

Size
Age of
Criticality
System
Age of system
Rate of change
Rate of
change
Business model
Stable architecture
Team distribution
Governance
Governance

Size
Criticality

Context

Team
Distribution

Business
model

Stable
Architecture

Kruchten - 2009

Issues
1.
2
2.
3.
4.
5.
6.
7.

Semantics
Scope
Lifecycle
Role
Description
Methods
Value & cost
Kruchten - 2009

Philippe Kruchten

11

June 8, 2009 @ USC

Architecture and Agility

Lifecycle
When does architectural activities take
place?
The evil of BUFD = Big Up-Front Design
Defer decisions to the last responsible
moment
Refactor!
Kruchten - 2009

Architectural Effort During the Lifecycle

Inception

Elaboration

Construction

Transition

time

Majority of architectural design activities

Kruchten - 2009

Philippe Kruchten

12

June 8, 2009 @ USC

Architecture and Agility

Little dedicated architectural effort

Inception

Construction

Transition

time

Minimal pure
Architectural
Activities

Ideal realm of agile


practices

Kruchten - 2009

Iterations and Phases


Inception

Elaboration

Construction

Preliminary
P
li i
Architect.
A
hit t Architect.
A hit t Devel.
D
l
Iteration
Iteration Iteration Iteration

Internal Releases with


focus
on architecture
f
hit t

D
Devel.
l
Iteration

D
Devel.
l
Iteration

Transition
Transition
T
iti Transition
T
iti
Iteration Iteration

Releases with main


focus
on features
f
f t

An architectural iteration focuses in putting in place major


architectural elements, resulting in a baseline architectural
prototype at the end of elaboration.
Kruchten - 2009

Philippe Kruchten

13

June 8, 2009 @ USC

Architecture and Agility

Team Structure over Time (Very Large)


Inception

Construction

Elaboration
Management team

and Transition

Management team
Architecture team

Initial team

Feature team 1

Architecture
team

Feature team 2
Prototyping team

Infrastructure
team A

Feature team 3
Infrastructure
team B

Kruchten - 2009

integration team

Teams using agile development practices


Inception

Construction

Elaboration
Management team

and Transition

Management team
Architecture team

Initial team

Feature team 1

Architecture
team

Feature team 2
Prototyping team

Infrastructure
team A

Feature team 3
Infrastructure
team B

Kruchten - 2009

Philippe Kruchten

integration team

14

June 8, 2009 @ USC

Architecture and Agility

Issues
1.
2
2.
3.
4.
5.
6.
7.

Semantics
Scope
Lifecycle
Role
Description
Methods
Value & cost
Kruchten - 2009

Inflation?

Kruchten - 2009

Philippe Kruchten

15

June 8, 2009 @ USC

Architecture and Agility

Role Agile Architect


A. Johnston defines the agile architect, but it
does not seems to be any different from a
software
ft
architect
hit t b
before
f
agile
il methods
th d came iin.
Combination of

Visionary - Shaper
Designer making choices
Communicator between multiple parties
Troubleshooter
Herald window of the project
Janitor cleaning up behind the PM and the
developers
Kruchten - 2009

Two styles of software/system architects


Maker and Keeper of Big Mentor, Troubleshooter,
decisions
and Prototyper
Bring in technological
changes
External collaboration
More requirements-facing
Gatekeeper
Fowler: Architectus
reloadus

Implements and try


architecture
Intense internal
collaboration
More code-facing
Fowler: Architectus aryzus

Only big new projects need both or separate people


Kruchten - 2009

Philippe Kruchten

16

June 8, 2009 @ USC

Architecture and Agility

Team Structure over Time (Very Large)


Inception

Construction

Elaboration
Management team

and Transition

Management team
Architecture team

Initial team

Feature team 1

Architecture
team

Feature team 2
Prototyping team

Infrastructure
team A

Feature team 3
Infrastructure
team B

Kruchten - 2009

integration team

A. Reloadus and A. Aryzus ecological niches


Inception

Construction

Elaboration
Management team

A. Reloadus

Initial team

and Transition

Management team
Architecture team
Feature team 1

Architecture
team

Feature team 2
Prototyping team

Infrastructure
team A

Feature team 3
Infrastructure
team B

A. Aryzus
Kruchten - 2009

Philippe Kruchten

integration team

17

June 8, 2009 @ USC

Architecture and Agility

Issues
1.
2
2.
3.
4.
5.
6.
7.

Semantics
Scope
Lifecycle
Role
Description
Methods
Value & cost
Kruchten - 2009

Architectural description

Logical View

Metaphor
Process
View
Prototype
Software architecture document
Use of UML?
UML-based tools?
Code?

Implementation
View

Use Case
View
Deployment
View

Kruchten - 2009

Philippe Kruchten

18

June 8, 2009 @ USC

Architecture and Agility

It will depend on context (not agile issue)


1.
2.
3.
4.
5.
6.
7.
8.

Size
Age of
Criticality
System
Age of system
Rate of change
Rate of
change
Business model
Stable architecture
Team distribution
Governance
Governance

Size
Criticality

Context

Team
Distribution

Business
model

Stable
Architecture

Kruchten - 2009

Issues
1.
2
2.
3.
4.
5.
6.
7.

Semantics
Scope
Lifecycle
Role
Description
Methods
Value & cost
Kruchten - 2009

Philippe Kruchten

19

June 8, 2009 @ USC

Architecture and Agility

Architectural design methods


Many agile developers do not know (much)
about architectural design
Agile methods have no explicit guidance
for architecture
Metaphor in XP
Technical activities in scrum

Relate this to Semantics and Scope issue


May have to get above the code level
Kruchten - 2009

Issues
1.
2
2.
3.
4.
5.
6.
7.

Semantics
Scope
Lifecycle
Role
Description
Methods
Value & cost
Kruchten - 2009

Philippe Kruchten

20

June 8, 2009 @ USC

Architecture and Agility

Value and cost


Architecture has no (or little) externally
visible customer value
Iteration planning (backlog) is driven by
customer value
Ergo: architectural activities are not given
attention
Last responsible moment! & Refactor!

Kruchten - 2009

Value and cost


Cost of development is not identical to
value
Trying to assess value and cost in
monetary terms is hard and often leads to
vain arguments
Use points (utils)

Kruchten - 2009

Philippe Kruchten

21

June 8, 2009 @ USC

Architecture and Agility

Planning
From requirements derive:
Architectural requirements
q
Functional requirements

Establish
Dependencies
Cost

Plan interleaving:
Functional increments
Architectural increments
Kruchten - 2009

Weaving functional and architectural bits

Kruchten - 2009

Philippe Kruchten

22

June 8, 2009 @ USC

Architecture and Agility

Benefits
Gradual emergence of architecture
Validation of architecture with actual
functionality
Early enough to support development
Not jjust BUFD
No YAGNI effect

Kruchten - 2009

Iterations and Phases


Inception

Elaboration

Construction

Preliminary
P
li i
Architect.
A
hit t Architect.
A hit t Devel.
D
l
Iteration
Iteration Iteration Iteration

Internal Releases with


focus
on architecture
f
hit t

D
Devel.
l
Iteration

D
Devel.
l
Iteration

Transition
Transition
T
iti Transition
T
iti
Iteration Iteration

Releases with main


focus
on features
f
f t

An architectural iteration focuses in putting in place major


architectural elements, resulting in a baseline architectural
prototype at the end of elaboration.
Kruchten - 2009

Philippe Kruchten

23

June 8, 2009 @ USC

Architecture and Agility

Agility as a Culture
Culture

Beliefs, Norms

Values

Rituals
Jargon

Behaviours

Reflect beliefs

Reflect values

Manifesto!
Kruchten - 2009

R. Thomsett 2007

Agility and Architecture as Cultures


Culture
Culture

Beliefs,Beliefs,
Norms Norms

Values
Values

ReflectReflect
beliefs beliefs

Behaviours
B h i
Behaviours
ReflectReflect
values values

Kruchten - 2009

Philippe Kruchten

Rituals
Jargon

R. Thomsett 2007

24

June 8, 2009 @ USC

Architecture and Agility

Stages
Ethnocentrism
Denial
Defense

Ethnorelativism
Acceptance
Integration

Kruchten - 2009

Learn from the other culture


Agilists

Exploit architecture to scale up


Exploit architecture to partition the work
Exploit architecture to communicate

Architects

Exploit iterations to experiment


Exploit functionality to assess architecture
Exploit growing system to prune (KISS), keep it lean

Kruchten - 2009

Philippe Kruchten

25

June 8, 2009 @ USC

Architecture and Agility

Recommendations
Understand your context
How much architecture?

Define architecture

Meaning
Boundaries
Responsibility
Tactics (methods)
Representation

1.
2
2.
3.
4.
5.
6.
7.

Semantics
S
Scope
Lifecycle
Role
Description
Methods
Value & cost

Kruchten - 2009

Recommendations
No ivory tower
Architect is one of us
Architecture
Architecture owner
owner (Product owner)
Make architecture visible, at all time

Build early an evolutionary architectural prototype


Constantly watch for architecturally significant
requirements
Use iterations to evolve, refine
Understand when to freeze this architecture
(architectural stability)

Weave functional aspects with architectural


(technical) aspects (zipper)
Kruchten - 2009

Philippe Kruchten

26

June 8, 2009 @ USC

Architecture and Agility

Evolutionary Design
In order to work, evolutionary design needs
a force that drives it to converge. This
force can only come from people
somebody on the team has to have the
determination to ensure that the design
quality stays high.
Martin Fowler 2002

Kruchten - 2009

The first matrix I designed was quite


naturally perfect.
Kruchten - 2009

Philippe Kruchten

27

June 8, 2009 @ USC

Architecture and Agility

a triumph equaled
only by its monumental
failure.

I have since come to understand that the


answer eluded me because it required a
lesser mind, or perhaps a mind less
bound by the parameters of perfection.
Kruchten - 2009

Questions?
Kruchten - 2009

Philippe Kruchten

28

June 8, 2009 @ USC

Architecture and Agility

References

Ambler, S. W. (2006). Scaling Agile Development Via Architecture [Electronic


Version]. Agile Journal, from http://www.agilejournal.com/content/view/146/
Clements, P., Ivers, J., Little, R., Nord, R., & Stafford, J. (2003). Documenting
Software Architectures in an Agile World (Report CMU/SEI-2003-TN-023). Pittsburgh:
Software Engineering Institute.
Fowler, M. (2004) Is design dead? At http://martinfowler.com/articles/designDead.html
Johnston, A., The Agile Architect, http://www.agilearchitect.org/
Kruchten, P. (1995). The 4+1 View Model of Architecture. IEEE Software, 12(6), 4550.
Kruchten, P. (1999). The Software Architect, and the Software Architecture Team. In
P. Donohue (Ed.), Software Architecture (pp. 565-583). Boston: Kluwer Academic
Publishers.
Kruchten, P. (2003). The Rational Unified Process: An Introduction (3rd ed.). Boston:
Addison-Wesley.
Kruchten, P. ((2004).
projects
to meet the Agile
) Scaling
g down p
j
g sweet spot.
p The Rational
Edge. http://www-106.ibm.com/developerworks/
rational/library/content/RationalEdge/aug04/5558.html
Mills, J. A. (1985). A Pragmatic View of the System Architect. Comm. ACM, 28(7),
708-717.
Nord, R. L., & Tomayko, J. E. (2006). Software Architecture-Centric Methods and
Agile Development. IEEE Software, 23(2), 47-53.
Parsons, R. (2008). Architecture and Agile MethodologiesHow to Get Along.
Tutorial At WICSA 2008, Vancouver, BC.
Kruchten - 2009

Philippe Kruchten

29

You might also like