parasoft C++ unit test question

蹲街弑〆低调 提交于 2019-12-06 13:02:23

Implement the small change you are making in a new method, test that. Then change the original to call the new method.

You will be testing the change and gotten a little refactor to better code.

No unit testing framework allows you to just test portions of a method.

One ugly suggestion is to use #include to include small chunks of code directly into methods, with the same #include used to include that code into a testing method that sets up variables used by that code.

I recommend Michael Feather's book Working Effectively with Legacy Code for advice on how to add testing to a large code base. It's also available online at Safari.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!