Refactoring Legacy Code STEP BY STEP (Part 2)

Published: 12 August 2020
on channel: Continuous Delivery
12,632
436

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 second episode in this short mini-series, Dave Farley continues to demonstrate his 4 step approach to refactoring legacy code.

In this episode Dave describes steps 3 and 4, "Reducing Complexity" and "Composing Methods".

When Kent Beck wrote about TDD he introduced a profoundly valuable engineering practice to software development. Trying to introduce TDD to legacy systems is difficult. This exercise explores that process.

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 the final episode in this mini-series, Dave will take 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

-------------------------------------------------------------------------
Other Useful Books on this topic:
(Please note, if you buy a book from these links I get a small fee, without increasing the cost to you)

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 2) online without registration, duration hours minute second in high quality. This video was added by user Continuous Delivery 12 August 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 12,63 once and liked it 43 people.