Is summary necessary in unit test method

后端 未结 8 875
忘掉有多难
忘掉有多难 2021-02-07 07:01

Since the naming of a unit test method makes its purpose more meaningful, is it necessary to add a summary to a unit test method?

Example:

/// 

        
相关标签:
8条回答
  • 2021-02-07 08:03

    For the example above, I would say that it's not necessary, unless you use a tool that extracts documentation from source (like javadoc or something).

    A common rule of thumb is that the code says what you're doing and the comment says why, but since the name is so very verbose (which I think is ok, since no one ever has to type it) I don't think that the comment contributes anything.

    0 讨论(0)
  • 2021-02-07 08:03

    If you think that it's the best use of your time, do it, otherwise don't. I wouldnt.

    0 讨论(0)
提交回复
热议问题