Documentation? You mean tests?
"I hate writing documentation!"
Tests are documentation
I'm not talking about TDD, but I am talking about testing. I have yet to effectively use TDD. It feels like predicting the future. I don't know what I'll need to write before I write it, so I write it, then test it. But I do test it. I write End to End Tests, Unit Tests, and Acceptance Tests. And, I demand nearly 100% code coverage. I don't test generated code, but all of my code is tested, and well tested at that, I'm talking about testing by passing null parameters, and even with junk data. I judge the quality of a Solution based on the size of the testing Project. Why? Because if I ever don't know how something works, I can just run the tests for it and know everything about it. (In fact, I'd love to see VS add to the context menu "Run Tests that Include this Method")
Tests are better than other technical documentation forms
While automated testing is useless at making end user documentation, this form of documentation is more detailed than standard technical docs, and on top of that it changes as the code changes, so it's always up to date. More than that, it also gets checked into source control, so you can see the historical documentation side-by-side with the historical code. This form of documentation grows with your code, it is "living" documentaiton. More than anything else, it's ACCURATE. There's not a 10 year old piece of paper suggesting that Server XYZ currently hosts the database for this project. It's all there and you can see proof that this is how things work. It's beyond documentation. It's amazing when done properly.
Comments
Post a Comment