You cant be agile if your code sucks
-
Upload
peter-gfader -
Category
Technology
-
view
22.153 -
download
0
description
Transcript of You cant be agile if your code sucks
You can’t be Agile if your code sucks
Peter Gfadertwitter.com/peitor
Start
the
convers
ation
My Mission
#1 Agile??
#2 Code & Craftmanship
About me
Peter Gfader
[email protected]://blog.gfader.comtwitter.com/peitor
Agile
What is Agile for you?
„And we
really mean
it“
The Agile Manifesto invites wimpy-ness"… Individuals and interactions over processes & tools…"
Yayy!! I don't have to follow those stupid processes any more!
"… Working software over comprehensive documentation…"W00t!! Dump the documentation! I LOVE this agile stuff!
"… Customer collaboration over contract negotiations…"I'm done when I'm done and I never have to say when!
"… Responding to change over following a plan…"No plans! No project managers! No architects!
Where do I sign up?© Alistair Cockburn
Warmduscher
What is Agile for you?
Lean
XPScrum
Agile
RUP
Kanban SAFe
What is all this stuff?
Enterprise
ScrumCrystal
DSDM
© Henrik Knieberg
Pair programming
Product Owner role
Physical tools
Process toolsa.k.a. ”organizational patterns”
Thinking toolsa.k.a. ”mindsets” or ”philosophies”
Lean AgileToolkitsa.k.a. ”frameworks”
Scrum XP
Visualize the workflowTo do Dev Release
H C
2Test
35Done!
3
D
G
K
A
B
FLOW
Kanban
Systems ThinkingTheory of Constraints
RUP
Tool”anything used as a means of accomplishing a task or purpose.”- dictionary.com
© Henrik Knieberg
© Henrik Knieberg
The illusion of a ”bad tool”
The old toolwas better!
Don’t blamethe tool!
© Henrik Knieberg
KeypointCompare for
understanding, not judgement
© Henrik Knieberg
KeypointCompare for
understanding, not judgement
Tools can be combined
© Henrik Knieberg
• Know your Goalo Why
• Agile/Lean are tools, not goals• Don’t limit yourself to one tool• Experiment & enjoy the rideoDon’t worry about getting it right
from start•We won’t
Take-away points
© Henrik Knieberg
Lean
XPScrum
Agile
RUP
Kanban SAFe
Enterprise
ScrumCrystal
DSDM
© Henrik Knieberg
The important thing isn’t the
process.
© Henrik Knieberg
The important thing isn’t the
process.
The important thing is the process
for improving your process.
© Henrik Knieberg
The important thing isn’t the
process.
The important thing is the process
for improving your process.
Continuous Improvement© Henrik Knieberg
3 essential skills neededregardless of process
Software craftsmanship
Splitting the system into useful pieces
Retrospectives
As a buyerI want to save my shopping cartso that I can continue shopping later
© Henrik Knieberg
3 essential skills neededregardless of process
Software craftsmanship
Splitting the system into useful pieces
Retrospectives
As a buyerI want to save my shopping cartso that I can continue shopping later
+ Communication Skills
+ Facilitator / ScrumMaster
+ Vision
3 essential skills neededregardless of process
Software craftsmanship
Splitting the system into useful pieces
Retrospectives
As a buyerI want to save my shopping cartso that I can continue shopping later
Essential Skill:
Software craftsmanship
1) Software is never written once and never
changed
[LARM03]
2) How to slow down your project?
Write crappy code
Write crappy code Make code easier to read
Easy code to read Easy code to change
maintain
Why do you write bad code?
#1 reason for Bad code
We write bad code, because we read bad code
Code Readings?• Code Reviews• Peer Reviews• Pair Programming• Open source
Good code is like a joke!
No need for explanation
#TODO: Code to readhttps://github.com/nsubstitute/NSubstitute https://github.com/techtalk/SpecFlowhttps://github.com/sf105/goos-codehttps://github.com/machine/machine.specificationshttps://github.com/BjRo/xunitbddextensionshttps://github.com/dtchepak/DaveSquared.StringsTheThing
#TODO: Review Code• In your team• With 1 peer• Open source• Brown bags – Lunch time
discussion
Code Reviews• Code, !Person• Constructively propose changes
Questions!
Code Reviews• Code, !Person• Constructively propose changes
Questions!
• Review not only codeo Testso Build processo ..
Code Reviews• Code, !Person• Constructively propose changes
Questions!
• Review not only codeo Testso Build processo ..
Grow as a team
Instead of“That lousy long method”
“I reviewed your code and found 1,2,3 things to change”
“If you don’t want to do it. I do it”
“Why don’t you split that method”
“Can you help me?”
“Can I help you with this? I think we can improve it”
Say
#2 reason for Bad codeNobody can write good code in 1 sit-in
-> Refactoringit’s an art of designing code
#TODO Refactoring
https://github.com/NotMyself/GildedRose
https://github.com/jcbozonier/Refactoring-Katas
The little issue with Refactoring?
• Don’t know our own quality
• Unclear what works and what doesn't
• Unintended consequences of changes remain hidden
• We are never done
• Change and refactor without fear
• Add new features faster
• Confidence that we didn't break anything
• We can actually be doneDone = Tested!
Development With and Without TestingWithout Tests With Tests
Refactoring+
Tests=?
Refactoring+
Tests=
Waste?? Overhead??
• Writing tests prior to writing the production code
• Test-Driven Development iso A design practiceo A powerful way to avoid defects in softwareo A feedback loop for validating code changeso A way to write tests
Test-Driven Development (TDD)
REFACTOR GREEN
RED
Goal is not to write tests but to write good code
Test-Driven Development (TDD)
REFACTOR GREEN
RED
What is Quality
“Why should I care?We have a QA department!”
**** ADD PIC ****
How do you measure Quality?
First Law of Programming
“Lowering Quality Lengthens Development
Time”
http://c2.com/cgi/wiki?FirstLawOfProgramming
Only Quality lets us go faster!
http://manifesto.softwarecraftsmanship.org/
Who?
Quality?• Measure of how well the software
is designed and implemented• Subjective
Quality?• LOC• Code Coverage• Class Coupling• Cohesion• Code Duplication• Cyclomatic Complexity
Quality: How to measure?• Highly subjective• Highly qualitative• Is the code readable, understandable?• Is the code verbose?• Variable/method names that are
meaningful• Simple code that works• Does it have tests? What’s the coverage?
Quality: How to measure?• Trends
Quality: How to measure?• Trends• “Output” over time
o Velocity - Trendo Business Value - Trendo Bug – Trends
• #TODO: How do you measure Business value?
Ways to Improve Quality• Avoid Silo Thinking
o Its not “us” vs “them”
• Start early• Don’t Compromise• Schedule time to lower your technical debt• Make it work; make it right (right away)• Requires monitoring and changing behavior• Be willing to help and be helped• Devise lightweight non-bureaucratic measures
Simple Design == High Quality?
• Passes its tests• Minimizes duplication• Maximizes clarity• Has fewer elements
http://c2.com/cgi/wiki?XpSimplicityRules
#TODO Visualize• Bug Trends• Build Status• Performance Report• Technical Debt• Code Quality
Visualize Technical Debt
http://verraes.net/2013/07/managed-technical-debt/
Build Monitor
Checkin Frequently• Focus your work on small tasks• Easier to describe what you did in your check-in
comment• Clear code history• Easier merging -> if you really need to branch and merge
• Fast code reviews• Never get merge hell -> only give it :-)
http://blog.gfader.com/2011/12/tfs-see-your-application-grow-like.html
Team Efforts• Avoid Shortcuts• Take collective ownership
Team should own the code• Promote positive interaction• Provide constructive feedback• Constant code review
Guantanamo Code Tool• All code is guilty until tested
innocent
• Do you have problems maintaining high test coverage?
• Send the untested code to Guantanamo!http://docs.codehaus.org/display/ASH/Guantanamo
Agile – the bar is rising
http://blog.gfader.com/2013/05/the-1st-principle-of-agile-manifesto-30.html
Our highest priority is to satisfy the
customer
through early and continuous delivery
of valuable software
1st principle of the Agile Manifesto
Our highest priority is to satisfy the
customer
through early and continuous delivery
of valuable software1st principle of the Agile Manifesto
delight the customer
Recap
The important thing isn’t the
process
The important thing is the process
for improving your process
Essential skills neededregardless of process
Software craftsmanship
Splitting the system into useful pieces
Retrospectives
As a buyerI want to save my shopping cartso that I can continue shopping later
#TODO TO READE. Goldratt “The Goal” S.Freeman, N.Price GOOS
#TODO References• Pragmatics of Agile Development
http://www.agiledeveloper.com/presentations/pragmatics_of_agile_development.pdf
• Kanban VS Scrumhttp://www.infoq.com/minibooks/kanban-scrum-minibook
• Agile Software Developmenthttp://www.agiledeveloper.com/presentations/AgileSoftwareDevelopment.zip
• A Thinking Tool called Agilehttps://sites.google.com/site/leanagileandscrum/lean-agile-scrum-conference-2010/presentations-las-2010/00_Kniberg_Keynote.pdf?attredirects=0&d=1
• The Four Elements of Simple Designhttp://www.jbrains.ca/permalink/the-four-elements-of-simple-design
• http://agilemanifesto.org/• http://manifesto.softwarecraftsmanship.org/
Now you1. Download presentation2. Search for #TODO3. Get it done4. Send me a tweet “I’m done”