m k using japanese to save your i a legacy s/w n b …...mikado method mikado game making a change...
TRANSCRIPT
![Page 1: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/1.jpg)
MIkado
Using Japanese to save your Legacy S/W
Kanban
+
![Page 2: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/2.jpg)
Mikado Method Mikado Game
Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in the pile.
Removing one impacts the others.And not in a good way…
What is the biggest difference?
![Page 3: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/3.jpg)
We canRevertourcode!
![Page 4: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/4.jpg)
The Guts of the Mikado Method
• Make the ONE change you need/want to make• See what broke – these are pre-requisites (the
next set of changes to make before doing this one)
• Visualize (add to graph)• REVERT !!Repeat until no breakages occur.
![Page 5: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/5.jpg)
DecoupleContent Edit &
PublishingServers
Create Standalone
Publish Server
ReimplementDB Interface
Remove Methods from
Edit ServerCode
Separate Storage
Interface
D i
s c o
v e
r y R e f a c t o r
Move Check UserPermissions
SeparateApproval
Logic
Move Publish-Reject
Code
ChangeDeployment
Properties
![Page 6: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/6.jpg)
For Defects…
• Need to use exploratory and regression testing to ID the next items to be graphed
• If not present, wrap unit tests around what you are touching
• Have testing occur in an environment that mimics as close to production as possible
![Page 7: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/7.jpg)
Real Mikado Power
• Comes when you have unit, integration, and acceptance tests
• These help reveal necessary refactors by showing failures that the change creates
• Safer than exploration to find breakages
![Page 8: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/8.jpg)
Some Restructuring Considerations
• Refactor Before Adding Functionality• Separate Bulky Interfaces (limiting the
consumers it serves)• Extract Methods/Classes into Common
Libraries
Let’s look at the first one…
![Page 9: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/9.jpg)
Refactor Before Adding Functionality
• Suppose -. . .public static final int FIVE_CARD_POKER = 0;public static final int INDIAN_POKER = 1;. . .Public class CardGameEngine {
. . .public void deal (Game game, User user, Dealer dealer) {
if (game.getType() == FIVE_CARD_POKER {user.setCards(dealer.deal(5));
} else if (game.getType() == INDIAN_POKER {user.setCards(dealer.deal(1));
} else {// else what?
}}
• Want to add War (each player is dealt 26 cards)• Could add it to the If-Then-Else logic, but this will get
messy, especially if I wanted to add more…
![Page 10: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/10.jpg)
Mikado Graph for Refactor
Add War card game
Refactor If statements to extract
game-specific logic
Move 5 Card Poker Logic to FiveCardPoker
class
Move Indian Poker Logic to IndianPoker
class
Implement WarLogic to War class
![Page 11: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/11.jpg)
Triage ReadyIntakeUpdate
Tests FIX Re-Test Deploy DONE
Done Done Done
![Page 12: M K Using Japanese to save your I a Legacy S/W n b …...Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in](https://reader034.vdocument.in/reader034/viewer/2022042305/5ed0550b3a066a18461b5e1b/html5/thumbnails/12.jpg)
THANK
YOU
ありがとうございました