执行maven目标分析代码可测性
D:\project\morgan\trunk\member.service.china> mvn clean install
D:\project\morgan\trunk\member.service.china>mvn com.google.testability-explorer:maven-testability-plugin:1.3.4-SNAPSHOT:testability
或者看: http://code.google.com/p/testability-explorer/wiki/HowToMakeARelease
在顶级工程上执行上述命令也可,但是site目录会仅生成在各个子工程目录下。
结果如下:
Issues that cause the most untestable classes Cost: 6,376 Classcom.alibaba.china.biz.dal.EncryptPtpis hard to test because: It is expensive to construct an instance of the class, and every test will need to call a constructor. These static initializers will need to be run once, when the class is loaded.Why is it bad? On line 30, Instead of initializing this state statically, try initializing a fresh copy in each instance. Creating new objects in Java is cheap, and this static state can't be cleaned up between tests. Cost: 6,254 Classcom.alibaba.china.biz.common.security.BlowfishEncrypteris hard to test because: It is expensive to construct an instance of the class, and every test will need to call a constructor. These static initializers will need to be run once, when the class is loaded.Why is it bad? On line 29, Instead of initializing this state statically, try initializing a fresh copy in each instance. Creating new objects in Java is cheap, and this static state can't be cleaned up between tests. Cost: 4,982 Classcom.alibaba.china.member.internal.security.Authenticationis hard to test because: It is expensive to construct an instance of the class, and every test will need to call a constructor |
(以上言论仅代表作者的个人观点,不代表51Testing观点)
版权声明:本文出自liangjz的51Testing软件测试博客:http://www.51testing.com/?13997
原创作品,转载时请务必以超链接形式标明本文原始出处、作者信息和本声明,否则将追究法律责任。