The dry principle states:
"Every piece of knowledge must have a single, unambiguous, authoritative representation within a system."
However when writing tests for code you are describing the expected behavior for the system twice (once in the code and once in the test). I know both descriptions are from a different perspective but share a great deal of the underlying idea.
Any thoughts on this?
In general I think both unit tests and the DRY principle are good ideas and I try to apply them as much a possible. This question is more on a philosophical level, but I wondered if anyone had also thought of this.