yangyichao-mango commented on a change in pull request #165:
URL: 
https://github.com/apache/incubator-dolphinscheduler-website/pull/165#discussion_r467357596



##########
File path: docs/zh-cn/development/unit-test.md
##########
@@ -15,3 +15,94 @@ Unit 
Test编写参考[链接](https://github.com/apache/incubator-dolphinschedul
   * 在现阶段,Delta更改代码的测试覆盖设定值为:>=60%,越高越好。
   * 我们可以在这个页面中看到测试报告: https://codecov.io/gh/apache/dolphinscheduler
 
+## 单元测试基本准则
+### 1: 隔离性与单一性
+
+一个测试用例应该精确到方法级别,并应该能够单独执行该测试用例。同时关注点也始终在该方法上(只测试该方法)。
+
+如果方法过于复杂,开发阶段就应该将其再次进行拆分,对于测试用例来讲,最佳做法是一个用例只关注一个分支(判断)。当对其进行修改后,也仅仅影响一个测试用例的成功与否。这会极大方便我们在开发阶段验证问题和解决问题,但与此同时,也对我们覆盖率提出了极大的挑战。
+
+### 2:自动性
+
+单元测试能够自动化进行。强制要求:所有的单元测试必须写在src/test下,同时方法命名应该符合规范。基准测试除外。
+
+### 3:可重复性
+
+多次执行(任何环境任何时间)结果唯一,且可以重复执行。
+
+

Review comment:
       ```suggestion
   
   ```




----------------------------------------------------------------
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