Earlier quoted context omitted.
> The tests are your spec. That's not quite right, but it's almost right. Tests are an * approximation* of your spec. Tests are a description, and like all descriptions are noisy. The thing is it is very very difficult to know if your tests have complete coverage. It's very hard to know if your description is correct. How often do you figure out something you didn't realize previously? How often do you not realize so…
> Tests are a description As is a spec. "Description" is literally found in the dictionary definition. Which stands to reason as tests are merely a way to write a spec. They are the same thing. > The thing is it is very very difficult to know if your tests have complete coverage. There is no way to avoid that, though. Like you point out, not even formal proofs, the closest speccing methodology we know of to try and a…
> that does not change that tests are the spec.
I disagree. It's, like you say, one description of your spec but that's not the spec. > not having a single source of truth
Well that's the thing, there is no single source of truth. A single source of truth is for religion, not code.The point of saying this is to ensure you don't fall prey to fooling yourself. You're the easiest person for you to fool, after all. You should always carry some doubt. Not so much it is debilitating, but enough to keep you from being too arrogant. You need to constantly check that your documentation is aligned to your specs and that your specs are aligned to your goals. If you cannot see how these are different things then it's impossible to check your alignment and you've fooled yourself.