Development by Specification
This is, as far as I'm aware, not a common development practice currently. But as a natural progression from Test-Driven Development, I think it deserves a mention and consideration.
Unit tests, even when used as part of TDD, are employed in a craft way – as a bespoke specification for our one-of-a-kind classes. We could benefit from more use of these tests, substituting the static, error-prone type tests used in many APIs for dynamic specification tests.
A table view, for example, does not need something that merely responds to the data source selectors; it needs something that behaves like a data source. So, let's create some tests that any data source should satisfy, and bundle them up as a specification that can be tested at runtime. Notice that these aren't quite unit tests, in that we're not testing our data source – we're testing any data source.
A table view needs to know how many rows there are, and the content of...