Daily Shaarli

All links of one day in a single page.

June 17, 2023

Ted M. Young: "I stopped trying to define Uni…" - SFBA.social

I stopped trying to define Unit Tests (I would define it as Feathers defined it) and now exclusively use the terms:

I/O-Based tests: has I/O in the test (accesses clock, database, etc.)

I/O-Free tests: no I/O access in the test (no current date/time, no random numbers, no file access, no network access, etc.)

I'll slip up and use "Unit" when I really mean I/O-Free (and "Integration" when I mean "I/O-Based"), but for the most part I've switched.

There's so much baggage and debate around "what's a unit?", when that isn't always the most important question. I've found it much easier to explain that when doing #TDD, we want to use I/O-Free tests as they'll be sufficiently fast to get feedback in less than a couple of seconds.