You are on page 1of 214

Technical Excellence

James W Grenning
wingman-sw.com
@jwgrenning

1
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 2
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
I Tried to Avoid
Computers

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 3
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 4
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
People will pay me
to do this?!!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 5
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 6
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 7
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 8
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
May 7 11:21:17: --- last message repeated 1 time ---
May 7 11:21:17 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:22:51 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:23:36 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:24:06: --- last message repeated 1 time ---
May 7 11:26:54 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:27:24: --- last message repeated 1 time ---
May 7 11:41:44 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:42:14: --- last message repeated 4 times ---
May 7 11:51:45 Cowboy kernel[0]: nspace-handler-set-snapshot-time: 1336409506
May 7 12:08:58 Cowboy kernel[0]: hibernate image path: /var/vm/sleepimage
May 7 12:08:58 Cowboy kernel[0]: sizeof(IOHibernateImageHeader) == 512
May 7 12:08:58 Cowboy kernel[0]: Opened file /var/vm/sleepimage, size 8589934592, partition base 0x0, maxio 400000 ssd 1

The seri
May 7 12:08:58 Cowboy kernel[0]: hibernate image major 14, minor 0, blocksize 512, pollers 5
May 7 12:08:58 Cowboy kernel[0]: hibernate_alloc_pages flags 00000000, gobbling 0 pages

al outpu
May 7 12:08:58 Cowboy kernel[0]: hibernate_setup(0) took 0 ms
May 7 12:09:01 Cowboy kernel[0]: en1: BSSID changed to 00:40:96:a1:33:c9
May 7 12:09:01 Cowboy kernel[0]: wlEvent: en1 en1 Link DOWN

t
May 7 12:09:01 Cowboy kernel[0]: AirPort: Link Down on en1. Reason 8 (Disassociated because station leaving).

p o r
May 7 12:09:01 Cowboy kernel[0]:

t was no
May 7 12:09:37 Cowboy kernel[0]: hibernate_page_list_setall start 0xffffff80d4cff000, 0xffffff80d4f98000

availabl
May 7 12:09:37 Cowboy kernel[0]: hibernate_page_list_setall time: 415 ms

t
May 7 12:09:37 Cowboy kernel[0]: pages 2040801, wire 338507, act 950045, inact 182445, spec 36, zf 113125, throt 0, could discard act 169869 inact 207719

e for deb
purgeable 38826 spec 40229
May 7 12:09:37 Cowboy kernel[0]: hibernate_page_list_setall found pageCount 1584158
May 7 12:09:37 Cowboy kernel[0]: IOHibernatePollerOpen, ml_get_interrupts_enabled 0

ug!
May 7 12:09:37 Cowboy kernel[0]: IOHibernatePollerOpen(0)
May 7 12:09:37 Cowboy kernel[0]: writing 1583874 pages
May 7 12:09:37 Cowboy kernel[0]: encryptStart 4f820
May 7 12:09:37 Cowboy kernel[0]: encryptEnd 108b02c0
May 7 12:09:37 Cowboy kernel[0]: image1Size 474682880, encryptStart1 4f820, End1 108b02c0
May 7 12:09:37 Cowboy kernel[0]: encryptStart 1c4b1600
May 7 12:09:37 Cowboy kernel[0]: encryptEnd b7957b30
May 7 12:09:37 Cowboy kernel[0]: PMStats: Hibernate write took 35189 ms
May 7 12:09:37 Cowboy kernel[0]: all time: 35189 ms, comp bytes: 6487916544 time: 6366 ms 971 Mb/s, crypt bytes: 2882564048 time: 4618 ms 595 Mb/s,
May 7 12:09:37 Cowboy kernel[0]: image 3080027136, uncompressed 6487916544 (535388), compressed 3068648576 (47%), sum1 ec64ffd2, sum2 571d97a2
May 7 12:09:37 Cowboy kernel[0]: wired_pages_encrypted 224499, wired_pages_clear 113814, dirty_pages_encrypted 1245651
May 7 12:09:37 Cowboy kernel[0]: hibernate_write_image done(0)
May 7 12:09:37 Cowboy kernel[0]: sleep
May 7 14:06:05 Cowboy kernel[0]: Wake reason: EC.LidOpen (User)
May 7 14:06:05 Cowboy kernel[0]: en1: 802.11d country code set to 'X0'.
May 7 14:06:05 Cowboy kernel[0]: en1: Supported channels 1 2 3 4 5 6 7 8 9 10 11 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 149 153
157 161 165
May 7 14:06:06 Cowboy kernel[0]: Sound assertion "0 == fAudioEngineArray" failed in AppleHDADriver at line 3163 goto Exit
May 7 14:06:08 Cowboy kernel[0]: Previous Sleep Cause: 5
May 7 14:06:08 Cowboy kernel[0]: MacAuthEvent en1 Auth result for: 00:40:96:a0:63:95 MAC AUTH succeeded
May 7 14:06:08 Cowboy kernel[0]: wlEvent: en1 en1 Link UP
May 7 14:06:08 Cowboy kernel[0]: AirPort: Link Up on en1
May 7 14:06:08 Cowboy kernel[0]: en1: BSSID changed to 00:40:96:a0:63:95
May 7 14:06:47 Cowboy kernel[0]: nspace-handler-set-snapshot-time: 1336417608

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 9
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Source
level deb
your so ug was ther
urce wa e, if
s ASM

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 10
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 11
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 12
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
My Roots in Agile

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 13
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Kent Beck Ron Jeffries

Ward Cunningham Martin Fowler

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 14
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Lets Have a Meeting

Robert Martin Alistair Cockburn

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 15
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
How Did I Find Myself at Agile
Manifesto Meeting?
Skiing!
James, do
you want to
go to the
Lightweight
Methods
Summit in
Snowbird? Sure Bob,
Ill go.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 16
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 17
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Before the
Agile Manifesto

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 18
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
FlashDriver
+ Program(addr, data)
FlashDriverTest + ProtectBlock(block)
+ EraseBlock(block)
//etc

<<interface>>
IO
+ Read(addr) : data
+ Write(addr, data)

<<implements>>

MockIO
<<implementation>>
+ Expect_Read(addr, data) <<hardware>>
IO
+ Expect_Write(addr, data)

<<interface>>
OurCode OurServiceRequests
+ doSomething()

Big Framework
<<implements>>
Big Framework
Client
Messaging
+ send() BFw Adaptor
+receive

MessageProcessor SerialDriver SemaphoreFake

WaitForMessage(buffer, length)
WaitForString(buffer, length, semophore)

Pend(semaphore)

Message
Interrupt is Processor is
collecting blocked,
characters waiting for
its
characters
Post(semaphore)

return

Copyright James W. Grenning

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 19
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
20
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 21
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
That may not have been
Watts intention, but it was the
message that industry was
hearing

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 22
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Did that work?

i n d u s t r y
Most the
f r o m d e f e c t s ,
suffere d
d f r u st r a t i on .
delays a n

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 23
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 24
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The first and foremost
statement stresses people

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 25
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
People and Values were Central
to Forming Agile

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 26
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
d e v e l o p m e n t i s
Softwa r e
a l l y a b o u t t h e
not cen t r
n d d o c u m e n t s
proces s a

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 27
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
static void checkEvent(ScheduledLightEvent* lightEvent)
{
if (randomEventAlreadyHappenedToday(lightEvent))
return;

http://www.freestockphotos.biz/license.php?id=9749
!
if (!TimeService_MatchesNow(lightEvent->day, lightEvent->minute +
lightEvent->randomMinutes))
return;
!
operateLight(lightEvent);
!
ScheduledLightEvent_Randomize(lightEvent);
preventAnotherRandomLightOperation(lightEvent);
}
!
void LightScheduler_Wakeup(void)

thanks: lumaxart
{
int i;
!
for (i = 0; i < MAX_EVENTS; i++)

Its about col


{
if (eventList[i].id != UNUSED)

laboration,
checkEvent(&eventList[i]);
}
}

customer, co
de, and prod
uct!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 28
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The Public First Scrum Class
(May 2003)

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 29
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Certified Scrum Masters
400000

300000

200000

100000

0
2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
Year
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 30
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Certified Scrum Students
400,000

Certified Scrum Developers Certified Scrum Masters


300,000

200,000

100,000

0
2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
Year
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 31
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
32
http://www.deviantart.com/art/Micro-manage-134602454
What is Scrum?

Scrum exposes every inadequacy or


dysfunction within an organizations
product and system development
practices. The intention of Scrum is to
make them transparent so the
organization can fix them.

Ken Schwaber

From an interview with Ken Schwaber on agilecollab - http://www.agilecollab.com/interview-with-ken-schwaber

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 33
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Like in the 80s! Short Cycle
Improvement

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 34
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Except without the Difficult
Improvement Part

ACT

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 35
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
36
37
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 38
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 39
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Not long after graduating
college, I joined an office product
company and started selling
copiers. I loved what i did.

James Murphy
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 40
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
I had no flight
experience, but I was
going to fly jets.

James Murphy
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 41
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Just two years after signing up, I was not only
flying, I was flying the supersonic F-15 Eagle

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 42
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 43
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
t r ef le ct i o n
Hone s
an al y s i s
an d

Pilots w er e
a t u r a t e d
Task S

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 44
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The Debrief outcome, gives the
refuel job to the boom operator, and
Copyright 2008-2014 James W. Grenning

All Rights Reserved @jwgrenning.
a rest for the pilot.
Technical Excellence
OOP, Munich 2015
www.wingman-sw.com
Oop@wingman-sw.com
45
What are We Supposed to Do?

The intention of Scrum is to make


them [your problems] transparent
so the organization can fix them.

Ken Schwaber
From an interview with Ken Schwaber on agilecollab - http://www.agilecollab.com/interview-with-ken-schwaber

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 46
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
How are we doing?

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 47
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Many think theyre doing great

In Company A 32% of the engineers said


they were in the top 5% of skill and quality
of work in the company. That seemed
outrageous until you go to Company B,
where 42% said they were in the top 5%.
So much for being lonely at the top.
Everybody tends to think that they are at
the top much more than they really are.
From David Dunning via Smart Planet
bit.ly/we-think-we-are-smart
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 48
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
40% think theyre in the
top 5%
!

87.5% of them are wrong!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 49
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 50
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 51
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
10 Year Agile Celebration

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 52
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
t d o w e , a s
Wh a
be r o f t h e
m e m
agile
u n i t y
comm
to f i x ?
need
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 53
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 54
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
We believe the agile
community must:

#1 Demand technical excellence


#2 Promote Individual [Change] and
Lead Organizational Change

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Remember what Ken Said?

"The intention of Scrum is to make


them [the problems] transparent so the
organization can fix them."

Ken Schwaber
Unfortunately, many organizations
change Scrum to accommodate the
inadequacies or dysfunctions instead
of solving them.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 56
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Everything is Going Smoothly

Iteration 1 Iteration 2 Iteration 3 Iteration 4 Hardening

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 57
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
ile 2014 La, la la.
Im lookin
for bugs

Thank you: Hubert Stoffels, from Pittsburgh, USA '''Title:''' Jonathan's Run Falls
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 58
'''Description:''' http://commons.wikimedia.org/wiki/File:Jonathan%27s_Run_Falls.jpg
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
HELLLLP!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com
Thanks to Yorian, Picture of a waterfall nearby Flam, Norway http:// 59
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
commons.wikimedia.org/wiki/File:Waterfall_in_Norway.jpg
What Happens We Save Test Until the End?

Test and Fix Test and Fix


Iteration 1 Iteration 2 Iteration 3 Iteration 4 Test Hardening
and Fix
Test and Fix
Test and Fix Test and Fix

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 60
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Do Your Work Degrade into a Fire Fight?

Why Do
es This
Happen
??

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 61
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 62
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 63
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Hackin
g in new
features
, chasin
manag g and
ing bug
not Tech s is
nical
Excellen
ce
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 64
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Whats the Problem?

The biggest problem worldwide for


Scrum teams is getting shippable code
at the end of every sprint.

Jeff Sutherland

from: Scrum with XP and Beyond

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 65
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The cad
ence of
changes d e v elopmen
with Sc t
rum

Are you
changin
enginee g the ho
r your p w you
roducts
?
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 66
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The Marriage of Scrum and XP

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 67
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
So Far the Marriage is Unequal
400,000

Certified Scrum Developers Certified Scrum Masters


300,000

s six 333820
k e

s
ta

ter
n i t D ?

as
200,000
e a C S

M
i s m o n e 54509

m
s t h s te r

u
o e a

cr
D m
dS
s t o
M
fie
CS
100,000
rti
Ce

T
y
0
2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
Year
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 68
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
- A Brief Debrief -
Current Development Practice
in Industry

As viewed from the pre-


training surveys I use to
better understand
attendee backgrounds

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 69
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 70
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
How do you test
your code?

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 71
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
May 7 11:21:17: --- last message repeated 1 time ---
May 7 11:21:17 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:22:51 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:23:36 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:24:06: --- last message repeated 1 time ---
May 7 11:26:54 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:27:24: --- last message repeated 1 time ---
May 7 11:41:44 Cowboy kernel[0]: IOSurface: buffer allocation size is zero
May 7 11:42:14: --- last message repeated 4 times ---
May 7 11:51:45 Cowboy kernel[0]: nspace-handler-set-snapshot-time: 1336409506
May 7 12:08:58 Cowboy kernel[0]: hibernate image path: /var/vm/sleepimage
May 7 12:08:58 Cowboy kernel[0]: sizeof(IOHibernateImageHeader) == 512
May 7 12:08:58 Cowboy kernel[0]: Opened file /var/vm/sleepimage, size 8589934592, partition base 0x0, maxio 400000 ssd 1
May 7 12:08:58 Cowboy kernel[0]: hibernate image major 14, minor 0, blocksize 512, pollers 5
May 7 12:08:58 Cowboy kernel[0]: hibernate_alloc_pages flags 00000000, gobbling 0 pages
May 7 12:08:58 Cowboy kernel[0]: hibernate_setup(0) took 0 ms
May 7 12:09:01 Cowboy kernel[0]: en1: BSSID changed to 00:40:96:a1:33:c9
May 7 12:09:01 Cowboy kernel[0]: wlEvent: en1 en1 Link DOWN
May 7 12:09:01 Cowboy kernel[0]: AirPort: Link Down on en1. Reason 8 (Disassociated because station leaving).
May 7 12:09:01 Cowboy kernel[0]:
May 7 12:09:37 Cowboy kernel[0]: hibernate_page_list_setall start 0xffffff80d4cff000, 0xffffff80d4f98000
May 7 12:09:37 Cowboy kernel[0]: hibernate_page_list_setall time: 415 ms
May 7 12:09:37 Cowboy kernel[0]: pages 2040801, wire 338507, act 950045, inact 182445, spec 36, zf 113125, throt 0, could discard act 169869 inact 207719
purgeable 38826 spec 40229
May 7 12:09:37 Cowboy kernel[0]: hibernate_page_list_setall found pageCount 1584158
May 7 12:09:37 Cowboy kernel[0]: IOHibernatePollerOpen, ml_get_interrupts_enabled 0
May 7 12:09:37 Cowboy kernel[0]: IOHibernatePollerOpen(0)
May 7 12:09:37 Cowboy kernel[0]: writing 1583874 pages
May 7 12:09:37 Cowboy kernel[0]: encryptStart 4f820
May 7 12:09:37 Cowboy kernel[0]: encryptEnd 108b02c0
May 7 12:09:37 Cowboy kernel[0]: image1Size 474682880, encryptStart1 4f820, End1 108b02c0
May 7 12:09:37 Cowboy kernel[0]: encryptStart 1c4b1600
May 7 12:09:37 Cowboy kernel[0]: encryptEnd b7957b30
May 7 12:09:37 Cowboy kernel[0]: PMStats: Hibernate write took 35189 ms
May 7 12:09:37 Cowboy kernel[0]: all time: 35189 ms, comp bytes: 6487916544 time: 6366 ms 971 Mb/s, crypt bytes: 2882564048 time: 4618 ms 595 Mb/s,
May 7 12:09:37 Cowboy kernel[0]: image 3080027136, uncompressed 6487916544 (535388), compressed 3068648576 (47%), sum1 ec64ffd2, sum2 571d97a2
May 7 12:09:37 Cowboy kernel[0]: wired_pages_encrypted 224499, wired_pages_clear 113814, dirty_pages_encrypted 1245651
May 7 12:09:37 Cowboy kernel[0]: hibernate_write_image done(0)
May 7 12:09:37 Cowboy kernel[0]: sleep
May 7 14:06:05 Cowboy kernel[0]: Wake reason: EC.LidOpen (User)
May 7 14:06:05 Cowboy kernel[0]: en1: 802.11d country code set to 'X0'.
May 7 14:06:05 Cowboy kernel[0]: en1: Supported channels 1 2 3 4 5 6 7 8 9 10 11 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 149 153
157 161 165
May 7 14:06:06 Cowboy kernel[0]: Sound assertion "0 == fAudioEngineArray" failed in AppleHDADriver at line 3163 goto Exit
May 7 14:06:08 Cowboy kernel[0]: Previous Sleep Cause: 5
May 7 14:06:08 Cowboy kernel[0]: MacAuthEvent en1 Auth result for: 00:40:96:a0:63:95 MAC AUTH succeeded
May 7 14:06:08 Cowboy kernel[0]: wlEvent: en1 en1 Link UP
May 7 14:06:08 Cowboy kernel[0]: AirPort: Link Up on en1
May 7 14:06:08 Cowboy kernel[0]: en1: BSSID changed to 00:40:96:a0:63:95
May 7 14:06:47 Cowboy kernel[0]: nspace-handler-set-snapshot-time: 1336417608
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 72
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 73
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 74
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 75
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 76
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Congra
tulation
s!!!
You are using state of art
practices from 1979
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 77
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Debug-l
ater
Program
ming

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 78
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The Physics of Debug Later
Programming (DLP)

Td Tfind T fix

Time

Mistake made Bug discovery


(bug injection)
Bug found Bug fixed

As Td increases, Tfind increases dramatically


Tfix is usually short, but can increase with Td
http://www.renaissancesoftware.net/blog/archives/16
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 79
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
A Bugs Life

From http://www.softwaretestinghelp.com/bug-life-cycle/
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 80
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Your program will have
bugs. And they will
surprise you when you
find them.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 81
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Zune 30G

8
200
1,
r3
be
m
ce
Copyright 2008-2014 James W. Grenning
Technical Excellence De www.wingman-sw.com 82
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime)

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 83
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
One That Got Away
static void SetYearAndDayOfYear(RtcTime* time)
{
int days = time->daysSince1980;
int year = STARTING_YEAR;
while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}
!
time->dayOfYear = days;
time->year = year;
}

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 84
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
This Test Could Have Prevented it

TEST(Rtc, check20081231)
{
days = daysSince1980(2008, 366);
CHECK(ConvertDays(days, &time));
assertDate(WED, 2008, 12, 31);
}
!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 85
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
h e r e d o t h e
W
o m e f r om ?
bugs c

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 86
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 87
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 88
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Really, Its Not Our Fault?

We put
them th
ere
James D. Murphy

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 89
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
This Work Flow is Designed to Allow
Defects

Development

Test

Defects
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 90
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
A Bugs Life

From http://www.softwaretestinghelp.com/bug-life-cycle/
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 91
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Edsger Dijkstra

If you want more effective


programmers, you will discover
that they should not waste their
time debugging, they should not
introduce the bugs to start with.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 92
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
We tend to do what we know

People do what they can conceive of,


but sometimes there are better solutions,
or considerations and risks they never
knew were out there. They dont take a
solution they dont know about.

From David Dunning via Smart Planet


bit.ly/we-think-we-are-smart
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 93
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
1 year 1 year 1 year 1 year 1 year

Ive got 10 years


experience!
1 year 1 year 1 year 1 year 1 year

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 94
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
We tend to do what we know

It is almost impossible for an individual left to their


own devices to get self-assessment right. The worth of
ones ideas runs through other people. That is, workers
should pay attention to what other workers are doing.
You can watch other people to benchmark how they
handle the same sorts of tasks or situations. Seek out
feedback from other workers or managers.

From David Dunning via Smart Planet


bit.ly/we-think-we-are-smart
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 95
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Kent Beck Ron Jeffries

Ward Cunningham Martin Fowler

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 96
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
eHarmony Match

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 97
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
XP Identifies Shared Values
and Defines the Technical Practices
Needed for Growing Computer Software

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 98
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Quality is important Focus on it every day

Testing is good Test all the time

Reviews are good Review all the time

Talk to your customer


Customer input is good
every day
Keep the plan alive, plan to
Planning is important replan

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 99
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The Physics of Debug Later
Programming (DLP)

Td Tfind T fix

Time

Mistake made Bug discovery


(bug injection)
Bug found Bug fixed

As Td increases, Tfind increases dramatically


Tfix is usually short, but can increase with Td
http://www.renaissancesoftware.net/blog/archives/16
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 100
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
HELLLLP!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com
Thanks to Yorian, Picture of a waterfall nearby Flam, Norway http:// 101
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
commons.wikimedia.org/wiki/File:Waterfall_in_Norway.jpg
Edsger Dijkstra

If you want more effective


programmers, you will discover
that they should not waste their
time debugging, they should not
introduce the bugs to start with.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 102
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Write a test
T Watch it fail
Make it pass
D Refactor (improve)
Repeat until done
D

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
If test moved upstream, could we get
working features to flow?

Copyright 2008-2013
2008-2014 James W. Grenning
Technical
devconfu,Excellence
Nov 2013 www.renaissancesoftware.net
www.wingman-sw.com 104
All Rights Reserved.
Reserved For@jwgrenning.
use by training attendees. OOP,Riga,
Munich
Latvia
2015
Test Driven Development james@renaissancesoftware.net
Oop@wingman-sw.com
Development and Test are a Continuum
Preventing Defects

Development

Test

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 105
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The Physics of Test Driven
Development
T d Tfind T fix

Time

Mistake
Mistake fixed
made
Mistake Root cause
discovery found

When Td approaches zero, Tfind approaches zero


In many cases, bugs are not around long enough to be considered
bugs.
See: http://www.renaissancesoftware.net/blog/archives/16

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 106
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
i s a c h a l l e n g e .
TD D

s h a r d t o l e a r n .
It

TDD i s F U N !
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 107
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
A Complex system that
works is invariably
found to have evolved
from a simple system
that worked.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 108
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Is your team doing TDD?

Does your team create


unit tests?
n g t es ts a f te r i s
W r i t i
not so f u n , b u t

e st s a re C r i t ic a l !
Uni t T
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 109
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
System Level Tests Cannot be
Thorough
How many sub-system tests are needed?

Tests
10
5 interactions states 5 interactions

10 5 interactions 10
states states

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 110
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
TDD unit tests can be thorough

How many unit tests are needed?

Tests Tests
10
5 interactions states 5 interactions

10 5 interactions 10
states states

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 111
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Looks and
feels right

Wired properly and


meets customer needs

Solid
foundation

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 112
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 113
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Tests Must be Automated

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 114
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Assume Test Effort is
Proportional to
25
Development Effort
20
Effort

15

10 dev

5 test

Iterations
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
If a system is working,
leave it alone. Don't
change anything.

Systems dont
appreciate being fiddled
and diddled with.

25% of all defects are


introduced while
changing and fixing code.
[R.B Grady, Software Process Improvement]

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
System Antics

System - something setup to attain a goal

nt r ic
, o r ecce
lou s
f ri v o
i n g ,
u s v i o r
s - am b e ha
n t i c
A

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 117
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Systems

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 118
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
System Antics

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 119
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Because
system
up -- we s act
have to
very car b e
eful.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 120
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Manual Test is
Unsustainable
25

20 w t h
le gro
Effort

a b
15 s ta in
su
Un
10 dev

5 test

Iterations
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Risk Accumulates in
the Untested Code Gap
25 Untested Code Gap
20 w t h
le gro
Effort

a b
15 s ta in
su
Un
10 dev

5 test

Iterations
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
My Take Away

Tests Must be Automated

Keep the cost of retest low

Kee p th e s ys t e m
running
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 123
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Try to Reframe the Problem

We cant afford t
o write automated
it takes away fro tests,
m adding new fe
atures

o n o t a u t o m a t e t e s ts ,
We cant afford t y
e s t ti m e t a k e s a w a
the manual ret
i n g n e w f e a t u r e s
from add
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 124
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
We believe the agile
community must:

#1 Demand technical excellence


#2 Promote Individual [Change] and Lead
Organizational Change

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Technic
al
Excellen
ce isnt
Just Pas
sing
Tests
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 126
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Why d o e s co d e
structur e m a t t e r ?

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 127
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
l u e s o f S o f twa r e
The Two Va

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 128
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Defined

Refactoring is the process of changing a software


system in such a way that it does not alter the external
behavior of the code yet improves its internal
structure. [REF]
!

Refactoring Debt

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 129
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Refactoring Goal

Clean code that works


Ron Jeffries

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 130
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
How?

Remove duplication
Fix bad names
J.B. Rainsberger

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 131
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Donald Knuth Says

Let us change our


traditional attitude to the
construction of programs.
Instead of imagining that
our main task is to
instruct a computer what to
do, let us concentrate rather
on explaining to human
beings what we want a
computer to do.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 132
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Really, Its Not Our Fault?

How are
we doin
at that o g
ne?
James D. Murphy

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 133
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Spaghetti Slide

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 134
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 135
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 136
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Martin Fowler Says

Any fool can write code


that the compiler
understands, but it takes
real skill to write code
other programmers can
understand.

From Refactoring - Improving the Design of Existing Code

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 137
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Code Badness Over time
100

75
Code Badness

50

25

Time
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 138
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Code Badness Over time
100

75
Code Badness

50

25

Time
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 139
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Developers Need to Know and Practice
Refactorings Three Critical Skills

Recognize what is wrong, fix it!


Keep the code working the whole time!
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 140
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
If a system is working,
leave it alone. Don't
change anything

Systems dont
appreciate being fiddled
and diddled with

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 141
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Refactoring vs.
Humpty Dumpty Redesign

ether. Envisioned
to g
u t i t b ac k
i g n e ffort. design
e i t a part, p during redes en
Tak
i s b roken Brok
stem g
T h e s y Debu rk
o
Code with Rew dictable
e
design problem Unpr py
p
Refacto Unha
r to the Improved
Test are better d
a lways p esign. design that works
The sys assing.
tem is n
ever bro
ken.

Humpty Dumpty from The Book of Knowledge,


p. 968, Vol. III, The Grolier Society, New York, 1911.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 142
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Automated Tests Make Refactoring Safer

Test Move
Test Extract
Test Replace switch
Test Extract
Test Encapsulate
Test Move
Test Extract
Test Rename

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 143
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Sustain Low Code Badness Over time
100

75
Code Badness

50

25

Time
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 144
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Spaghetti Slide

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 145
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Code Badness Over time
100

75
Code Badness

50

25

Time
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 146
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Why d o e s co d e
structur e m a t t e r ?

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 147
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
The Law ye r s ar e
Coming

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 148
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 149
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 150
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
a s l i t t l e a s a s i n g l e b i t
'v e d e m o n s t r a t ed h o w
"We t r o l o f t h e
s e t h e d ri v e r t o l o s e c o n
flip c a n c a u
c a r s d u e t o s o f t w a r e
engine speed in real e t ec t e d b y a n y
n t h a t i s n o t r el i a b l y d
malfun ct i o
fail-safe," f B a r r G r ou p
a r r , C T O , c o - f o u n d e r o
- M i c h ae l B
http://www.eetimes.com/document.asp?doc_id=1319903 151
Kitchen Sink (a.k.a. do it all) task
Responsible for closed loop control and failsafes

ov erfl ow an d so ft w ar e bu gs le d to m em or y
Stack
on , he sa id . A nd it tu rn s ou t th at th e crux of
corrupti
e w as th es e m em or y co rr up ti on s, w hi ch ac te d
the issu
"like ricocheting bullets."
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
n t w a n t t o cr e at e
You do
this website

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 153
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Why doesnt your team use
TDD and Refactoring and the
other technical practices of
Agile?

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 154
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Were different!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 155
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
We cant use TDD
and Refactoring!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 156
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Everything is fine.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 157
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
REALLY!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 158
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
pay no attention
to that fire over
there
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 159
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
REALLY!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 160
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Were BUSY!

ACT

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 161
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
What Slows You Down?

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 162
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
90%
done
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 163
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 164
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
1

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 165
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Were different!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 166
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Embedded software

is special

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 167
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Web service software

is special

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 168
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Health Insurance
software

is special

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 169
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Design automation

is special

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 170
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Financial Software

is special

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 171
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
YOU

are special

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 172
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
It just does not
matter.

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 173
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
What are We Supposed to Do?

The intention of Scrum is to make


them [your problems] transparent
so the organization can fix them.

Ken Schwaber
From an interview with Ken Schwaber on agilecollab - http://www.agilecollab.com/interview-with-ken-schwaber

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 174
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
What is the biggest problem of getting
there?

The biggest problem worldwide for


Scrum teams is getting shippable code
at the end of every sprint.

from: Scrum with XP and Beyond

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 175
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
W h a t is i n yo ur
way?

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 176
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
y B o s s w nt
o
` let me
M

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 177
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
o p m e n t
D e v e l t
o n s w a n
a n i z a t i
Org o pm e n t .
t d e v e l
fas

178
t i m e f o r
t h a v e
I don r a s t u f f !!
t h i s e x t
a ll

179
The Physics of Debug Later
Programming (DLP)

Td Tfind T fix

Time

Mistake made Bug discovery


(bug injection)
Bug found Bug fixed

As Td increases, Tfind increases dramatically


Tfix is usually short, but can increase with Td
http://www.renaissancesoftware.net/blog/archives/16
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 180
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 181
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Refactoring Conferences
More
Domain Development New people
People who Knowledge teams
learn things
Disciplined
process Orange
system Fridays Mentor other
complexity More work HR interviews
people
Skills coordination
Cowboy Daily
coding Work Meetings
Technical experience
Unstable /
debt slow Tests Slow workstation Waste and
Meetings UX meetings
Non-value
added activity
Deadlines Short term
Development
boost
Speed Board
Overtime Work / Life meetings
Sport at work
balance
Passion
Sport /
Hobbies
Open outside work
Space
Cooperative
Bugs testing Prototypes
Focused Re-work
Work Large WIP
people rotations
between teams Unclear
Wait states requirements
Multi-tasking Good Specs
http://bit.ly/sw-dev-speed
Emergency
rotation Bad UX - Dev
IM/Skype Do right things transition

Good Features
Fast feedback Ranking Model

Michael Dubakov
Good It depends Bad
Increasing eect Decreasing eect Speed in SW Development
http://bit.ly/sw-dev-speed 182
system
complexity
Skills

Development
Speed

183
Technical
debt

Deadlines Short term


Development
boost
Speed
Overtime

184
system
complexity

Technical
debt

Deadlines Short term


Development
boost
Speed
Overtime

185
system
complexity

Technical
debt

Deadlines Short term


Development
boost
Speed
Overtime

Focused
Work

186
system
complexity

Technical
debt

Deadlines Short term


Development
boost
Speed
Overtime

Focused
Work Large WIP
people rotations
between teams

Multi-tasking
Emergency
rotation

187
system
complexity

Technical
debt

Deadlines Short term


Development
boost
Speed
Overtime

Bugs
Focused Re-work
Work Large WIP
people rotations
between teams Unclear
requirements
Multi-tasking
Emergency
rotation
Do right things
188
system
complexity

Technical
debt

Slow workstation

Deadlines Short term


Development
boost
Speed
Overtime

Bugs
Focused Re-work
Work Large WIP
people rotations
between teams Unclear
requirements
Multi-tasking
Emergency
rotation
Do right things
189
More
Development
teams

system
complexity

Technical
debt

Slow workstation

Deadlines Short term


Development
Development
boost
Speed
Speed
Overtime

Bugs
Focused Re-work
Work Large WIP
people rotations
between teams Unclear
requirements
Multi-tasking
Emergency
rotation
Do right things
190
More
Development New people
teams

system
complexity HR interviews

More work
Mentor other
coordination
people
Technical
debt

Slow workstation Waste and


Short term Non-value
Deadlines Development
Development
Development
boost added activity
Speed
Speed
Overtime

Meetings

Bugs
Focused Re-work
Work Large WIP
people rotations
between teams Unclear
requirements
Multi-tasking
Emergency
rotation
Do right things
191
More
Development New people
teams

system
complexity HR interviews

More work
Mentor other
coordination
people
Technical
debt

Slow workstation Waste and


Short term Non-value
Deadlines Development
Development
Development
boost added activity
Speed
Speed
Overtime

Meetings

Bugs
Focused Re-work
Work Large WIP
people rotations
between teams Unclear
requirements
Multi-tasking
Emergency
rotation
Do right things
192
Of cou
rse we
have t d o nt
ime!!
193
More
Conferences Development New people
teams

Domain
system People who Knowledge
complexity learn things HR interviews

More work
Mentor other
coordination
people
Technical
debt
Skills

Slow workstation Waste and


Work
Short termexperience Non-value
Deadlines Development
Development
Development
boost added activity
Speed
Speed
Overtime

Development
Speed Meetings
Work / Life
balance
Passion Bugs
Focused Re-work
Work Large WIP
people rotations
between teams Unclear
requirements
Multi-tasking
Emergency Focused
rotation Work
Do right things
Conferences

Domain
People who Knowledge
learn things

Skills

Work
experience

Development
Speed
Work / Life
balance
Passion

Focused
Work
system
complexity

Technical
debt

Deadlines Short term


Development
boost
Speed
Overtime

l i n e s ,
r e d e a d
y a s i n g
Wh d i n c r e a
m e , a n h a
o v e rt i b t s u c
i c a l d e
t e ch n t ic e i n
a r p r a c
po p u l t ?
lo p m e n
deve 196
e d e s t r u c ti v e p ra c t ic e s
Why a r e t h
o r e p r e v a l e n t?
so much m More
Development New people
teams

system
complexity HR interviews

More work
Mentor other
coordination
people
Technical
debt

Slow workstation Waste and


Short term Non-value
Deadlines Development
Development
Development
boost added activity
Speed
Speed
Overtime

Meetings

Bugs
Focused Re-work
Work Large WIP
people rotations
between teams Unclear
requirements
Multi-tasking
Emergency
rotation 197
Do right things
We tend to do what we know

People do what they can conceive of,


but sometimes there are better solutions,
or considerations and risks they never
knew were out there. They dont take a
solution they dont know about.

From David Dunning via Smart Planet


bit.ly/we-think-we-are-smart
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 198
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Managers, Leaders and Coaches
TODO
Make sure your team
knows state of the art
practices
Support
Make sure your learning,
organization problem solving,
knows why they and continuous
are important improvement
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 199
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Yeah but Im an engineer

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 200
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
People are generally
doing the best they know

Often, people dont know


what they dont know
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 201
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Developers
TODO
Build Trust -
Become an
Make your
expert in
Work Visible
your craft
Work with
others Become an
learn and try advisor to your
new things organization
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 202
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
a r e o f l i m it s
Be w

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 203
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Scrum Masters
TODO

Encourage your
people to be
problem solvers N ot do gm a
followers
Remember: there are no scrum slaves
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 204
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Managers
TODO:

Grow great Stop


teams Motivating
Your Team

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 205
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Motivation

Motivating an individual or
a team is hard

While demotivating them is


really easy!
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 206
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Avoid De-motivators

Unrealistic Punishing
deadlines the truth
Encouraging
poor quality work
Lack of trust Stretch goals
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 207
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Motivators

Knowing Problem
the Vision solving
Knowing
Trust
why it is
important Mutual respect
Copyright 2008-2014 James W. Grenning
Technical Excellence www.wingman-sw.com 208
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
I Tried to Avoid
Computers

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 209
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Thanks @tech_faq
!
https://twitter.com/tech_faq/status/386781833343414272/photo/1

210
People will pay me
for this?!!

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 211
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
Putting out fires in the untested
code gap is not technical
excellence

25 Untested Code Gap


20
r owth
le g
Effort

a b
15 st ain
nsu
U
10 dev

5 test

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 212
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com
http://commons.wikimedia.org/wiki/File:Abies_nordmanniana_PAN_2.jpg

Copyright 2008-20XX
2008-2014 James
JamesW.
W.Grenning

Grenning
Technical Excellence
__EVENT__ www.wingman-sw.com 213
All Rights Reserved @jwgrenning. OOP,The
Munich
End 2015 james@wingman-sw.com
Oop@wingman-sw.com
Demand Technical Excellence
Talk to me on Twitter
@jwgrenning!
!
Find my book at!
http://wingman-sw.com/tddec
!
Find me on linkedin.com
http://www.linkedin.com/in/jwgrenning
Please remind me how we met.
!
http://www.wingman-sw.com
http://www.wingman-sw.com/blog

Copyright 2008-2014 James W. Grenning


Technical Excellence www.wingman-sw.com 214
All Rights Reserved @jwgrenning. OOP, Munich 2015 Oop@wingman-sw.com

You might also like