AI-Driven Development Series

Welcome back.

Part 2

In Part 1,
we talked about WHY.

The business case
is never fire.

It's dinner.

Code is like salt.

Behavior is the product.

Now let's talk
about HOW.

How do you actually
DO this?

Let me set the scene.

There's a system
at your company.

Everyone knows it.

The one nobody
wants to touch.

The one that's been
running for years.

Built by people
who left long ago.

We've all
been there.

"Don't touch that file."

"That comment is a lie."

"Nobody knows
why that's there."

Code becomes
archaeology.

Decisions made
by ghosts.

So we patch.

We workaround.

We pray.

Patches on patches.

Tribal knowledge.

Dependencies
frozen in time.

Might break something.

Somewhere.

The cost of fear.

Things don't
get improved.

Features don't
get added.

Security vulnerabilities
linger.

The business
slows down.

Start fresh?

"We'd lose everything!"

Would we?

What do we keep?

Not the code.

The behavior.

The insight.

Your legacy system
IS an executable
specification.

The behavior is
already there.

Captured in the
running system.

Extract it.

Think about it
like cooking.

Recipe = remake.

Leftovers?

Stuck reheating.

Legacy systems
are leftovers.

Extract the recipe.

Tests aren't just
for testing.

They capture behavior.

They ARE
the recipe.

The method.

Six steps.

1

Capture behavior.

Record what
the system does.

Real requests.

Real responses.

These become
your fixtures.

Your golden datasets.

Include the edge cases.

The weird scenarios
from production.

The ones
nobody documented.

2

Lock contracts.

Schemas.

Error shapes.

Status codes.

If clients depend on it,
lock it down.

Separate interface
from implementation.

3

Build the harness.

A differential harness.

It replays
your fixtures.

Against both
old and new.

Diffs the outputs.

Tells you exactly
what differs.

Implement. Run. Fix. Repeat.

$ harness run --fixtures ./golden
Running 247 fixtures against legacy...
Running 247 fixtures against new...
Comparing outputs...
Results: 245 match, 2 differ
4

Implement route by route.

Start simple.

Pure reads first.

Then writes.

Then complex workflows.

Every route gets
green
before you move on.

5

Verify parity.

Run the full suite.

Same inputs.

Same outputs.

diff = 0

Or within
tolerated bounds.

6

Release with guardrails.

Canary deployment.

Shadow traffic.

Automated rollback.

Don't flip a switch
and hope.

Prove it works first.

In practice.

Scenario one.

Library upgrade.

Weeks of debugging.

Regenerate.

The tests
don't change.

Testing behavior,
not implementation.

Scenario two.

Language change.

TypeScript to Go.

Three days.

The tests
didn't change.

The tests were
the recipe.

Scenario three.

Bug workflow.

Every bug you find...

Becomes a new test.

Every test =
safer rebuild.

More specified
over time.

Not more complex.

More defined.

Remember this.

Behavior is
the asset.

Code is
disposable.

Stop reheating
leftovers.

Extract the recipe.

Make fresh.

In Part 3...

The thinking.

How to design
with AI.

How to build a
thinking factory.

See you there.

Thank you.

Rebuild, Don't Patch

1 / 131