small-spring icon indicating copy to clipboard operation
small-spring copied to clipboard

test种的命名不规范.没有使用驼峰命名,这边的codereview软件也会报错

Open CandyKIng1991 opened this issue 3 years ago • 2 comments

public void test_BeanFactory() {)

本地改为 public void testBeanFactory(){}

好的规范,才能让项目走的更远

CandyKIng1991 avatar Aug 20 '21 15:08 CandyKIng1991

这个我解释下;

  1. 单元测试方法不是对外的方法
  2. 单元测试的方法对于要测试的类或者接口,最好是能一眼可见以及可复制,那么下划线可以隔离复制误操作
  3. 不能完全依赖代码检查,这个东西是人定的,那么不同公司也会有相应标准的不同,所以要区别下,好能更好的服务于代码开发

👍不过很感谢你的意见,互相交流不同想法,共同进步

fuzhengwei avatar Aug 21 '21 08:08 fuzhengwei

就是觉得代码写的这么好,如果有个更好的规范,那么才能更长时间的获得关注和分享

CandyKIng1991 avatar Aug 24 '21 06:08 CandyKIng1991