← Graph

Introduce Explaining Variable

concept 2 connections

Classic refactoring from Fowler's 'Refactoring': declare a variable, assign it a value, and give it a name that makes the intent self-evident. In Bellware's framing during the Test Bench Q&A, this refactoring is why Test Bench needs only `assert` and `refute` on booleans instead of an `assert_equal`/`assert_in_epsilon`/`assert_json` zoo: every test ultimately reduces to 'is something true or false', and a well-named explaining variable makes specialized assertion methods unnecessary.

category
pattern
concept Introduce Explaining Variable
related_to
Canonical refactoring cataloged in Fowler's book.
concept Introduce Explaining Variable
related_to
TestBench tool
Bellware cites this refactoring as the rationale for Test Bench having only assert/refute on booleans instead of specialized assertion methods.

Provenance

Read by
3 extractions