Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 590325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:31:00+00:00 2026-05-13T15:31:00+00:00

I would like to know from those who document unit tests how they are

  • 0

I would like to know from those who document unit tests how they are documenting it. I understand that most TDD followers claim “the code speaks” and thus test documentation is not very important because code should be self-descriptive. Fair enough, but I would like to know how to document unit tests, not whether to document them at all.

My experience as a developer tells me that understanding old code (this includes unit tests) is difficult.

So what is important in a test documentation? When is the test method name not descriptive enough so that documentation is justified?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:31:01+00:00Added an answer on May 13, 2026 at 3:31 pm

    As requested by Thorsten79, I’ll elaborate on my comments as an answer. My original comment was:

    “The code speaks” is unfortunately
    completely wrong, because a
    non-developer cannot read the code,
    while he can at least partially read
    and understand generated
    documentation, and this way he can
    know what the tests test. This is
    especially important in cases where
    the customer fully understands the
    domain and just can’t read code, and
    gets even more important when the unit
    tests also test hardware, like in the
    embedded world, because then you test
    things that can be seen.

    When you’re doing unit tests, you have to know whether you’re writing them just for you (or for your co-workers), or if you’re also writing them for other people. Many times, you should be writing code for your readers, rather than for your convenience.

    In mixed hardware/software development like in my company, the customers know what they want. If their field device has to do a reset when receiving a certain bus command, there must be a unit test that sends that command and checks whether the device was reset. We’re doing this here right now with NUnit as the unit test framework, and some custom software and hardware that makes sending and receiving commands (and even pressing buttons) possible. It’s great, because the only alternative would be to do all that manually.

    The customer absolutely wants to know which tests are there, and he even wants to run the tests himself. If the tests are not properly documented, he doesn’t know what the test does and can’t check if all tests he think he’ll need are there, and when running the test, he doesn’t know what it will do. Because he can’t read the code. He knows the used bus system better than our developers, but they just can’t read the code. If a test fails, he does not know why and cannot even say what he thinks the test should do. That’s not a good thing.

    Having documented the unit tests properly, we have

    • code documentation for the developers
    • test documentation for the customer, which can be used to prove that the device does what it should do, i.e. what the customer ordered
    • the ability to generate the documentation in any format, which can even be passed to other involved parties, like the manufacturer

    Properly in this context means: Write clear language that can be understood by non-developers. You can stay technical, but don’t write things only you can understand. The latter is of course also important for any other comments and any code.

    Independent of our exact situation, I think that’s what I would want in unit tests all the time, even if they’re pure software. A customer can ignore a unit test he doesn’t care about, like basic function tests. But just having the docs there does never hurt.

    As I’ve written in a comment to another answer: In addition, the generated documentation is also a good starting point if you (or your boss, or co-worker, or the testing department) wants to examine which tests are there and what they do, because you can browse it without digging through the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if I migrate from Windows Server 2003 to Windows
I would like to know the current idle time from user input on a
I would like to know how to read elements from a const boost::multi_array object.
I would like to know how to get data from preference activity when my
I would like to know how this homepage from Google Docs app is build
I would like to know how I can show the output from this piece
I would like to know if it's possible to download a file from a
I would like to know how could I use JSON for passing data from
I would like to know how you would run a stored procedure from a
I would like to know the regex for splitting up the decimal number from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.