Is summary necessary in unit test method

后端 未结 8 1008
忘掉有多难
忘掉有多难 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.

提交回复
热议问题