C++ 代码的单元测试 - 工具和方法

Unit testing for C++ code - Tools and methodology(C++ 代码的单元测试 - 工具和方法)
本文介绍了C++ 代码的单元测试 - 工具和方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个大型 C++ 系统,该系统已经开发了几年.为了提高现有代码的质量,我们参与了一个大型的长期重构项目.

I'm working on a large c++ system that is has been in development for a few years now. As part of an effort to improve the quality of the existing code we engaged on a large long-term refactoring project.

你知道一个可以帮助我用 C++ 编写单元测试的好工具吗?也许类似于 Junit 或 Nunit 的东西?

Do you know a good tool that can help me write unit tests in C++? Maybe something similar to Junit or Nunit?

对于在没有单元测试的情况下编写的模块编写单元测试的方法,谁能给出一些好的建议?

Can anyone give some good advice on the methodology of writing unit tests for modules that were written without unit testing in mind?

推荐答案

对遗留代码应用单元测试是非常重要的原因 有效处理遗留代码 已编写.Michael Feathers 是作者 - 正如其他答案中提到的,他参与了 CppUnit 和 CppUnitLite.

Applying unit tests to legacy code was the very reason Working Effectively with Legacy Code was written. Michael Feathers is the author - as mentioned in other answers, he was involved in the creation of both CppUnit and CppUnitLite.

这篇关于C++ 代码的单元测试 - 工具和方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Rising edge interrupt triggering multiple times on STM32 Nucleo(在STM32 Nucleo上多次触发上升沿中断)
How to use va_list correctly in a sequence of wrapper functions calls?(如何在一系列包装函数调用中正确使用 va_list?)
OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?(OpenGL透视投影裁剪多边形,顶点在视锥外=错误的纹理映射?)
How does one properly deserialize a byte array back into an object in C++?(如何正确地将字节数组反序列化回 C++ 中的对象?)
What free tiniest flash file system could you advice for embedded system?(您可以为嵌入式系统推荐什么免费的最小闪存文件系统?)
Volatile member variables vs. volatile object?(易失性成员变量与易失性对象?)