【24h】

Mock object creation for test factoring

机译:模拟对象创建测试分解

获取原文

摘要

Test factoring creates fast, focused unit tests from slow system-wide tests; each new unit test exercises only a subset of the functionality exercised by the system tests. Augmenting a test suite with factored unit tests, and prioritizing the tests, should catch errors earlier in a test run.One way to factor a test is to introduce mock objects. If a test exercises a component A, which is designed to issue queries against or mutate another component B, the implementation of B can be replaced by a mock. The mock has two purposes: it checks that A's calls to B are as expected, and it simulates B's behavior in response. Given a system test for A and B, and a record of A's and B's behavior when the system test is run, we would like to automatically generate unit tests for A in which B is mocked. The factored tests can isolate bugs in A from bugs in B and, if B is slow or expensive, improve test performance or cost.This paper motivates test factoring with an illustrative example, proposes a simple procedure for automatically generating mock objects for factored tests, and gives examples of how the procedure can be extended to produce more robust factored tests.
机译:测试分解从慢速系统的测试中创建快速,聚焦的单元测试;每个新单元测试仅练习系统测试锻炼的功能的子集。使用代表性单元测试增强测试套件并优先考虑测试,应在测试运行中提前捕获错误。考虑测试的方法是引入模拟对象。如果测试练习一个组件A,则旨在旨在向违反或突变另一个组件B发出查询,则B的实现可以由模拟替换。模拟有两个目的:它检查了对B的调用如预期,它模拟了B的行为。鉴于A和B的系统测试,以及在运行系统测试时A和B的行为的记录,我们想自动生成用于嘲笑B的单元测试。代理考试可以在B中的错误中隔离错误,如果b缓慢或昂贵,提高测试性能或成本。这篇论文与说明性示例的测试分解,提出了一种自动生成考核对象的简单过程,并举例说明如何扩展程序以产生更强大的因素测试。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号