问题描述:

We have a number of large C++ MFC project that we manage. Unfortunately, the code quality in them not very good and there are no unit tests. I am therefore looking for tools that can help us to analyze and improve the code.

I am looking for tools for the following:

  • Find duplicate code (there are a lot of such in the code)
  • Find problem code based on software metrics
  • Give suggestions on how the code can be improved
  • Framework for Unit Tests (the development team has lite experience with unit testing and code is not written to allow such)

I would like that the tools can be used together with TFS Build

网友答案:
  • For software metrics I recommend you give cppdepend a try. It has a lot of code quality metrics and you can write your own. But I'm not sure if it has duplicate code detection. It should work with TFS - and can generate custom reports and has an evaluation you can use before purchasing.
  • For unit testing you can either use the built in MSTest (for C++) support in Visual Studio 2012/2013 that has good Visual Studio & TFS integration although does not include a mocking framework.
  • Another option is to use GoogleMock (bundled with GoogleTest) that can be run (as executable during TFS build and can be run using Google Test Runner (VS2012/2013)

If you want a good reference book for unit testing on C++ - take a look at Modern C++ Programming with Test-Driven Development.

相关阅读:
Top