Java Legacy Code Testing

Getting Java code under test before you change it, when you cannot construct the class or reach the method at all: seams and their enabling points, the dependency-breaking catalogue (Parameterize Constructor, Extract Interface, Extract and Override, Introduce Instance Delegator, Break Out Method Object, Expose Static Method), Sprout and Wrap when there is no time, approval testing when the output to pin is too large to assert on, and the disciplines that make a change safe while no test exists. Use when a constructor opens a connection, when a method reads a static singleton, when a test would need the real database, when mockStatic is proposed, when a setXxxForTest is being added, or when 2004-era advice (PowerMock, mockito-inline) is followed. Does not cover characterisation-test mechanics (java-refactoring), strangler work (legacy-enterprise-modernization), doubles (java-test-doubles), test level (java-testing-strategy), the red-green-refactor loop (tdd), or how a test is written (java-test-design).

robsonkades 58f0851 8 files · 58.6 KB Updated

File contents

robsonkades/agent-skills/tree/main/skills/java-legacy-code-testing commit 58f0851eb9

Frequently asked questions

npx skillmds@latest add robsonkades/java-legacy-code-testing