Skip to content

Instantly share code, notes, and snippets.

Claude Opus 4.7 TDAB Migration

Context

The outer and inner loops

There has always been more to Red-Green-Refactor than the inner loop alone. TDD has an outer loop too — one that many practitioners missed in the original literature and had to rediscover the hard way. The outer loop defines new behaviour as an executable scenario; the inner loop refines the implementation until that scenario passes. Together they produce a growing suite of living specifications that catch regressions whenever something changes.

Inner and outer feedback loops in TDD

@antonymarcano
antonymarcano / remove_dir.py
Last active April 26, 2026 15:42
Illustration of an rm gateway (would be called via a console script entry point)
from pathlib import Path
import subprocess
import sys
GIT_TRACKED = 0
GIT_UNTRACKED = 1
# Better to load from a config file
_deny = frozenset({Path("/"), Path("/home"), Path("/usr")})
@antonymarcano
antonymarcano / PostCode.java
Created August 24, 2012 06:42
PostCode exercise (unfinished) in Java
package com.riverglide.addressservice;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class PostCode {
private static final String VALID_OUTCODE = "\\d[A-Z][A-Z]";
private static final int OUTCODE_LENGTH = 3;
private String inCode;
@antonymarcano
antonymarcano / restricted_content.feature
Created March 17, 2012 11:33
The Cucumber Book – Imperative vs. Declarative
Feature: Cucumber Book v1 Imperative Steps P91
These are the scenarios from the Cucumber Book showing Imperative vs. Declarative style
I think the ideas in the book are great but I think that the examples can go further.
# Imperative example from the book
Scenario: Redirect user to originally requested page after logging in
Given a User "dave" exists with password "secret"
And I am not logged in
When I navigate to the home page
Then I am redirected to the login form
$:.unshift(File.dirname(__FILE__), ".")
require 'rubygems'
require 'rspec'
module Butler
def put_fork_on_the_left_of place
place.unshift "fork"
place
end
$:.unshift(File.dirname(__FILE__), ".")
require 'rubygems'
require 'rspec'
module Butler
def self.extended base
base.get_ready
end