Gil Zilberfeld
How to TDD in legacy code
#1about 6 minutes
Why standard TDD fails in complex legacy code
Real-world code complexity and dependencies make the simple red-green-refactor cycle difficult and risky without existing tests.
#2about 3 minutes
A modified TDD process for existing codebases
A four-step approach is introduced, involving characterization tests and pre-refactoring before applying the standard TDD cycle.
#3about 7 minutes
Using characterization tests to create a safety net
Characterization tests are written to capture the current behavior of a system, including its bugs, providing a baseline for safe refactoring.
#4about 6 minutes
A step-by-step guide to fixing a bug
A bug is fixed by first writing a failing test, making the minimal code change to pass, and then refactoring both production and test code for clarity.
#5about 6 minutes
Pre-refactoring code to prepare for new features
Before adding new functionality, the code is refactored using techniques like guard clauses and switch statements to make the insertion point clear and simple.
#6about 3 minutes
Adding a new feature with the TDD cycle
After preparing the codebase, a new feature is added by writing a failing test and then implementing the minimal code required to make it pass.
#7about 5 minutes
Core principles for safe and fast development
The key takeaways are minimizing risk, separating new functionality from cleanup, and consistently leaving the code better than you found it.
#8about 9 minutes
Q&A on BDD and testing untestable code
The discussion covers the role of BDD and how to handle untestable code using tools like approval tests or snapshot testing to capture system behavior.
Related jobs
Jobs that call for the skills explored in this talk.
Hubert Burda Media
München, Germany
€80-95K
Intermediate
Senior
JavaScript
Node.js
+1
Matching moments
01:32 MIN
Organizing a developer conference for 15,000 attendees
Cat Herding with Lions and Tigers - Christian Heilmann
03:17 MIN
Selecting strategic partners and essential event tools
Cat Herding with Lions and Tigers - Christian Heilmann
04:22 MIN
Why HR struggles with technology implementation and adoption
What 2025 Taught Us: A Year-End Special with Hung Lee
04:57 MIN
Developing resilience by expanding your capacity for failure
What 2025 Taught Us: A Year-End Special with Hung Lee
03:28 MIN
Why corporate AI adoption lags behind the hype
What 2025 Taught Us: A Year-End Special with Hung Lee
03:38 MIN
Balancing the trade-off between efficiency and resilience
What 2025 Taught Us: A Year-End Special with Hung Lee
07:27 MIN
Comparing software maintenance to tattoo cover-ups
Devs vs. Marketers, COBOL and Copilot, Make Live Coding Easy and more - The Best of LIVE 2025 - Part 3
06:28 MIN
Using AI agents to modernize legacy COBOL systems
Devs vs. Marketers, COBOL and Copilot, Make Live Coding Easy and more - The Best of LIVE 2025 - Part 3
Featured Partners
Related Videos
Write tests you love, not hate
Jens Happe
Breaking the Bug Cycle: TDD for the Win
Nadeen Hussein
How To Test A Ball of Mud
Ryan Latta
Why you must use TDD now!
Alex Banul
TDD for Vue.js Developers
Markus Oberlehner
Treat yourself - A tale about dog training and test-driven development
Mirjam Aulbach
Yes, You Need to Unit Test your JavaScript. Here's How.
James Bender
Test Driven Development with JavaScript
Sascha Depold & Parinaz Roghany
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.

Confideck GmbH
Vienna, Austria
Remote
Intermediate
Senior
Node.js
MongoDB
TypeScript


Patronus Group
Berlin, Germany
Senior
Kotlin
Spring Boot
Amazon Web Services (AWS)

tree-IT GmbH
Bad Neustadt an der Saale, Germany
€54-80K
Intermediate
Senior
Java
TypeScript
Spring Boot

Douglas GmbH
Düsseldorf, Germany
Intermediate
Senior
React
TypeScript

Test Driven Solutions
Edinburgh, United Kingdom
Intermediate
Java
MySQL
NoSQL
Scrum
Jenkins
+4

Matching-IT
Utrecht, Netherlands
Remote
€4-6K
Senior
Vue.js
Node.js
Firebase
+4

Talonic
Berlin, Germany
Remote
€47-92K
Senior
CSS
MySQL
NoSQL
+12

UserTesting, Inc.
Edinburgh, United Kingdom
Intermediate
API
Ruby
Scrum
Python
Cypress
+7