【24h】

Test-Oriented Languages: Is it Time for a New Era?

机译:面向测试的语言:是时候进入新时代了吗?

获取原文

摘要

More than a decade has passed since the advent of Test Driven Development and the introduction of the tools that facilitate its practice. However, it is our belief that we are nearing the limits through which functional decoration can aid the testing of current imperative languages. This paper presents a thought experiment to explore improvements to the testability of current imperative languages. We use the guise of a hypothetical language, Quilt, to present one path that such a language might take. For brevity we retain the language constructs of current imperative languages like Java and C# and explore alterations in the compiler operation that make the language more test-oriented. Quilt extends the Mockist Test Driven Development approach [2,9] by integrating the role of unit test isolation into the compiler. The application is split into a patchwork of independently testable units. However, unlike current Mocking frameworks [5,11,12], Quilt isolates through the provision of stub Methods, not Objects. Methods that do not return state (or mutate passed references) are automatically stubbed. Methods that do return state cause compilation failures if a stub has not been provided. Through static analysis the compiler minimises the number of interactions that require isolation, reducing coupling between test and class (when compared to current testing practices). The effect is to significantly reduce the barriers to testing: Less test setup is needed, there is no need to inject dependencies for the purpose of testing and even preexisting code is easy to test. We conclude that testing in current object-oriented programming languages is already largely incumbent and ultimately inevitable. However, the penetration of the Mockist approach has been limited somewhat by a high barrier to entry and adverse side effects experienced under certain conditions. We make a case for the value of unit test isolation and describe a mechanism for lowering this barrier for entry, reduci--ng coupling issues, and generally making TDD easier.
机译:自从“测试驱动开发”问世并引入有助于其实践的工具以来,已经过去了十多年。但是,我们相信,我们正在接近功能性装饰可以帮助测试当前命令性语言的极限。本文提出了一个思想实验,以探索对当前命令式语言可测试性的改进。我们以一种假设的语言“被子”(Quilt)为幌子,提出了这种语言可能采取的一种方法。为简洁起见,我们保留了当前命令式语言(如Java和C#)的语言结构,并探讨了编译器操作中的更改,这些更改使该语言更加面向测试。通过将单元测试隔离的角色集成到编译器中,Quilt扩展了Mockist测试驱动开发方法[2,9]。该应用程序分为可独立测试的单元组成的拼凑而成。但是,与当前的Mocking框架[5,11,12]不同,Quilt通过提供存根方法而不是对象来隔离。不返回状态(或突变传递的引用)的方法将自动存根。如果未提供存根,则返回状态的方法会导致编译失败。通过静态分析,编译器可以最大程度地减少需要隔离的交互次数,从而减少测试和类之间的耦合(与当前测试实践相比)。效果是大大减少了测试的障碍:所需的测试设置更少,无需为了测试目的而注入依赖项,甚至预先存在的代码也易于测试。我们得出的结论是,当前使用面向对象的编程语言进行测试已经很重要,并且最终是不可避免的。然而,由于在某些情况下进入的高障碍和不良副作用,Mockist方法的普及受到了一定程度的限制。我们以单元测试隔离的价值为例,并描述一种降低这种进入障碍的机制,即 -- ng耦合问题,通常会简化TDD。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号