Use Data to Split a God Class

Problem and Solution Overview This recipe just states how to execute a solution. Read our Legacy Newsletter Edition: Fix God Classes by Using Data (30 Oct) to understand the specific problem we are solving and the solution approach. This recipe requires 5 steps. Step 2 arguably makes readability worse, so do step 1 incrementally and push each to main, then branch when you start step 2 and get at least a few private methods through step 4 as quickly as […]

Fast, Durable Cross-service Integration Tests

Isolating Dependencies with Ports and Adapters Problem and Solution Overview This recipe just states how to execute a solution. Read our Legacy Newsletter Edition: Testing Interactions with Third Party Services (31 August) to understand the specific problem we are solving and the solution approach. This recipe is one application of the habits taught in our Test Challenging Dependencies Change Series. This recipe helps you isolate and test a remote dependency. Each pass will isolate one interaction between your system and theirs. […]

Port Between Technologies

Creating and Shipping a Chimera Problem and Solution Overview This recipe just states how to execute a solution. Read our Legacy Newsletter Edition: Port Between Technologies (30 July) to understand the specific problem we are solving and the solution approach. We are going to set up a tame chimera system: something which is simultaneously both the old and the new, but in a way that won’t eat us. To accomplish that, we build the following: One strategic product choice: Phase […]

From Hard to Easy: Changing Database Schema

Fixing Databases with Lego Problem and Solution Overview This recipe just states how to execute a solution. Read our Legacy Newsletter Edition: Changing Database Schema (25 June) to understand the specific problem we are solving and the solution approach. This recipe helps you enable database refactoring for a project. You execute it once per project. You will need to set up 5 things: Get the Refactoring Databases book. Define the migration script structure. Create your tool to apply migrations. Add the […]

Start Fixing a God Class

Converting their pawns to make your army Problem and Solution Overview This recipe just states how to execute a solution. Read our Legacy Newsletter Edition: Start Fixing God Classes (28 May) to understand the specific problem we are solving and the solution approach. This recipe requires 9 steps. Future developers will unconsciously start helping you if you get through at least step 5. Pick a target procedure. Make data usage obvious. Create Data-Transfer Object. Convert Data-Transfer Object to Whole Value. […]

Make Tests Independent

Squeezing Juice out of Over-ripe Tests Problem and Solution Overview This recipe just states how to execute a solution. Read our Legacy Newsletter Edition: Make Tests Independent (30 April) to understand the specific problem we are solving and the solution approach. Preparation: Revert your change Put your change in another branch or a stash. You’re going to first improve the tests, then re-do the change. Part 1: Identify the common code Let’s call the tests that are failing together the […]

Legacy Code Cookbook

Make Tests IndependentRecipe: Squeezing Juice out of Over-ripe TestsWhile any bug or change would cause one test to fail, many changes cause unrelated tests to fail. This happens because each test is testing too much. Learn how to squeeze each test done so that it only has one reason to fail. Start Fixing a God ClassRecipe: Converting the God Classes’ Pawns to Work Against ItIt seems like fixing a God Class requires taking responsibilities off of it. Often that is […]