SunJiFengPlus opened a new issue #3700:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3700


   **Describe the question**
   1. Put multi unit test cases in one method
   2. Only verify whether the result is successful or fail, not verify the data 
after successful
   
   **What are the current deficiencies and the benefits of improvement**
   1. Put one unit test case in one method, take unit test case as the minimum 
test unit. Otherwise, the assertion failure of the previous unit test case will 
cause the subsequent unit test case to not be executed. If you just want to 
classify unit test cases, you can use the internal classes of junit5 and 
@DisplayName.
   2. Focus on verifying data. Focus on verifying data. If you just verify the 
success or failure, it will be meaningless. It looks like blindly increasing 
coverage. Such unit testing will tolerate errors.
   
   ---
   
   **Describe the question**
   1. 将多单元测试用例放在一种方法中
   2. 只验证结果成功还是失败, 不验证成功后的数据
   
   **What are the current deficiencies and the benefits of improvement**
   1. 将一个单元测试用例放在一个方法中, 以单元测试用例为最小单元. 否则前一个单元测试用例的断言失败会导致后面的单元测试用例不会被执行. 
如果只是想对单元测试用例分类, 可以使用junit5 的内部类和@DisplayName.
   2. 侧重验证数据. 如果只是验证成功与否, 这样毫无意义. 看起来像是盲目提高覆盖率. 这样的单元测试用会容忍错误.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to