首页> 外国专利> RESILIENT MOCK OBJECT CREATION FOR UNIT TESTING

RESILIENT MOCK OBJECT CREATION FOR UNIT TESTING

机译:用于单元测试的弹性Mocks对象创建

摘要

Embodiments of the invention provide a method, system and computer program product for fault alerting in mock object supported unit testing. In an embodiment of the invention, a method for fault alerting in mock object supported unit testing is provided. The method includes creating in memory of a computing system an instance a mock object proxying for an object under test by test code and proxying by method name an invocation of a method in the object under test to the mock object. The method also includes determining whether or not a method exists in memory for the mock object corresponding to the method name. Finally, the method includes invoking an exception handler for the mock object outputting error text indicating a non-presence of a method associated with the method name responsive to a method by the method name not existing in the memory for the mock object, but otherwise invoking a method that exists in the memory of the mock object corresponding to the method name.
机译:本发明的实施例提供了一种用于在模拟对象支持的单元测试中进行故障警报的方法,系统和计算机程序产品。在本发明的实施例中,提供了一种用于在模拟对象支持的单元测试中的故障警报的方法。该方法包括在计算系统的存储器中创建实例模拟对象,该模拟对象通过测试代码代理被测试对象,并且通过方法名称代理被测试对象中的方法对模拟对象的调用。该方法还包括确定存储器中是否存在与该方法名称相对应的模拟对象的方法。最终,该方法包括为模拟对象调用异常处理程序,以输出错误文本,该错误文本指示与方法名称相关联的方法的不存在,该方法通过方法名称不存在于模拟对象的内存中来响应该方法,而在其他情况下调用在模拟对象的内存中存在的与方法名称相对应的方法。

著录项

  • 公开/公告号US2015339219A1

    专利类型

  • 公开/公告日2015-11-26

    原文格式PDF

  • 申请/专利权人 INTERNATIONAL BUSINESS MACHINES CORPORATION;

    申请/专利号US201514816867

  • 发明设计人 TIMOTHY J. BALDWIN;

    申请日2015-08-03

  • 分类号G06F11/36;

  • 国家 US

  • 入库时间 2022-08-21 14:35:16

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号