开发者

parser for developing c++ code coverage tool

I am dev开发者_如何学Goeloping a c++ code coverage tool. Are there any tools available for developing code coverage applications like parsers, etc.


I'd suggest that you look at the existing compilers and use their parsing abilities. For example there's clang/LLVM which already implements static code analysis of some form. Or you could use the built-in parser of the GNU Compilers/g++. IIRC, the new Visual Studio 2010 SDK also allows you to tap directly into the online compiler (that's also used for the new intellisense).


See my paper Branch Coverage Branch Coverage for Arbitrary Languages Made Easy which describes how to build test coverage tools using a program transformation system, by parsing source text, building an AST, and applying rewrite rules to insert test coverage probes, and prettyprinting the modified source code for compilation/execution/test probe data collection.

While the technique works with any system that can parse and prettyprint C++, as general rule these are hard to find, because parsing C++ is difficult. The paper particularly focuses on our our DMS Software Reengineering Toolkit, which has full C++ Front End, and for which we have built a C++ Test Coverage tool.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜