> code isn't a specification.
Code in the form of a test is.
It shows how you can interact with the system/component/unit under test.
Code in the form of a test is.
It shows how you can interact with the system/component/unit under test.
A specification should specify behavior, edge cases, time complexity, possible pitfalls, etc.
Basically anything that is guaranteed (by the specification). A test may test a quirk of the implementation.