You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

code_review_checklist_mechanism.md 6.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # 代码检视Checklist运作机制(试运行)
  2. ## 目标
  3. 代码检视 Checklist 诣在辅助 Committer 进行高质量代码检视,同时为开发者提供代码自检的参考指南。
  4. ## Checklist 说明
  5. 代码检视 Checklist 分为 **必选** 与 **可选** 两节,其中:
  6. ### 必检项:
  7. 必选检查项位于**Code review checklist**下,为 Committer 代码Review的常规检查项,Committer 确认无问题后请在 CheckBox 勾选以表明完成对应检查(若当前 Pull request
  8. 不涉及某项,无须勾选);若当前 Pull request 涉及 **【性能分析】**中某子项、**【是否涉及模块/特性间交互】**,请开发者概述设计思想或实现方案。
  9. - **Typical problems of security
  10. coding [[historical security coding cases reference]](https://gitee.com/mindspore/community/blob/master/security/security_coding_violation_cases.md)**
  11. - [ ] whether to verify the pointer is null/nullptr
  12. - [ ] whether to verify the function's return value
  13. - [ ] whether new/malloc memory is released correctly
  14. - **Performance analysis (if a sub-item is involved, please outline the implementation idea or modification content)**
  15. - [ ] whether to modify hotspot ***function / algorithm / operation***
  16. - [ ] whether to consider concurrent scenarios
  17. - [ ] whether to consider communication scenario
  18. - - [ ] **Whether to comply with coding
  19. specifications [[coding specification reference]](https://gitee.com/mindspore/community/blob/master/security/coding_guild_cpp_zh_cn.md)**
  20. - - [ ] **Whether to comply with ***SOLID principle / Demeter's law*****
  21. - - [ ] **Whether the ***interaction between modules / features*** is involved (if yes, please outline the
  22. implementation ideas)**
  23. - - [ ] **Whether there is UT test case && the test case is a valid (if there is no test case, please explain the
  24. reason)**
  25. - - [ ] **whether the secret key is loaded/released correctly**
  26. - **Error handling and recording**
  27. - [ ] whether the interface exception scenarios are fully considered
  28. - [ ] whether the error is recorded appropriately
  29. ### 可选检查项:
  30. 若当前Pull request涉及 **【是否导致无法前向兼容】**、**【是否为对外接口变更】**、**【是否涉及依赖的三方库变更】**
  31. 中某项,请将对应可选项的注释去掉,并增加对应的评审结论,如:”已于YYYY/MM/dd在SEG通过评审“;若涉及对外文档变更,请将**【是否涉及文档(安装、教程、设计、参考、API、迁移指南、FAQ等)修改】**
  32. 的注释打开,并附上文档变更的Pull request。
  33. - [ ] **Whether document (installation, tutorial, design, reference, API, migration guide, FAQ, etc.) modification
  34. is involved**
  35. - - [ ] **Whether it causes forward compatibility failure**
  36. - - [ ] **Whether the API change is involved**
  37. - - [ ] **Whether the dependent third-party library change is involved**
  38. ## 代码检视 Checklist 中英文参照表
  39. | 检视项 | checklist |
  40. | ---------------------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------------|
  41. | 是否进行空指针校验 | whether to verify the pointer is null/nullptr |
  42. | 是否进行返回值校验 | whether to verify the function's return value |
  43. | 是否正确释放new/malloc内存 | whether new/malloc memory is released correctly |
  44. | 是否修改热点函数/算法/算子 | whether to modify hotspot function / algorithm / operation |
  45. | 是否考虑并发场景 | whether to consider concurrent scenarios |
  46. | 是否考虑通信场景 | whether to consider communication scenario |
  47. | 是否符合编码规范 【编码规范】 | whether to comply with coding specifications [coding specification reference] |
  48. | 是否遵守SOLID原则/迪米特法则 | whether to comply with SOLID principle / Demeter's law |
  49. | 是否涉及模块/特性间交互【若涉及请概述实现思路】 | whether the interaction between modules / features is involved (if yes, please outline the implementation ideas) |
  50. | 是否具备UT测试用例看护 && 测试用例为有效用例【若无测试用例请说明原因】 | whether there is UT test case && the test case is a valid (if there is no test case, please explain the reason) |
  51. | 秘钥是否被正确加载、释放 | whether the secret key is loaded/released correctly |
  52. | 是否充分考虑接口的异常场景 | whether the interface exception scenarios are fully considered |
  53. | 是否正确记录错误信息 | whether the error is recorded appropriately |
  54. | 是否涉及文档(安装、教程、设计、参考、API、迁移指南、FAQ等)修改 | whether document (installation, tutorial, design, reference, API, migration guide, FAQ, etc.) modification is involved |
  55. | 是否导致无法前向兼容 | whether it causes forward compatibility failure |
  56. | 是否为对外接口变更 | whether the API change is involved |
  57. | 是否涉及依赖的三方库变更 | whether the dependent third-party library change is involved |