Properties as a Compass: Precise Programming
Fog thickens over the line "def max(a: Int, b: Int): Int". What does it do? It returns the larger of two numbers, but how can you verify that? You could write a dozen tests with specific pairs: max(2,3)=3, max(5,5)=5, max(-1,0)=0. Still, a nagging doubt remains: what if it breaks for, say, a million and minus a million?
