mikado method - beheading the legacy beast - agile india 2012

Post on 31-Oct-2014

1.312 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Beheading the legacy beast

Refactorings & restructurings with

The Mikado Method

Daniel Brolund @danielbrolund#mikadomethod @mikadomethod

Code change horror stories!!

Once upon a time, we were to change

a codebase...

Lets say this was our system...

A change

We were to make a change...

A change

...but we got some errors...

✘ ✘✘

✘✘✘✘

A change

Patching led to more errors...

✘ ✘✘

✘✘✘✘

A change

Patching led to more errors...

✘ ✘✘

✘✘✘✘

✘✘✘✘

A change

Patching led to more errors...

✘ ✘✘

✘✘✘✘

✘✘✘✘

✘✘

✘✘

A change

Patching led to more errors...

✘ ✘✘

✘✘✘✘

✘✘✘✘

✘✘

✘✘

✘✘✘

✘✘ ✘

✘✘

A change

...and each patch led to even more errors...

✘ ✘✘

✘✘✘✘

✘✘✘✘

✘✘

✘✘

✘✘✘

✘✘ ✘

✘✘

A change

...and each patch led to even more errors...

✘ ✘✘

✘✘✘✘

✘✘✘✘

✘✘

✘✘

✘✘✘

✘✘ ✘

✘✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

A change

Like trying to stop the shockwave with our hands...

✘ ✘✘

✘✘✘✘

✘✘✘✘

✘✘

✘✘

✘✘✘

✘✘ ✘

✘✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

A change

✘ ✘✘

✘✘✘✘

✘✘✘✘

✘✘

✘✘

✘✘✘

✘✘ ✘

✘✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

✘✘ ✘

We could only revert.

We could only revert.

But we really needed to do that change!

A change

The same change...

A change

...the same errors...

✘ ✘ ✘✘

✘✘✘✘

A change

This time, we noted a prerequisite for each

of the errors...

✘ ✘ ✘✘

✘✘✘✘

A change

Prereq

This time, we noted a prerequisite for each

of the errors...

✘ ✘ ✘✘

✘✘✘✘

A change

PrereqPrereq

This time, we noted a prerequisite for each

of the errors...

✘ ✘ ✘✘

✘✘✘✘

A change

Prereq

Prereq

Prereq

This time, we noted a prerequisite for each

of the errors...

✘ ✘ ✘✘

✘✘✘✘

A change

Prereq

Prereq

Prereq

...then we reverted the errors,

but we kept the notes!

A change

Prereq

Prereq

PrereqThen we implemented the

prerequisites, one at a time...

A change

Prereq

Prereq

PrereqThen we implemented the

prerequisites, one at a time...

A change

Prereq

Prereq

Prereq

...got newerrors...

✘✘✘✘

✘✘✘✘

A change

Prereq

Prereq

Prereq

...noted the new prerequisites...

✘✘✘✘

✘✘✘✘

A change

Prereq

Prereq

Prereq

Prereq

...noted the new prerequisites...

✘✘✘✘

✘✘✘✘

A change

Prereq

Prereq

Prereq

Prereq

Prereq

...noted the new prerequisites...

✘✘✘✘

✘✘✘✘

A change

Prereq

Prereq

Prereq

Prereq

Prereq

✘✘✘✘

✘✘✘✘

...and reverted

again

A change

Prereq

Prereq

Prereq

Prereq

Prereq

...and reverted

again

A change

Prereq

Prereq

Prereq

Prereq

Prereq

Picked thenext leaf a.s.o...

A change

Prereq

Prereq

Prereq

Prereq

Prereq

...until we could do a prerequisite w/o

errors

A change

Prereq

Prereq

Prereq

Prereq

Prereq

✔✔

We continued with all leaves...

A change

Prereq

Prereq

Prereq

Prereq

Prereq

✔✔

...getting transient prerequisites in place...

A change

Prereq

Prereq

Prereq

Prereq

Prereq

✔✔

✔ ✔ ...fulfilling prerequisites...

A change

Prereq

Prereq

Prereq

Prereq

Prereq

✔✔

...working the way back to the

original change

A change

Prereq

Prereq

Prereq

Prereq

Prereq

In time, all prerequisites for the original change

were in place...

✔✔

A change

Prereq

Prereq

Prereq

Prereq

Prereq

✔✔

The change was now easy to implement.

A change

Prereq

Prereq

Prereq

Prereq

Prereq

✔✔

We’re done!

Mikado Method“rules”

Mikado Method“rules”

Write down your goal

Mikado Method“rules”

Seek things to tryWrite down your goal

Mikado Method“rules”

Seek things to tryBack out broken code

Write down your goal

Mikado Method“rules”

Seek things to tryBack out broken code

Fix the prerequisites recursively

Write down your goal

Benefits

Benefits

Always deliverable - from the main branch

Benefits

Always deliverable - from the main branch

Goal focus - do only the necessary

Benefits

Always deliverable - from the main branch

Goal focus - do only the necessary

Visualization - memo and cooperation

The Mikado Method?!?

The Mikado Method?!?

?!?Now, where’s the code...?!?

Let's do an example!

Welcome to Pasta Inc.

Exercise: D.I.Y.Instructions:http://mikadomethod.wordpress.com/exercises/

Code:https://github.com/mikadomethod/kata-java

Git:git clone git://github.com/mikadomethod/kata-java.git

git clone git://github.com/mikadomethod/kata-dotnet.git

The bookDaniel Brolund @danielbrolundOla Ellnestam @ellnestam#mikadomethod @mikadomethod

http://mikadomethod.orghttp://mikadomethod.wordpress.com/bookhttp://groups.google.com/group/mikado-method Daniel Brolund

Ola Ellnestam

Beheading the Legacy Beast

Relentless restructurings with

The Mikado Method

Foreword by Tom Poppendieck

Questions?

...or catch me later!

???

top related