C++模板元程序测试
Testing by C++ template metaprograms
摘要:
测试是软件工程中不可缺少的任务之一。测试在软件开发中的作用已经显著增长,因为测试能够在开发的早期阶段揭示代码中的缺陷。存在许多与C/C++代码兼容的单元测试框架,但是缺少标准的单元测试框架。不幸的是,许多未解决的问题可以提到与现有的方法,例如通常外部工具是必要的测试C++程序。在本文中,我们提出了一种新的方法来测试C++程序。我们的解决方案是基于C++模板元编程设施,所以它可以与标准兼容的编译器。元编程方法确保在运行时测试的开销最小。该方法还支持规约语言可以被定制以及其他优点。然而,唯一必要的工具是编译器本身。
英文摘要:
Testing is one of the most indispensable tasks in software engineering. The role of testing in software development has grown significantly because testing is able to reveal defects in the code in an early stage of development. Many unit test frameworks compatible with C/C++ code exist, but a standard one is missing. Unfortunately, many unsolved problems can be mentioned with the existing methods, for example usually external tools are necessary for testing C++ programs. In this paper we present a new approach for testing C++ programs. Our solution is based on C++ template metaprogramming facilities, so it can work with the standard-compliant compilers. The metaprogramming approach ensures that the overhead of testing is minimal at runtime. This approach also supports that the specification language can be customized among other advantages. Nevertheless, the only necessary tool is the compiler itself.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。