Re:Why Most Unit Testing is Waste (2014) [pdf]
by wallacoloo on Monday May 30, 2016 @02:04AM
(#11799826)
Sorry if this is what you were specifying when saying "executable documentation", but have you seen the way Rust handles documentation tests [1]? The idea is to provide documentation via comments before a function definition, and inside this documentation you can provide example uses. The test-runner automatically extracts these examples and verifies them. In this way, your documentation and tests are always in agreement with each other, and a developer can be aware of expected behavior by reading either the code comments or the auto-generated html docs.
I'm rather fond of this system, personally.
1: https://doc.rust-lang.org/book/testing.html#documentation-te...