如何在大型C ++项目中实现单元测试? [英] How do you implement unit-testing in large scale C++ projects?

查看:125
本文介绍了如何在大型C ++项目中实现单元测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我坚信使用单元测试作为构建大型多平台应用程序的方法。我们目前正计划在单独的项目中进行我们的单元测试。这有利于保持代码库的清洁。然而,我认为这将把测试代码与单元的实现分开。你认为这种方法是什么,并有任何工具,如JUnit的c ++应用程序?

I believe strongly in using unit-tests as an approach to building large multi-platform applications. We currently are planning on having our unit-tests within a separate project. This has the benefit of keeping are code base clean. I think, however, that this would separate the test code from the implementation of the unit. What do you think of this approach and are there any tools like JUnit for c++ applications?

推荐答案

有很多测试单元框架C ++。
CppUnit肯定不是我选择的(至少在稳定版本1.x中,因为它缺少许多测试,并且需要大量的冗余代码行)。
到目前为止,我的首选框架是 CxxTest ,我计划评估结束有一天。

There are many Test Unit frameforks for C++. CppUnit is certainly not the one I would choose (at least in its stable version 1.x, as it lacks many tests, and requires a lot of redundant lines of codes). So far, my preferred framework is CxxTest, and I plan on evaluating Fructose some day.

无论如何,有几个论文评估C ++ TU框架:

Any way, there are a few "papers" that evaluate C++ TU frameworks :

  • Exploring the C++ Unit Testing Framework Jungle, By Noel Llopis
  • an article in Overload Journal #78

这篇关于如何在大型C ++项目中实现单元测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆