Help! My Legacy Application is Unmaintainable!
 

Help! My Legacy Application is Unmaintainable!

on

  • 1,617 views

It's nice to work on Green Fields projects. But most of us aren't that lucky! Most organisations have large legacy code bases to maintain. And the legacy applications, ugly as they are, are often what ...

It's nice to work on Green Fields projects. But most of us aren't that lucky! Most organisations have large legacy code bases to maintain. And the legacy applications, ugly as they are, are often what generates the revenue!

But legacy code bases are not easy to work with. Adding new features, or even fixing bugs, is slow and fraught with danger. Unexpected regressions are commonplace. Long testing cycles is the norm.

In this talk we will look at some strategies that can enable you to add new features to legacy systems faster and more reliably. We will examine where the hold-ups typically are, and what We will learn how to write cost-effective automated regression tests suites, and how to use unit testing as a way to document your legacy code base for future work, and improve its quality along the way!

Statistics

Views

Total Views
1,617
Views on SlideShare
1,062
Embed Views
555

Actions

Likes
8
Downloads
20
Comments
0

5 Embeds 555

http://wakaleo.com 529
https://twitter.com 11
http://www.wakaleo.com 9
https://www.linkedin.com 3
http://www.linkedin.com 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Help! My Legacy Application is Unmaintainable! Help! My Legacy Application is Unmaintainable! Presentation Transcript

  • HELP! My Legacy Application is Unmaintainable! Reducing the cost of change in legacy code bases
  • Consulta nt   Trainer   Mentor   Author   Speaker   Coder John Fer guson S mar t
  • Legacy applications are difficult to maintain
  • Legacy applications generate revenue
  • What is a legacy application? Old code base?
  • What is a legacy application? Outdated technology
  • What is a legacy application? “Legacy code is code without tests”! ! - Michael Feathers
  • But what is wrong with legacy code? Nothing…if you don’t need to change it much
  • Legacy code is bad when… …it is hard to add new features
  • Legacy code is bad when… …changes risk introducing regressions
  • Legacy code is bad when… …poor coding style and/or lack of documentation makes the code hard to understand
  • Legacy code is bad when… …there are no automated tests
  • Legacy code is bad when… …it prevents you from delivering as quickly as you would like
  • Why not just rewrite it all?
  • Over  &me,  new  features  get   harder  and  harder  to  add Total cost to maintain the legacy application Cumulated effort to add new features Cost  of  not  rewri&ng Time
  • What do we really want? We need to be able to make the changes we need to make faster and more reliably
  • So how can we get changes out faster? Build a safety net Document the specifications
  • Build a safety net
  • Characterisation Test! ! A means to describe (characterise) the actual behaviour of an existing piece of software, and therefore protect existing behaviour of legacy code against unintended changes. ! Term coined by Michael Feathers
  • Broad, high level automated acceptance tests Application
  • To write good automated tests do not write tests
  • Write a user’s manual instead… …but automate it
  • Automate user journeys
  • Organise your requirements Browse the pr o duct catalog View pro duct details Search for pro ducts
  • Organise your requirements Browse the pr o duct catalog View pro duct details Search for pro ducts
  • Organise your requirements Browse the pr o duct catalog View pro duct details Search for pro ducts
  • Illustrate behaviour using examples
  • Document your business rules
  • Document your business rules
  • Good automated acceptance tests have layers Make them maintainable Keep them tidy Use layers!
  • Good automated acceptance tests have layers Make them maintainable Business  Rules Business  Flow Page/Component   interac&ons Page/Component   details
  • Start with high-level requirements
  • Drill down into more detailed requirements
  • Illustrate a requirement with tests
  • Documenting the specifications
  • A question of style Spock context["When cumulating Frequent Flyer points"] = () => { it["should earn points for each flight"] = () => { member.earnStatusPoints(100); member.earnStatusPoints(50); member.getStatusPoints().should_be(150); }; ! it["should get upgrade when enough points are earned"] = () => { member.earnStatusPoints(00); ! member.getStatus().should_be(Status.Silver); }; }; NSpec } }
  • A question of style JUnit
  • Adding new features TDD/BDD outposts in the wilderness
  • Discussion Time!
  • References BDD In Action - Manning http://thucydides.info http://www.wakaleo.com