Refactoring Legacy Code: STEP BY STEP (Part 1)

Published: 29 July 2020
on channel: Continuous Delivery
33,361
864

Ideas like TDD, BDD and Continuous Delivery are great, but how do you introduce them to legacy systems? Practically, hands-on, how do you change legacy-code to make it testable? In this episode Dave Farley starts a new mini-series to demonstrate the application of techniques like Approval Testing and code refactoring and applies them to some very nasty code.

When Kent Beck wrote about TDD he introduced a profoundly valuable engineering practice to software development. In his book “ Working Effectively with Legacy Code” Michael Feathers defines a legacy system as “a system without automated tests”. So how can we take advantage of the benefits of TDD when our code is the wrong shape, when it was developed without automated tests?

In this episode Dave will demonstrate two of his four steps to refactoring, Approval Testing and De-cluttering. In the next episode Dave will describe the next two steps, reducing complexity and composing methods. In the final episode in this mini-series, Dave takes this nasty code the final step to testability.

If you would like to try this for yourself, you can find the bad code, a simple Approval Test, and a sample XML file to support the test here: https://github.com/davef77/Refactorin...

--------------------------------------------------------------------------------------

You can get Dave Farley's FREE "How To..." guide on Acceptance Testing when you join our CD Mail List here ➡️ https://www.subscribepage.com/cd-atdd...

---------------------------------------------------------------------------------------

If you want to learn Continuous Delivery and DevOps skills, check out Dave Farley's courses:
➡️ https://bit.ly/DFTraining

📚 BOOKS:

📖 Dave’s NEW BOOK "Modern Software Engineering" is now available on
Amazon ➡️ https://amzn.to/3DwdwT3
In this book, Dave brings together his ideas and proven techniques to describe a durable, coherent and foundational approach to effective software development, for programmers, managers and technical leads, at all levels of experience.

📖 "Continuous Delivery Pipelines" by Dave Farley
paperback ➡️ https://amzn.to/3gIULlA
ebook version ➡️ https://leanpub.com/cd-pipelines

📖 The original award-winning “Continuous Delivery" book by Dave Farley and Jez Humble
➡️ https://amzn.to/2WxRYmx

---------------------------------------------------------------------------------------

Continuous Delivery Ltd. ➡️ https://bit.ly/ContinuousDeliveryDF

Dave Farley's Blog ➡️ https://bit.ly/DaveFWebBlog

Dave Farley on Twitter ➡️ https://bit.ly/DaveFTwitter

Dave Farley on LinkedIn ➡️ https://bit.ly/DaveF-LI

-------------------------------------------------------------------------

RECOMMENDED READING:

Test Driven Development: By Example (The Addison-Wesley Signature Series), Kent Beck ➡️ https://amzn.to/2NcqgGh

Working Effectively with Legacy Code, Michael Feathers ➡️ https://amzn.to/3hP0F4z


Watch video Refactoring Legacy Code: STEP BY STEP (Part 1) online without registration, duration hours minute second in high quality. This video was added by user Continuous Delivery 29 July 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 33,36 once and liked it 86 people.