← Graph

An Introduction to Test Bench

talk 15 connections

Nathan Ladd's wroclove.rb 2023 talk (March 31, 2023), interleaving the history of Test Bench with his personal history of learning TDD. Ladd recalls being a self-taught 90s kid who rushed everything (school, guitar, code), found early career success writing Linux device drivers in C, and thought he understood TDD until he started working with Scott Bellware in 2015. Walks through the origin of Test Bench: dissatisfaction with minitest's `must_equal`/`should_equal` ambiguity, lack of `refute_raises`, random ordering requiring the `i_suck_and_my_tests_are_order_dependent!` method, and the realization that tests are just procedures — so test files should be plain Ruby scripts. The initial DSL (assert, refute, context, test, plus later assert_raises/refute_raises) shipped on RubyGems on March 31, 2016. Describes a Herculean late-2018-through-2020 rewrite using strict TDD, Useful Objects, zero-compromise design principles, immediate correction of every mistake and all its downstream fallout, and git checkpoints via interactive rebasing — 'a little like lead climbing'. Work was derailed by substance abuse and a four-story balcony fall at the time of wroclove.rb 2019 that broke seven ribs, sternum, clavicle, femur, face/nose/skull (a Le Fort III fracture); Scott Bellware and Ethan Garofolo organized a morale video. Returning post-recovery, Ladd discovered that because Test Bench's DSL had to operate in isolation to test itself, the DSL could be included in any class — producing fixtures: self-testable test objects that compose like production code (e.g. a schema-equality fixture used inside a message-handler fixture in Eventide). Demonstrates a data-structure comparison fixture printing full context/attribute detail on both pass and fail. Argues TDD is about eliminating obstructions to understanding, that static types can't compose on top of themselves the way test objects can, and that 'practice doesn't make perfect — practice makes permanent'. Q&A: (1) clarifies 'fixture' vs Rails fixtures — traces the term to Kent Beck's 1989 Smalltalk xUnit writeup where a fixture was a behavioral testing device, regrets the ambiguity with Active Record YAML fixtures, uses the light-fixture metaphor; (2) on asserting collection properties, notes RSpec composable matchers are the common solution but recommends specialized fixtures (e.g. nokogiri+CSS-selector fixtures for XML), emphasizing Tell-Don't-Ask and building exactly the verification you need; (3) Scott Bellware elaborates that fixtures in Test Bench are just plain classes that include `TestBench::Fixture`, use the Introduce Explaining Variable refactoring to reduce everything to assert/refute on booleans, and avoid RSpec's elaborate matcher API.

date
2023-03-31
type
talk
talk An Introduction to Test Bench
about
TestBench tool
Primary subject: the history, design, and capabilities of the Test Bench framework.
talk An Introduction to Test Bench
about
Major thread of the talk: TDD as process/philosophy, the V1 rewrite done under strict TDD.
talk An Introduction to Test Bench
about
Introduces fixtures as Test Bench's novel composable test-object abstraction.
talk An Introduction to Test Bench
about
Useful Objects concept
Explains how the V1 rewrite made Useful Objects 'click' for Ladd.
talk An Introduction to Test Bench
about
Discusses BDD/context specification's value and how green-dot output eroded it.
asked_at
An Introduction to Test Bench talk
Audience Q&A clarifying the word 'fixture' vs Rails fixtures.
asked_at
An Introduction to Test Bench talk
Audience Q&A on replacing RSpec composable matchers for collection properties.
person Nathan Ladd
authored
An Introduction to Test Bench talk
Delivered the talk at wroclove.rb 2023.
from_talk
An Introduction to Test Bench talk
Central lesson of the talk.
from_talk
An Introduction to Test Bench talk
One of three main takeaways Ladd highlights.
from_talk
An Introduction to Test Bench talk
Closing adage Ladd credits to his soccer coach and Scott Bellware.
from_talk
An Introduction to Test Bench talk
Closing takeaway reframing 'software is never done'.
from_talk
An Introduction to Test Bench talk
Ladd's autobiographical lesson motivating the V1 rewrite's strict rules.
from_talk
An Introduction to Test Bench talk
Definition Ladd credits to ongoing discussions with Bellware and uses to motivate the rewrite.
talk An Introduction to Test Bench
presented_at
Talk given on 2023-03-31 at wroclove.rb in Wrocław.

Provenance

Created
2026-04-17 16:17 seed
Read by
22 extractions