mailwal

(Quick Tips 2) How can you check your test infrastructure?

Jon Reid
Check Your Infrastructure using Test Zero

Whenever I create a new test suite, I start with a special test I call Test Zero. It looks like this:

func test_zero throws {
XCTFail("Tests not yet implemented")
}

Test Zero helps separate our problems so we can tackle them one at a time. When we create a new test suite, we’re usually thinking about that first test. But before we get lost writing that test, let’s make sure the suite runs. Otherwise, basic infrastructure problems will interrupt our thinking flow.

This is an example of a larger principle: take a small step, get feedback.

…Excerpt from chapter 2 of my book, iOS Unit Testing by Example: XCTest Tips and Techniques with Swift. In Quick Tip 3, I’ll share a tip about removing test cruft.

Have a question or comment about this Quick Tip? Feel free to reply directly to this email.

(If you don't want any more Quick Tips but still want my newsletter, click “Update preferences” below.)

Cheers,
Jon Reid, Technical Agile Coach
Quality Coding

6334 Sponson Ct.
San Jose, CA 95123 USA

You received this email because you signed up on https://qualitycoding.org.