Contenu connexe
Similaire à Seven elements of technical Agility - Gil Broza - Agile Israel 2013
Similaire à Seven elements of technical Agility - Gil Broza - Agile Israel 2013 (20)
Seven elements of technical Agility - Gil Broza - Agile Israel 2013
- 1. Copyright © 2012 3P Vantage, Inc.
Is Your Agile Team Busy Producing
Legacy Code?
Gil Broza
The 7 Elements of Technical Agility
TheHumanSideOfAgile.com
3PVantage.com
OnTheWayToAgile.com
- 2. 2 Copyright © 2012 3P Vantage, Inc.
The Four Dimensions of Agility
Technical Agility:
Executing value-adding development mechanics with agility
Our focus now
Planning /
Process
Business Leadership / People
Technical
- 3. 3 Copyright © 2012 3P Vantage, Inc.
All Dimensions Are Vital
“Early and continuous delivery of working software”
– This business promise must be backed by planning and
technical mechanisms
“Build projects around motivated individuals. Give them
the environment and support they need, and trust them
to get the job done.”
– This leadership premise can’t work when the technical
environment hurts or process gets scary (e.g. the demo)
The effects of insufficient technical Agility are
only felt after the first few months of excitement
- 4. 4 Copyright © 2012 3P Vantage, Inc.
6 “Tells” of a Team Producing Legacy Code
Demo-driven development
“We don’t have time to clean the code or its design”
Surprisingly high estimates for easy-looking features
Coding, testing, fixing anything? “It’s not that simple.”
“In an ideal world, the estimate would be twice as much
to do this story right.”
The Definition of Done doesn’t cover developers
- 5. 5 Copyright © 2012 3P Vantage, Inc.
Attitudes Are Telling, Too
Things take long,
and that’s just the way it is
If it ain’t broken,
don’t fix it!
A valuable solution is
a large solution
Everyone should
focus on completing
their own part
- 6. 6 Copyright © 2012 3P Vantage, Inc.
The Long-Term Costs
Progress slows down (Tracker)
Variability in task duration becomes high (MarketWire)
Motivation and engagement go down (Randy the architect)
Over-reliance on experts/silos is risky and expensive
Harder to maintain teamwork and collaboration
You cannot remain a leader.
Your ability to innovate and respond will fall behind.
- 7. 7 Copyright © 2012 3P Vantage, Inc.
Technical Agility Falls Through the Cracks
If you use Scrum, all you’re told is “self-organization and
improvement through feedback, data, and discovery”
Who’s likely to drive technical Agility?
The delivery team?
– not usually
Team leader or technical lead?
– they usually need greater clout
Development managers?
– more likely
– need support as far up as CTO
- 8. 8 Copyright © 2012 3P Vantage, Inc.
The 7 Elements of
Technical Agility
- 9. 9 Copyright © 2012 3P Vantage, Inc.
1. Evolutionary Design
Have sizable work?
1. Understand its purpose
2. Lay it out (e.g. story mapping, wireframes)
3. Identify an increment of behaviour and structure that
would give value and useful information/feedback
4. Build it, get feedback
5. Adjust your plans based on that feedback and your
project’s constraint tradeoff (time/scope/quality/cost)
6. Repeat 3-5
As opposed to dividing work by layer, component, expert
- 10. 10 Copyright © 2012 3P Vantage, Inc.
2: Guest Searches For Items
Optional category. Search for
text in title, description and
location. Results in scrollable
table. Assume >100K listings.
1: Guest Posts Listing
6 text fields + category
from preconfigured list.
Up to 4 images.
3: Guest Opens Listing
Show all fields as uneditable
text. Render email so it’s
unspammable. Fit wide
images to 500px.
Release 1: “Non-Registered Buy & Sell”
STUFF
Post
Search
Basic homepage
VIEW LISTING
Bike for sale, as new!Title
BMX bike, kids 8-12Description
Close
Category Bicycles
Location Yonge & Sheppard
Price $35
Phone (Withheld)
Email joe@home.com
SEARCH LISTING
Category
Text in listing
Search
Close
Title category price loc
Title category price loc
Title category price loc
Title category price loc
Title category price loc
CREATE LISTING
Title
Description
Price
Phone
Email
Location
Category
Remove Image Add Image
Submit Cancel
After one image
has been added
10
5 5
- 11. 11 Copyright © 2012 3P Vantage, Inc.
SEARCH LISTING
Category
Text in listing
Search
Close
Title category price loc
Title category price loc
Title category price loc
Title category price loc
Title category price loc
2.1: Guest Opens All-Listing
View
Show all listings in scrollable table.
1.1: Guest Posts Flat Listing
Just the 6 text fields. Store in a
file.
Iteration #1: Flat Post & Search
STUFF
Post
Search
Basic homepage
3 2
CREATE LISTING
Title
Description
Price
Phone
Email
Location
Category
Remove Image Add Image
Submit Cancel
After one image
has been added
- 12. 12 Copyright © 2012 3P Vantage, Inc.
2.2: Guest Searches For Text in
Listings
Text box value used to search title,
description and location
Iteration #2: Flat Post-Search-Open
STUFF
Post
Search
Basic homepage
SEARCH LISTING
Category
Text in listing
Search
Close
Title category price loc
Title category price loc
Title category price loc
Title category price loc
Title category price loc
32
3.1: Guest Opens Listing
Show all text fields (no images or
categories yet); make email non-
spammable.
VIEW LISTING
Bike for sale, as new!Title
BMX bike, kids 8-12Description
Close
Category Bicycles
Location Yonge & Sheppard
Price $35
Phone (Withheld)
Email joe@home.com
- 13. 13 Copyright © 2012 3P Vantage, Inc.
2.3: Guest Searches For Items
using Category
Narrow down the text search to the
chosen category (default: none).
Iteration #3: Post With Images & Categories
STUFF
Post
Search
Basic homepage
SEARCH LISTING
Category
Text in listing
Search
Close
Title category price loc
Title category price loc
Title category price loc
Title category price loc
Title category price loc
1
1.2: Guest Posts Categorized
Listing with Images
Add category dropdown,
populated with fixed options.
Up to 4 images. User can remove
uploaded image. Save all images
only once listing is submitted.
CREATE LISTING
Title
Description
Price
Phone
Email
Location
Category
Remove Image Add Image
Submit Cancel
After one image
has been added
4
- 14. 14 Copyright © 2012 3P Vantage, Inc.
2.4: Guest Searches Among
>100K Listings
Refactor to scalable DB. Optimize
for search. Post and Open need to
be reasonably quick.
Iteration #4: Close Loop With Scalable DB
24
3.2: Guest Opens Categorized
Listing with Images
Show images one below the other.
Scale down wide images to max
500 width. Also show category.
VIEW LISTING
Bike for sale!! As new!!Title
BMX bike for kids 8-12Description
Close
Category Bicycles
Location Yonge & Sheppard
Price $35
Phone (Withheld)
Email joe@home.com
- 15. 15 Copyright © 2012 3P Vantage, Inc.
2. Rapid Feedback
“How does it behave?”
“What have we broken?”
“What works for sure?”
“How easy is it to use?”
“Stable knowable code that has built-in functional verification allows you
to be confident that your change is still functionally correct and only
affected the part of the system you intended… less regressions, less
hotfixes, less new bugs... more features.”
- 16. 16 Copyright © 2012 3P Vantage, Inc.
3. Small, Safe Steps
Break everything down smaller than you think
You can refactor everything using safe behaviour-
preserving transformations
“Learning about safe and testable refactoring was the most interesting part
for me. I can really see myself doing that in the future, as changing an API
or some logic is always the riskiest process and can lead to the most bugs.”
- 17. 17 Copyright © 2012 3P Vantage, Inc.
Especially Good for Evolution
Are you looking at evolution rather than revolution?
With evolution, keep the architecture, construction, use,
behaviour and flow in lockstep. Small steps help!
- 19. 19 Copyright © 2012 3P Vantage, Inc.
Understand the Problem
On both the delivery and definition
sides, get to the heart of the
problem you’re solving – and find
a simple, sufficient solution.
“We’ve started pairing often on areas with
interesting behaviours, and have noticed much
more diverse tests emerging than if a single
developer had tackled the task.”
- 20. 20 Copyright © 2012 3P Vantage, Inc.
5. Clean Code
The principles still hold: high cohesion/loose coupling,
good OOD/OOP, reuse
The standards have changed
– Team progress, and ability to respond, are key
– If a team is to quickly upgrade/change/fix code, programmers
must be able to read and understand it quickly
“The focus on identifying and removing code smells is something we should
be training all of our developers on.”
- 21. 21 Copyright © 2012 3P Vantage, Inc.
Design Anti-Patterns
for (Employee employee : payroll) {
// Consider only full-time employees
if (!employee.isTemp() && !employee.isPartTime())
public class UserInfo…
private String password;
public boolean isPasswordValid()…
public String scramblePassword()…
switch (vehicle.getType()) {
case SEDAN:
return new Money(0);
case HYBRID:
return new Money(-100); …
Deodorant Comment
Primitive Obsession
Switch Statement
- 22. 22 Copyright © 2012 3P Vantage, Inc.
public boolean checkSSNForDupes() {
//build cmd to go to DB
Envelope env = new Envelope();
CmdStatus cmdStatus = new CmdStatus();
PublicServiceAgent agt = session_.getAWFormsServiceAgent();
AWCmdCheckSSN cmd = new AWCmdCheckSSN();
//set stuff in cmd
cmd.iServerID_ = uboEmployee_.getServerID();
cmd.iPersonID_ = uboEmployee_.getPersonID();
cmd.iMarketCountryID_ = iMarketCountryID_;
cmd.sSSN_ = sSSN_;
cmd.udsaPossibleDupe_ = new UDSPossibleDupe[0];
//execute cmd
env.insert(cmd);
agt.executeCmd(env, cmdStatus);
if (cmdStatus.getCode().equals(Constant.CMDSUCCESS)) {
return true;
}
else {
return false;
}
}
Low Tolerance for Method Length
- 23. 23 Copyright © 2012 3P Vantage, Inc.
6. Ownership vs. Rental
Treat it as not as
your own a rental!
- 24. 24 Copyright © 2012 3P Vantage, Inc.
Stuff You Would Do With a Rental
Car Code
Eat or drink in it Introduce code smells and leave them there
Drive on back roads Build unsound code
Accidentally break a handle or
knob, hope nobody finds out
Notice that you introduced a serious bug,
and not log it
Report faults and minor
nuisances to the agency
Leave TODO comments in the code
Rental property depreciates faster than owned property.
Ownership is a mind-set, not a matter of process.
How soon will you have to pay for today’s decisions?
- 25. 25 Copyright © 2012 3P Vantage, Inc.
7. Shared Responsibility
Shared ownership (no more @author)
Friends don’t let friends code alone
Boy Scout rule
Specializing generalists
Break down the silos
– Built because Urgent > Important
“We worked together in refactoring one of the existing legacy classes.
This was a big piece of complex code that did not have any unit test. At
the end of the exercise, we were able to simplify the code dramatically
and made the code easily testable.”
- 26. 26 Copyright © 2012 3P Vantage, Inc.
Getting There
Technology, skills, and process won’t suffice. You must
get started… and the deck is stacked against you:
Inertia (there’s always something more urgent)
Perceived barriers
– Distributed / Large / C++ / Deep in Legacy Code / Siloed
Whose problem is it, anyway?
Developers feel powerless
The costs are long-term and hard to see
- 27. 27 Copyright © 2012 3P Vantage, Inc.
But Once You Have It…
Developers programming without fear
Team development: more realistic, fewer surprises
True partnership with the business
Boost motivation through pride and ownership
- 28. 28 Copyright © 2012 3P Vantage, Inc.
Tomorrow: The Coding Part of It
May 8-9, I’ll lead the XP/Agile Engineering workshop:
Effective unit testing
Safe refactoring (including refactoring of large messes)
Simple design
Clean code
Two days of hands-on exercises and guided discovery.
Three seats remain. Will I see you there?