巢湖学院学报
巢湖學院學報
소호학원학보
CHAOHU TEACHERS COLLEGE JOURNAL
2014年
6期
34-38
,共5页
陈丽萍%张勇%丁智敏
陳麗萍%張勇%丁智敏
진려평%장용%정지민
EasyMock框架%测试驱动开发%JUnit框架%单元测试%PowerMock框架
EasyMock框架%測試驅動開髮%JUnit框架%單元測試%PowerMock框架
EasyMock광가%측시구동개발%JUnit광가%단원측시%PowerMock광가
EasyMock framework%test-driven development%JUnit framework%unit test%PowerMock framework
EasyMock是一个可以和JUnit很好的集成在一起的Mock框架,它通过构建Mock对象可以减少开发代码与测试代码的耦合,快速有效的完成单元测试、分布式系统测试。在介绍EasyMock特点、测试框架及其应用的基础上,分析了该框架的优缺点,并针对其缺点提出了相应的解决方案。测试结果表明,注入解决方案后的EasyMock框架可以降低Mock对象的限制,应用范围更广。
EasyMock是一箇可以和JUnit很好的集成在一起的Mock框架,它通過構建Mock對象可以減少開髮代碼與測試代碼的耦閤,快速有效的完成單元測試、分佈式繫統測試。在介紹EasyMock特點、測試框架及其應用的基礎上,分析瞭該框架的優缺點,併針對其缺點提齣瞭相應的解決方案。測試結果錶明,註入解決方案後的EasyMock框架可以降低Mock對象的限製,應用範圍更廣。
EasyMock시일개가이화JUnit흔호적집성재일기적Mock광가,타통과구건Mock대상가이감소개발대마여측시대마적우합,쾌속유효적완성단원측시、분포식계통측시。재개소EasyMock특점、측시광가급기응용적기출상,분석료해광가적우결점,병침대기결점제출료상응적해결방안。측시결과표명,주입해결방안후적EasyMock광가가이강저Mock대상적한제,응용범위경엄。
EasyMock is the Mock framework that can integrate with Junit very well. It can reduce the coupling of developing codes and testing codes by constructing the mock object and complete the unit test and the distributed system test rapidly and efficiently. On the basis of introducing the characteristics, the testing framework and the application of EasyMock, the paper makes analysis of its advantages and disadvantages and suggests some corresponding solutionsd. The testing results indicate the framework with the solutions can reduce the constraints of the mock object and can be applied more widely.