SlideShare una empresa de Scribd logo
1 de 76
RESCUING LEGACY CODE
CURTIS “OVID” POE
CTO, ALL AROUND THE WORLD
OVID@ALLAROUNDTHEWORLD.FR
https://www.slideshare.net/Ovid/rescuing-alegacycodebase
ALL AROUND THE WORLD
CURTIS “OVID” POE
CTO, ALL AROUND THE WORLD
OVID@ALLAROUNDTHEWORLD.FR
QUESTION POLICY
CURTIS “OVID” POE
CTO
OVID@ALLAROUNDTHEWORLD.FR
SUBDUING MANAGERS
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
TYPICAL LARGE TEST SUITE
• Hour or more to run
• Tests often fail
• Hard to see errors
• Developers don’t run them
• Or only run “some” tests
• Or check Facebook while running tests
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
IRONY
Large test suites can
lead to poor quality
code!
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
TYPICAL LARGE TEST SUITE
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
With apologies to XKCD: https://xkcd.com/303/
WHAT THE DEVELOPER SAID
“Yeah, the test suite is too slow and it’s hurting quality. I
want to fix this by running most tests in a single process.
It’s going to take me two to four weeks of not adding
new features, but we’ll make up for it in increased
developer productivity and a higher quality application.”
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
WHAT THE MANAGER HEARD
“Yeah, the test suite is too slow and it’s hurting quality. I
want to fix this by running most tests in a single process.
It’s going to take me two to four weeks of not adding
new features, but we’ll make up for it in increased
developer productivity and a higher quality application.”
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
Public domain. Erin Whittaker, U.S. National Park Service - Grand Canyon National Park Facebook page
Manager
s
Developers
WHY DON’T MANAGERS LISTEN?
• Managers trust other managers
• Developers are always asking to change things
• Managers focus on business needs
• Developers focus on technical needs
• Risk profile is different
• Developers like fun tasks
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
HOW DO WE GET PAST THIS?
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
THEORY
• CEO and others create goals
• Upper management creates a strategy
• Middle management develops tactics
• Developers implement those tactics
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
REALITY
• Everybody makes shit up uses their intuition
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
WHAT THE MANAGER HEARD
“Yeah, the test suite is too slow and it’s hurting quality. I
want to fix this by running most tests in a single process.
It’s going to take me two to four weeks of not adding
new features, but we’ll make up for it in increased
developer productivity and a higher quality application.”
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
THE BUSINESS CASE
The “lite” version
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
FIRST QUESTIONS
1. What problem are you trying to solve?
2. Why are you trying to solve it?
3. What are your obstacles?
4. What is your solution?*
5. Why is it better than the alternatives?
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
THE SOLUTION
• What are the direct costs?
• What are the opportunity costs?
• What are the risks? (low, medium, high)
• What are the rewards? (low, medium, high)
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
TIPS
• Be honest
• Avoid loaded language
• Focus on business needs
• Catalyst vs. Mojolicious
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
CATALYST VERSUS
MOJOLICIOUS RISKS
Software appliances
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
CATALYST
• No explicit guarantees in the documentation
• Strong, proven track record of backwards-
compatibility
• Deemed “low risk”
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
MOJOLICIOUS
« Features may only be changed in a
major release, to fix a serious security
issue, or after being deprecated for at
least 3 months. »
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
http://mojolicious.org/perldoc/Mojolicious/Guides/Contributing
MOJOLICIOUS
« Only the two most recent stable
release series of Perl are supported. »
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ
MOJOLICIOUS
« We will also keep the distribution
installable up to a certain legacy
version that we deem worthy of
supporting, but not specifically optimize
for it, this is currently 5.10.1. »
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ
MOJO BREAKING CHANGES
• May 25: 4.01 release announcing the addition of a new reserved stash value in 3 months.
• June 3: 4.05 release announcing that all render methods will now return the invocant
instead of true/false.
• June 11: 4.09 release announcing that respond_to content negotiation will now honor other
previously ignored headers.
• …
• August 25: 4.21 release with a breaking change.
• September 3: 4.32 release with another breaking change.
• September 11: 4.33 release with yet another breaking change.
“We go from breaking changes once a year to breaking changes every week.” – Sebastian Riedel
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
https://groups.google.com/forum/#!topic/mojolicious/WnjvVC0bYjY
MOJOLICOUS
• Few explicit guarantees in the documentation
• Documentation suggests no commitment to backcompat
• History of developer complaints about breaking changes
• Deemed “medium to high risk”
This is not a criticism of Mojolicious!
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
RISK
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
CC BY-SA 3.0 https://commons.wikimedia.org/wiki/User:Guma89
BUSINESS CASE—TEST SUITES
PROS
• Easier to run tests
• Easier to find tests
• Fewer regressions =
lower maintenance
costs
• Increased productivity
= lower development
costs
CONS
• X? weeks of lost time
• Hard to get started
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
LOWER DEVELOPMENT COSTS
• 1 hour 20 minutes ⇒ 15 minutes
• Extra hour of developer productivity per day
• Equivalent of hiring having an extra developer
• Pays for itself in a month
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
REWRITE OR RESTRUCTURE?
Pros and Cons
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
OR THE THIRD OPTION …
• Rewriting
• Refactoring
• Reimagining
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
ROBERT X. CRINGELY SAYS …
“Cleaning up code” is a terrible thing. Redesigning
WORKING code into different WORKING code (also
known as refactoring) is terrible. The reason is that once
you touch WORKING code, it becomes NON-WORKING
code, and the changes you make (once you get it
working again) will never be known. It is basically a
programmer’s ego trip and nothing else. Cleaning up
code, which generally does not occur in nature, is a
prime example of amateur Open Source software.
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
https://web.archive.org/web/20121113182409/http://www.pbs.org/cringely/pulpit/2003/pulpit_20030501_000770.html
RESTRUCTURING …
Refactor [ree-fak-ter]
Noun:
The process of making a series of gradual
code changes without behavioral changes with
the goal of improving quality lowering
maintenance
costs.
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
REWRITE
PROS
• Cleaner architecture
• Easier to maintain
• More developers
• Make the impossible
possible
CONS
• Paying for two projects
• Extremely high risk
• Lost business
knowledge
• Lost technical
knowledge
• Larger scope of work
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
SPAGHETTI V. SPAGHETTI
PROS
• Cleaner architecture
• Easier to maintain
• More developers
• Make the impossible
possible
CONS
• Maintaining two
projects
• Extremely high risk
• Lost business
knowledge
• Lost technical
knowledge
• Larger scope of work
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
RESTRUCTURING
PROS
• Business knowledge
kept
• Technical knowledge
kept
• Only maintain one
system
• Smaller scope of work
CONS
• Technology lock-in
• “Impossible” needs
• Getting buy-in
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
GETTING BUY-IN
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
Business
needs
Technical
needs
Business
case
WOULD YOU PITCH THIS?
In a landmark 1995 study, the Standish Group
established that only about 17% of IT projects could be
considered “fully successful,” another 52% were
“challenged” (they didn't meet budget, quality or time
goals) and 30% were “impaired or failed.” In a recent
update of that study conducted for ComputerWorld,
Standish examined 3,555 IT projects between 2003 and
2012 that had labor costs of at least $10 million and
found that only 6.4% of [IT projects] were successful.
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
https://www.informationweek.com/strategic-cio/executive-insights-and-innovation/why-do-big-it-projects-fail-so-often/d/d-id/1112087
WHY REWRITES FAIL
• “But we’ve spent too much money to stop now!”
• Nobody wants to admit they’re wrong
• No capacity planning
• Unclear goals
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
BIGGEST REFACTORING
OBJECTION?
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
“WE DON’T KNOW HOW.”
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
THIS IS “HOW”.
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
WHAT’S THE PROBLEM?
• Too buggy?
• Too slow?
• Too unmaintainable?
• Something else?
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
OODA LOOP
• Observe
• Orient
• Decide
• Act
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
OODA LOOP
• Observe – Gather information
• Orient – Process information
• Decide – Take a decision
• Act – Implement that decision
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
OBSERVE: GATHER INFORMATION
• What are the functional requirements?
• What is the architecture?
• What documentation exists? (Danger!)
• What tests exists?
• What areas of the code are more fragile?
• What external resources does it require?
• …?
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
ORIENT: PROCESS INFORMATION
• Identify root cause of goal obstacles
• First facts, then opinions, then emotions
• Focus on root causes!
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
DECIDE: TAKE A DECISION
• Define success
• 50% test coverage ☹
• 50% monthly reduction in support calls ✓
• Decide your approach
• Set a timeframe
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
ACT: JUST DO IT!
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
DESIGNATED TECHNICAL EXPERT
• Understands business needs
• Understands system design/architecture
• Expert in primary language(s) of your codebase
• A strong automated testing background
• Very comfortable with code coverage tools
• A strong database background
• Ability to admit when they're wrong
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
ARCHITECTURE ROADMAP
• Determine the “ideal” architecture for your application
• Decide how to refactor towards this ideal
• Understand what must not change
• Integration tests against what must not change
• Pick a small initial target
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
PICKING YOUR TARGET
sub product {
my ($self, $customer_id, $product_id) = @_;
…
my $product = $self->dbh->selectall_arrayref(
“SELECT * FROM …”
);
…
print <<“END_HTML”;
<html><head>
…
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
PICKING YOUR TARGET
sub product ($self, $product_id) {
my $product = $self->model('Products')->fetch($product_id)
or $self->redirect('/status_not_found');
$self->stash( product => $product );
}
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
INITIAL TARGET
• SQL?
• HTML?
• Logic?
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
INITIAL TARGET
• Customer-facing?
• Backend?
• Smallest task/risk?
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
INTEGRATION TESTS
• Messy applications are hard to unit test
• Integration tests against the “view”
• Don’t stress about TDD
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
TESTS
• Restructuring should not change behavior
• Tests can help (not prevent) avoid changing behavior
• You probably need to rethink your testing strategy
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
TEST SUITE
• Use a test framework!
• Test database changes should be transparent
• High-level integration tests are high value
• Put fixtures in roles for easy sharing
• Tests must be discoverable
• Correctness first, then performance
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
CORRECTNESS EXAMPLE
• Same database as production
• Same version
• Same configuration
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
TEST FRAMEWORK
• Large websites use frameworks
• Large test suites should use frameworks
• Test::Class::Moose (TCM)
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
TCM BASE CLASS PSEUDO-CODE
package TestsFor::My::Project {
use Test::Class::Moose;
sub test_startup { begin transaction }
sub test_setup { begin savepoint }
sub test_teardown { rollback savepoint }
sub test_shutdown { rollback transaction }
}
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
WRITE TESTS!
sub test_vip_accounts_regenerate_stats_faster ( $test, $ ) {
my $winston = $test->character_winston;
ok !$winston->is_vip,
'Characters should not start as having a vip account';
my $yesterday = $test->now - period( days => 1 );
$winston->vip_until($yesterday);
ok !$winston->is_vip,
'... and vip_until in the past is not VIP';
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
PHASE TRANSITION
A change in a feature of a physical system that results in
a discrete transition of that system to another state.
Phase transitions often involve the absorption or
emission of energy from the system; ice, at 0 ° Celsius,
must absorb a considerable amount of heat energy to
become water.
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
ITERATING
1. Did the transition succeed?
2. What are our next steps towards our goal?
3. Plan next steps
4. Execute steps
5. Goto step1
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
ITERATING
• Separate restructuring and changing
• Remember your timeframe
• Remember your success criteria
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
PRIORITIZATION
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
PRIORITIZATION
• You already have buy-in
• But what to do next?
• Build mini ‘business cases’
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
A THREE-NUMBER BUSINESS CASE
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
A THREE-NUMBER BUSINESS CASE
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
THREE NUMBERS
• Complexity
• Monetization
• Utility
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
SCORING
score = (
(
(monetization * 40 + usability * 20)
-
(complexity * 40)
) + 500
)/10
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
A THREE-NUMBER BUSINESS CASE
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
BUILDING THE NUMBERS
• Automate spreadsheet creation
• Devs choose the complexity value
• Product owner chooses monetization and utility values
• Other factors may override!
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
NEXT STEPS
• Always focus on your measurable goal
• You can stop at any time
• You always have working code
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
QUESTIONS?
mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr

Más contenido relacionado

Similar a Rescuing a-legacy-codebase

DevOpsGuys FutureDecoded 2016 - is DevOps the Answer
DevOpsGuys FutureDecoded 2016 - is DevOps the AnswerDevOpsGuys FutureDecoded 2016 - is DevOps the Answer
DevOpsGuys FutureDecoded 2016 - is DevOps the AnswerDevOpsGroup
 
Surviving the hype cycle Shortcuts to split testing success
Surviving the hype cycle   Shortcuts to split testing successSurviving the hype cycle   Shortcuts to split testing success
Surviving the hype cycle Shortcuts to split testing successCraig Sullivan
 
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...Gene Kim
 
Mirco hering devops for systems of record final
Mirco hering devops for systems of record finalMirco hering devops for systems of record final
Mirco hering devops for systems of record finalMirco Hering
 
Four Laws of Tech Product Economics - Rich Mironov
Four Laws of Tech Product Economics - Rich MironovFour Laws of Tech Product Economics - Rich Mironov
Four Laws of Tech Product Economics - Rich MironovProductCampPortland
 
Smoothing the continuous delivery path a tale of two architectures - expert...
Smoothing the continuous delivery path   a tale of two architectures - expert...Smoothing the continuous delivery path   a tale of two architectures - expert...
Smoothing the continuous delivery path a tale of two architectures - expert...Equal Experts
 
Code mining : comment extraire et exploiter l’information détenue dans du cod...
Code mining : comment extraire et exploiter l’information détenue dans du cod...Code mining : comment extraire et exploiter l’information détenue dans du cod...
Code mining : comment extraire et exploiter l’information détenue dans du cod...Margo
 
Rich Mironov - Product Management Auckland Talk Slides
Rich Mironov - Product Management Auckland Talk SlidesRich Mironov - Product Management Auckland Talk Slides
Rich Mironov - Product Management Auckland Talk SlidesAnthony Marter
 
Business Analyst Series 2023 - Week 1 Session 1
Business Analyst Series 2023 -  Week 1 Session 1Business Analyst Series 2023 -  Week 1 Session 1
Business Analyst Series 2023 - Week 1 Session 1DianaGray10
 
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Fabrice Bernhard
 
IRJET- School in the Cloud
IRJET- School in the CloudIRJET- School in the Cloud
IRJET- School in the CloudIRJET Journal
 
Business Analyst Series 2023 - Week 1 Session 1
Business Analyst Series 2023 -  Week 1 Session 1Business Analyst Series 2023 -  Week 1 Session 1
Business Analyst Series 2023 - Week 1 Session 1DianaGray10
 
WinOps - Lessons learned from Enterprise DevOps with Microsoft technologies ...
WinOps - Lessons learned from Enterprise DevOps with Microsoft technologies  ...WinOps - Lessons learned from Enterprise DevOps with Microsoft technologies  ...
WinOps - Lessons learned from Enterprise DevOps with Microsoft technologies ...DevOpsGroup
 
ANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit Shah
ANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit ShahANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit Shah
ANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit ShahAgileNetwork
 
ODSC18, London, How to build high performing weighted XGBoost ML Model for Re...
ODSC18, London, How to build high performing weighted XGBoost ML Model for Re...ODSC18, London, How to build high performing weighted XGBoost ML Model for Re...
ODSC18, London, How to build high performing weighted XGBoost ML Model for Re...Alok Singh
 
This is a flash report of Agile2018 by The HIRO!
This is a flash report of Agile2018 by The HIRO!This is a flash report of Agile2018 by The HIRO!
This is a flash report of Agile2018 by The HIRO!LINE Corporation
 
Toolkits and tips for UX analytics CRO by Craig Sullivan
Toolkits and tips for UX analytics CRO by Craig SullivanToolkits and tips for UX analytics CRO by Craig Sullivan
Toolkits and tips for UX analytics CRO by Craig SullivanUXPA UK
 

Similar a Rescuing a-legacy-codebase (20)

DevOpsGuys FutureDecoded 2016 - is DevOps the Answer
DevOpsGuys FutureDecoded 2016 - is DevOps the AnswerDevOpsGuys FutureDecoded 2016 - is DevOps the Answer
DevOpsGuys FutureDecoded 2016 - is DevOps the Answer
 
Diseño --ejemplo---3
Diseño --ejemplo---3Diseño --ejemplo---3
Diseño --ejemplo---3
 
Surviving the hype cycle Shortcuts to split testing success
Surviving the hype cycle   Shortcuts to split testing successSurviving the hype cycle   Shortcuts to split testing success
Surviving the hype cycle Shortcuts to split testing success
 
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
 
Mirco hering devops for systems of record final
Mirco hering devops for systems of record finalMirco hering devops for systems of record final
Mirco hering devops for systems of record final
 
Four Laws of Tech Product Economics - Rich Mironov
Four Laws of Tech Product Economics - Rich MironovFour Laws of Tech Product Economics - Rich Mironov
Four Laws of Tech Product Economics - Rich Mironov
 
Smoothing the continuous delivery path a tale of two architectures - expert...
Smoothing the continuous delivery path   a tale of two architectures - expert...Smoothing the continuous delivery path   a tale of two architectures - expert...
Smoothing the continuous delivery path a tale of two architectures - expert...
 
Code mining : comment extraire et exploiter l’information détenue dans du cod...
Code mining : comment extraire et exploiter l’information détenue dans du cod...Code mining : comment extraire et exploiter l’information détenue dans du cod...
Code mining : comment extraire et exploiter l’information détenue dans du cod...
 
Rich Mironov - Product Management Auckland Talk Slides
Rich Mironov - Product Management Auckland Talk SlidesRich Mironov - Product Management Auckland Talk Slides
Rich Mironov - Product Management Auckland Talk Slides
 
Business Analyst Series 2023 - Week 1 Session 1
Business Analyst Series 2023 -  Week 1 Session 1Business Analyst Series 2023 -  Week 1 Session 1
Business Analyst Series 2023 - Week 1 Session 1
 
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
 
IRJET- School in the Cloud
IRJET- School in the CloudIRJET- School in the Cloud
IRJET- School in the Cloud
 
Business Analyst Series 2023 - Week 1 Session 1
Business Analyst Series 2023 -  Week 1 Session 1Business Analyst Series 2023 -  Week 1 Session 1
Business Analyst Series 2023 - Week 1 Session 1
 
Magento best practices
Magento best practicesMagento best practices
Magento best practices
 
WinOps - Lessons learned from Enterprise DevOps with Microsoft technologies ...
WinOps - Lessons learned from Enterprise DevOps with Microsoft technologies  ...WinOps - Lessons learned from Enterprise DevOps with Microsoft technologies  ...
WinOps - Lessons learned from Enterprise DevOps with Microsoft technologies ...
 
ANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit Shah
ANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit ShahANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit Shah
ANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit Shah
 
ODSC18, London, How to build high performing weighted XGBoost ML Model for Re...
ODSC18, London, How to build high performing weighted XGBoost ML Model for Re...ODSC18, London, How to build high performing weighted XGBoost ML Model for Re...
ODSC18, London, How to build high performing weighted XGBoost ML Model for Re...
 
Code vigil
Code vigilCode vigil
Code vigil
 
This is a flash report of Agile2018 by The HIRO!
This is a flash report of Agile2018 by The HIRO!This is a flash report of Agile2018 by The HIRO!
This is a flash report of Agile2018 by The HIRO!
 
Toolkits and tips for UX analytics CRO by Craig Sullivan
Toolkits and tips for UX analytics CRO by Craig SullivanToolkits and tips for UX analytics CRO by Craig Sullivan
Toolkits and tips for UX analytics CRO by Craig Sullivan
 

Más de Curtis Poe

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
life-off-earth.pptx
life-off-earth.pptxlife-off-earth.pptx
life-off-earth.pptxCurtis Poe
 
Corinna-2023.pptx
Corinna-2023.pptxCorinna-2023.pptx
Corinna-2023.pptxCurtis Poe
 
Corinna Status 2022.pptx
Corinna Status 2022.pptxCorinna Status 2022.pptx
Corinna Status 2022.pptxCurtis Poe
 
Rummaging in the clOOset
Rummaging in the clOOsetRummaging in the clOOset
Rummaging in the clOOsetCurtis Poe
 
Perl 6 For Mere Mortals
Perl 6 For Mere MortalsPerl 6 For Mere Mortals
Perl 6 For Mere MortalsCurtis Poe
 
Disappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
Disappearing Managers, YAPC::EU 2014, Bulgaria, KeynoteDisappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
Disappearing Managers, YAPC::EU 2014, Bulgaria, KeynoteCurtis Poe
 
How to Fake a Database Design
How to Fake a Database DesignHow to Fake a Database Design
How to Fake a Database DesignCurtis Poe
 
Are Managers An Endangered Species?
Are Managers An Endangered Species?Are Managers An Endangered Species?
Are Managers An Endangered Species?Curtis Poe
 
The Lies We Tell About Software Testing
The Lies We Tell About Software TestingThe Lies We Tell About Software Testing
The Lies We Tell About Software TestingCurtis Poe
 
A/B Testing - What your mother didn't tell you
A/B Testing - What your mother didn't tell youA/B Testing - What your mother didn't tell you
A/B Testing - What your mother didn't tell youCurtis Poe
 
Test::Class::Moose
Test::Class::MooseTest::Class::Moose
Test::Class::MooseCurtis Poe
 
A Whirlwind Tour of Test::Class
A Whirlwind Tour of Test::ClassA Whirlwind Tour of Test::Class
A Whirlwind Tour of Test::ClassCurtis Poe
 
Agile Companies Go P.O.P.
Agile Companies Go P.O.P.Agile Companies Go P.O.P.
Agile Companies Go P.O.P.Curtis Poe
 
Testing With Test::Class
Testing With Test::ClassTesting With Test::Class
Testing With Test::ClassCurtis Poe
 
Logic Progamming in Perl
Logic Progamming in PerlLogic Progamming in Perl
Logic Progamming in PerlCurtis Poe
 
Inheritance Versus Roles - The In-Depth Version
Inheritance Versus Roles - The In-Depth VersionInheritance Versus Roles - The In-Depth Version
Inheritance Versus Roles - The In-Depth VersionCurtis Poe
 
Inheritance Versus Roles
Inheritance Versus RolesInheritance Versus Roles
Inheritance Versus RolesCurtis Poe
 
Turbo Charged Test Suites
Turbo Charged Test SuitesTurbo Charged Test Suites
Turbo Charged Test SuitesCurtis Poe
 

Más de Curtis Poe (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
life-off-earth.pptx
life-off-earth.pptxlife-off-earth.pptx
life-off-earth.pptx
 
Corinna-2023.pptx
Corinna-2023.pptxCorinna-2023.pptx
Corinna-2023.pptx
 
Corinna Status 2022.pptx
Corinna Status 2022.pptxCorinna Status 2022.pptx
Corinna Status 2022.pptx
 
Rummaging in the clOOset
Rummaging in the clOOsetRummaging in the clOOset
Rummaging in the clOOset
 
Perl 6 For Mere Mortals
Perl 6 For Mere MortalsPerl 6 For Mere Mortals
Perl 6 For Mere Mortals
 
Disappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
Disappearing Managers, YAPC::EU 2014, Bulgaria, KeynoteDisappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
Disappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
 
How to Fake a Database Design
How to Fake a Database DesignHow to Fake a Database Design
How to Fake a Database Design
 
Are Managers An Endangered Species?
Are Managers An Endangered Species?Are Managers An Endangered Species?
Are Managers An Endangered Species?
 
The Lies We Tell About Software Testing
The Lies We Tell About Software TestingThe Lies We Tell About Software Testing
The Lies We Tell About Software Testing
 
A/B Testing - What your mother didn't tell you
A/B Testing - What your mother didn't tell youA/B Testing - What your mother didn't tell you
A/B Testing - What your mother didn't tell you
 
Test::Class::Moose
Test::Class::MooseTest::Class::Moose
Test::Class::Moose
 
A Whirlwind Tour of Test::Class
A Whirlwind Tour of Test::ClassA Whirlwind Tour of Test::Class
A Whirlwind Tour of Test::Class
 
Agile Companies Go P.O.P.
Agile Companies Go P.O.P.Agile Companies Go P.O.P.
Agile Companies Go P.O.P.
 
Econ101
Econ101Econ101
Econ101
 
Testing With Test::Class
Testing With Test::ClassTesting With Test::Class
Testing With Test::Class
 
Logic Progamming in Perl
Logic Progamming in PerlLogic Progamming in Perl
Logic Progamming in Perl
 
Inheritance Versus Roles - The In-Depth Version
Inheritance Versus Roles - The In-Depth VersionInheritance Versus Roles - The In-Depth Version
Inheritance Versus Roles - The In-Depth Version
 
Inheritance Versus Roles
Inheritance Versus RolesInheritance Versus Roles
Inheritance Versus Roles
 
Turbo Charged Test Suites
Turbo Charged Test SuitesTurbo Charged Test Suites
Turbo Charged Test Suites
 

Último

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 

Último (20)

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 

Rescuing a-legacy-codebase

  • 1. RESCUING LEGACY CODE CURTIS “OVID” POE CTO, ALL AROUND THE WORLD OVID@ALLAROUNDTHEWORLD.FR https://www.slideshare.net/Ovid/rescuing-alegacycodebase
  • 2. ALL AROUND THE WORLD CURTIS “OVID” POE CTO, ALL AROUND THE WORLD OVID@ALLAROUNDTHEWORLD.FR
  • 3. QUESTION POLICY CURTIS “OVID” POE CTO OVID@ALLAROUNDTHEWORLD.FR
  • 4. SUBDUING MANAGERS mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 5. TYPICAL LARGE TEST SUITE • Hour or more to run • Tests often fail • Hard to see errors • Developers don’t run them • Or only run “some” tests • Or check Facebook while running tests mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 6. IRONY Large test suites can lead to poor quality code! mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 7. TYPICAL LARGE TEST SUITE mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr With apologies to XKCD: https://xkcd.com/303/
  • 8. WHAT THE DEVELOPER SAID “Yeah, the test suite is too slow and it’s hurting quality. I want to fix this by running most tests in a single process. It’s going to take me two to four weeks of not adding new features, but we’ll make up for it in increased developer productivity and a higher quality application.” mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 9. WHAT THE MANAGER HEARD “Yeah, the test suite is too slow and it’s hurting quality. I want to fix this by running most tests in a single process. It’s going to take me two to four weeks of not adding new features, but we’ll make up for it in increased developer productivity and a higher quality application.” mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 10. mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr Public domain. Erin Whittaker, U.S. National Park Service - Grand Canyon National Park Facebook page Manager s Developers
  • 11. WHY DON’T MANAGERS LISTEN? • Managers trust other managers • Developers are always asking to change things • Managers focus on business needs • Developers focus on technical needs • Risk profile is different • Developers like fun tasks mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 12. HOW DO WE GET PAST THIS? mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 13. THEORY • CEO and others create goals • Upper management creates a strategy • Middle management develops tactics • Developers implement those tactics mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 14. REALITY • Everybody makes shit up uses their intuition mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 15. WHAT THE MANAGER HEARD “Yeah, the test suite is too slow and it’s hurting quality. I want to fix this by running most tests in a single process. It’s going to take me two to four weeks of not adding new features, but we’ll make up for it in increased developer productivity and a higher quality application.” mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 16. THE BUSINESS CASE The “lite” version mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 17. FIRST QUESTIONS 1. What problem are you trying to solve? 2. Why are you trying to solve it? 3. What are your obstacles? 4. What is your solution?* 5. Why is it better than the alternatives? mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 18. THE SOLUTION • What are the direct costs? • What are the opportunity costs? • What are the risks? (low, medium, high) • What are the rewards? (low, medium, high) mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 19. TIPS • Be honest • Avoid loaded language • Focus on business needs • Catalyst vs. Mojolicious mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 20. CATALYST VERSUS MOJOLICIOUS RISKS Software appliances mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 21. CATALYST • No explicit guarantees in the documentation • Strong, proven track record of backwards- compatibility • Deemed “low risk” mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 22. MOJOLICIOUS « Features may only be changed in a major release, to fix a serious security issue, or after being deprecated for at least 3 months. » mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr http://mojolicious.org/perldoc/Mojolicious/Guides/Contributing
  • 23. MOJOLICIOUS « Only the two most recent stable release series of Perl are supported. » mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ
  • 24. MOJOLICIOUS « We will also keep the distribution installable up to a certain legacy version that we deem worthy of supporting, but not specifically optimize for it, this is currently 5.10.1. » mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ
  • 25. MOJO BREAKING CHANGES • May 25: 4.01 release announcing the addition of a new reserved stash value in 3 months. • June 3: 4.05 release announcing that all render methods will now return the invocant instead of true/false. • June 11: 4.09 release announcing that respond_to content negotiation will now honor other previously ignored headers. • … • August 25: 4.21 release with a breaking change. • September 3: 4.32 release with another breaking change. • September 11: 4.33 release with yet another breaking change. “We go from breaking changes once a year to breaking changes every week.” – Sebastian Riedel mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr https://groups.google.com/forum/#!topic/mojolicious/WnjvVC0bYjY
  • 26. MOJOLICOUS • Few explicit guarantees in the documentation • Documentation suggests no commitment to backcompat • History of developer complaints about breaking changes • Deemed “medium to high risk” This is not a criticism of Mojolicious! mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 27. RISK mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr CC BY-SA 3.0 https://commons.wikimedia.org/wiki/User:Guma89
  • 28. BUSINESS CASE—TEST SUITES PROS • Easier to run tests • Easier to find tests • Fewer regressions = lower maintenance costs • Increased productivity = lower development costs CONS • X? weeks of lost time • Hard to get started mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 29. LOWER DEVELOPMENT COSTS • 1 hour 20 minutes ⇒ 15 minutes • Extra hour of developer productivity per day • Equivalent of hiring having an extra developer • Pays for itself in a month mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 30. REWRITE OR RESTRUCTURE? Pros and Cons mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 31. OR THE THIRD OPTION … • Rewriting • Refactoring • Reimagining mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 32. ROBERT X. CRINGELY SAYS … “Cleaning up code” is a terrible thing. Redesigning WORKING code into different WORKING code (also known as refactoring) is terrible. The reason is that once you touch WORKING code, it becomes NON-WORKING code, and the changes you make (once you get it working again) will never be known. It is basically a programmer’s ego trip and nothing else. Cleaning up code, which generally does not occur in nature, is a prime example of amateur Open Source software. mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr https://web.archive.org/web/20121113182409/http://www.pbs.org/cringely/pulpit/2003/pulpit_20030501_000770.html
  • 33. RESTRUCTURING … Refactor [ree-fak-ter] Noun: The process of making a series of gradual code changes without behavioral changes with the goal of improving quality lowering maintenance costs. mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 34. REWRITE PROS • Cleaner architecture • Easier to maintain • More developers • Make the impossible possible CONS • Paying for two projects • Extremely high risk • Lost business knowledge • Lost technical knowledge • Larger scope of work mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 35. SPAGHETTI V. SPAGHETTI PROS • Cleaner architecture • Easier to maintain • More developers • Make the impossible possible CONS • Maintaining two projects • Extremely high risk • Lost business knowledge • Lost technical knowledge • Larger scope of work mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 36. RESTRUCTURING PROS • Business knowledge kept • Technical knowledge kept • Only maintain one system • Smaller scope of work CONS • Technology lock-in • “Impossible” needs • Getting buy-in mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 37. GETTING BUY-IN mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr Business needs Technical needs Business case
  • 38. WOULD YOU PITCH THIS? In a landmark 1995 study, the Standish Group established that only about 17% of IT projects could be considered “fully successful,” another 52% were “challenged” (they didn't meet budget, quality or time goals) and 30% were “impaired or failed.” In a recent update of that study conducted for ComputerWorld, Standish examined 3,555 IT projects between 2003 and 2012 that had labor costs of at least $10 million and found that only 6.4% of [IT projects] were successful. mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr https://www.informationweek.com/strategic-cio/executive-insights-and-innovation/why-do-big-it-projects-fail-so-often/d/d-id/1112087
  • 39. WHY REWRITES FAIL • “But we’ve spent too much money to stop now!” • Nobody wants to admit they’re wrong • No capacity planning • Unclear goals mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 40. BIGGEST REFACTORING OBJECTION? mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 41. “WE DON’T KNOW HOW.” mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 42. THIS IS “HOW”. mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 43. WHAT’S THE PROBLEM? • Too buggy? • Too slow? • Too unmaintainable? • Something else? mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 44. OODA LOOP • Observe • Orient • Decide • Act mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 45. OODA LOOP • Observe – Gather information • Orient – Process information • Decide – Take a decision • Act – Implement that decision mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 46. OBSERVE: GATHER INFORMATION • What are the functional requirements? • What is the architecture? • What documentation exists? (Danger!) • What tests exists? • What areas of the code are more fragile? • What external resources does it require? • …? mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 47. ORIENT: PROCESS INFORMATION • Identify root cause of goal obstacles • First facts, then opinions, then emotions • Focus on root causes! mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 48. DECIDE: TAKE A DECISION • Define success • 50% test coverage ☹ • 50% monthly reduction in support calls ✓ • Decide your approach • Set a timeframe mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 49. ACT: JUST DO IT! mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 50. DESIGNATED TECHNICAL EXPERT • Understands business needs • Understands system design/architecture • Expert in primary language(s) of your codebase • A strong automated testing background • Very comfortable with code coverage tools • A strong database background • Ability to admit when they're wrong mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 51. ARCHITECTURE ROADMAP • Determine the “ideal” architecture for your application • Decide how to refactor towards this ideal • Understand what must not change • Integration tests against what must not change • Pick a small initial target mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 52. PICKING YOUR TARGET sub product { my ($self, $customer_id, $product_id) = @_; … my $product = $self->dbh->selectall_arrayref( “SELECT * FROM …” ); … print <<“END_HTML”; <html><head> … mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 53. PICKING YOUR TARGET sub product ($self, $product_id) { my $product = $self->model('Products')->fetch($product_id) or $self->redirect('/status_not_found'); $self->stash( product => $product ); } mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 54. INITIAL TARGET • SQL? • HTML? • Logic? mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 55. INITIAL TARGET • Customer-facing? • Backend? • Smallest task/risk? mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 56. INTEGRATION TESTS • Messy applications are hard to unit test • Integration tests against the “view” • Don’t stress about TDD mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 57. TESTS • Restructuring should not change behavior • Tests can help (not prevent) avoid changing behavior • You probably need to rethink your testing strategy mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 58. TEST SUITE • Use a test framework! • Test database changes should be transparent • High-level integration tests are high value • Put fixtures in roles for easy sharing • Tests must be discoverable • Correctness first, then performance mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 59. CORRECTNESS EXAMPLE • Same database as production • Same version • Same configuration mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 60. TEST FRAMEWORK • Large websites use frameworks • Large test suites should use frameworks • Test::Class::Moose (TCM) mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 61. TCM BASE CLASS PSEUDO-CODE package TestsFor::My::Project { use Test::Class::Moose; sub test_startup { begin transaction } sub test_setup { begin savepoint } sub test_teardown { rollback savepoint } sub test_shutdown { rollback transaction } } mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 62. WRITE TESTS! sub test_vip_accounts_regenerate_stats_faster ( $test, $ ) { my $winston = $test->character_winston; ok !$winston->is_vip, 'Characters should not start as having a vip account'; my $yesterday = $test->now - period( days => 1 ); $winston->vip_until($yesterday); ok !$winston->is_vip, '... and vip_until in the past is not VIP'; mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 63. mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 64. PHASE TRANSITION A change in a feature of a physical system that results in a discrete transition of that system to another state. Phase transitions often involve the absorption or emission of energy from the system; ice, at 0 ° Celsius, must absorb a considerable amount of heat energy to become water. mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 65. ITERATING 1. Did the transition succeed? 2. What are our next steps towards our goal? 3. Plan next steps 4. Execute steps 5. Goto step1 mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 66. ITERATING • Separate restructuring and changing • Remember your timeframe • Remember your success criteria mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 67. PRIORITIZATION mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 68. PRIORITIZATION • You already have buy-in • But what to do next? • Build mini ‘business cases’ mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 69. A THREE-NUMBER BUSINESS CASE mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 70. A THREE-NUMBER BUSINESS CASE mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 71. THREE NUMBERS • Complexity • Monetization • Utility mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 72. SCORING score = ( ( (monetization * 40 + usability * 20) - (complexity * 40) ) + 500 )/10 mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 73. A THREE-NUMBER BUSINESS CASE mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 74. BUILDING THE NUMBERS • Automate spreadsheet creation • Devs choose the complexity value • Product owner chooses monetization and utility values • Other factors may override! mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 75. NEXT STEPS • Always focus on your measurable goal • You can stop at any time • You always have working code mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr
  • 76. QUESTIONS? mardi 3 avril 2018©2018 ovid@allaroundtheworld.fr

Notas del editor

  1. The “uninitialized value” bug at the BBC
  2. It’s like a paid vacation for the dev.
  3. You may think your argument is solid, but managers have many other equally “solid” arguments for new features.
  4. But let’s pretend they don’t
  5. It’s like a paid vacation for the dev.
  6. Many resources on the web for writing a business case or project proposal BBC: CVS vs Subversion
  7. BBC: rewrote XML serialization in a month.
  8. Client was building software appliances (A software appliance is a software application combined with just enough OS to run on industry-standard hardware: server or VM) Upgrading underlying Perl not a realistic option Fixing a bug in Cat often means hunting through tons of dependencies. Mojo often just needs to be updated.
  9. You can’t keep piling on risks unless you like “Corporate Jenga”
  10. Less than a month if you factor in the costs of catching more bugs and writing more tests
  11. If you don’t mention alternatives, you look sloppy.
  12. BBC: rewrote XML serialization in a month.
  13. When costs encroach on revenue or there’s an external threat to your business model Needs to be addressed long before the tipping point Company who tried to hire us to maintain the system they were rewriting to Java
  14. Don’t refactor code you don’t need to maintain.
  15. Business knowledge: forgetting to assign a project to R&D and losing a tax break Lost technical knowledge: forgetting that some routers implement SNMP incorrectly Larger scope of work and more up front planning to layout what you’re going to keep
  16. Buy-in: see previous “intuition” slide Lock-in: Companies are bad at hiring
  17. Refactor: miss your goals, you still have your software. Rewrite: miss your goals, you may have nothing.
  18. If management is keen on rewriting, call it a “in-place rewrite”. Better still, call it “reinventing.”
  19. It’s not “too slow”, it’s “too slow because …”
  20. “Orient” is processing the information. Here’s where we really need hard data, but it’s often where intuition (read: biases) kick in.
  21. “Orient” is where we really need hard data, but it’s often where intuition (read: biases) kick in.
  22. Functional requirements are high level Fragility: bug/issue tracker and support staff
  23. 50% reduction in support calls: lose enough customers and you’ll hit that target. Hide your support number and you’ll hit that target.
  24. They might lead the project or simply consult
  25. For the sake of argument, we’ll assume few or no tests exist
  26. EXCELLENT TIME TO GET EXPERT HELP!
  27. Pull out template layer? Pull out SQL? Build a proper model?
  28. But what if you have a critical demo? Or what if you have one task with external dependencies beyond your control?
  29. But what if you have a critical demo? Or what if you have one task with external dependencies beyond your control?
  30. Your weights and priorities will differ
  31. But what if you have a critical demo? Or what if you have one task with external dependencies beyond your control?
  32. Does one ticket block another? Do you have legal considerations? Is a very important customer demanding a feature?