Testing strategy
Build a practical understanding of testing strategy from the underlying principles.
QUALITY · 18 ARTICLES
Reliable code is code you can change with confidence. Connect testing strategy, test doubles, code smells, and legacy improvement to everyday development.
Topic map
Build a practical understanding of testing strategy from the underlying principles.
Build a practical understanding of tdd and test doubles from the underlying principles.
Build a practical understanding of code smells from the underlying principles.
Build a practical understanding of refactoring from the underlying principles.
Start here
A guided path from fundamentals to the next step.
In iOS development, you may keep putting off writing test code. Once you open XCTest, it can be hard to know where to start.
Read article"Write tests first? There isn't even any code yet—what would I test?"
Read articleSpaghetti code refers not to length or messiness, but to control flow. This article traces why spaghetti remained after Dijkstra’s 1968 letter against goto, and how to measure it with cyclomatic complexity.
Read articleAll articles
Shotgun Surgery is a smell where one change is scattered across multiple files, while Divergent Change is its mirror image: one file changes for multiple reasons. This article explains how to measure and distinguish these opposite smells using commit history.
Read articleA God Object is a class that keeps absorbing surrounding responsibilities and data as it grows, becoming the file that changes and conflicts most often on a team. This guide covers the signals of growth, the extraction order, and two ways splitting it can fail.
Read articleEvery function is five lines long and has one responsibility, yet nobody can explain what happens when a button is pressed. This article covers why decomposition goes too far, the cost revealed by jump counts, and how to recover the flow.
Read articleLasagna code is code where adding one field requires changing seven files despite neatly separated layers. This article summarizes why layers multiply, where they cost you, and when to keep or remove them.
Read articleTest Plans manage the tests to run and their execution conditions in .xctestplan files. This guide covers why schemes alone are insufficient, test selection, configurations, coverage, execution order, repetition, and xcodebuild integration.
Read article100% code coverage does not mean bug-free code. This article summarizes the practical 70–80% guideline and how to identify untested branches that matter more than the number.
Read articleFor legacy code, characterization tests that lock in current behavior come before refactoring. This guide lays out the practical sequence for using seams to isolate code that cannot be tested because of dependencies.
Read articleIn Swift 5.5 and later, declare test functions as async, await the result, and then verify it. This guide also covers error validation, testing legacy callback APIs, and when expectations are still needed.
Read articleWhen writing test code for iOS development, XCTest can start to feel restrictive.
Read articleHave you ever written tons of test code, only to miss the actual bugs—and watch tests break everywhere whenever you fix a feature?
Read articleThere’s a wall every developer eventually runs into.
Read articleThere’s a wall every developer eventually hits when writing test code.
Read article