Refactoring Kung-Fu, Part V

Last time we talked about flow analysis in the code. We figured out the cases we want covered. But, even for these cases, we don’t know what the expected result is. It’s worse than that in the real world. In our… Continue Reading…

Gil Zilberfeld explains about refactoring test cases in legacy code

Refactoring Kung Fu – Part IV

The current code version we’re talking about is tag 1.1. Last time, we have surrounded our code with a boundary, doing some early refactoring. We now know the entry points, and the exits are covered by interfaces, leaving code we… Continue Reading…

Gil Zilberfeld explains refactoring for legacy code, about method extraction and constructor injection for refactoring legacy code

Refactoring Kung Fu: Part III

Check out the original version of the code (Java, and also in C#, in tag 1.0). Right, time to move some code around. Before we do that, remember step #1 in our process: Draw a line around our tested code.… Continue Reading…

Gil Zilberfeld explains the principles of refactoring legacy code

Refactoring Kung Fu – Part II

Last time I gave you a sneak peak at our PastaMaker. You can check the whole project here. Let’s take a closer look. The main logic is in our PastaMaker, so focusing on testing it makes sense. Most of the… Continue Reading…

Gil Zilberfeld goes through an example of refactoring legacy code, on the way to creating tests for it

Refactoring Kung Fu – Part I

As long time readers, you know that if we’ve got legacy code, we want tests for that. However, the code doesn’t always play along. As you’ll see in this example, this is the kind of code that really needs tests.… Continue Reading…

Gil Zilberfeld explains the differences between the APIs for the TDD spring example.

Real Life TDD With Spring – The Road to the First Test III

We’ve come up with a few alternatives for the APIs (their draft version, anyway). I’m going to weigh them here, and remind ourselves – this is the internal API forma, but also has a REST counterpart. Let’s talk about each… Continue Reading…

Gil Zilberfeld describes options for API design for TDD Spring applications

Real Life TDD With Spring – The Road to the First Test II

Last time, we started thinking about considerations for picking the right test to start with. We decided to start with integration tests. So, which cases do we want to cover? Obviously, they should capture the main functionality of the system.… Continue Reading…

Gil Zilberfeld describes the thinking about selecting tests for TDD with Spring

Real Life TDD With Spring – The Road to the First Test I

When we set up the project, we ran a couple of tests (integration and unit) to see if the environment we have runs them. There was no actual logic involved, but we got initial feedback that the platform is ready… Continue Reading…

Gil Zilberfeld describes the initial Spring project, tests and TDD setup

Real Life TDD With Spring – Initial Project Setup

Finally! Actual TDD and code and Spring! Well, we’ll start with Spring first. But first a reminder. We’ve already constrained ourselves with the architecture. This is going to be a web based, REST services based Spring application. In the general… Continue Reading…

Gil Zilberfeld talks about more tdd examples for the Spring microservice project with integration testing

Real Life TDD – Test Case Analysis, Part IV

PM: You know, you could have something built by now. You do call this series “integration testing with Spring TDD” or something. Me: Yeah, and I would probably build something you did not want. Just a few more cases. Remember,… Continue Reading…

Copyright Gil Zilberfeld, 2025