Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am sure some else has experienced the problem of documentation regarding unit tests. I was wondering if anyone has used javadocs with their unit testing to generate their own internal javadoc files to keep track and document their unit tests? If so, did you find it successful? Or you think this a bad way to document unit tests, please let me know. If you have any suggestion for a better way for unit test documentation, it would be greatly appreciated.

share|improve this question

migrated from Nov 11 '11 at 9:45

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

I find it's best to write self-documenting unit-tests. The BDD approach works really well for that. I've been using RSpec in Ruby world (there certainly are some equivalent tools for Java). But even with standard JUnit simply having well-named test cases is a good substitute for explicitly documenting the tests. Often when tests need documentation they are too complex and should be simplified.

share|improve this answer
Thanks for your advice. – grebwerd Jul 25 '11 at 3:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.