c++ static analysis : klocwork versus coverity

think2

Senior member
Dec 29, 2009
250
3
81
Does anyone have any experience with static analysis tools like klocwork and coverity for use in C/C++ embedded systems for projects of 10000 to 80000 lines of code?
Do they find bugs?
Do they take a lot of time to set up?
Are there a lot of non-bugs to wade through like there are with PCLint?

Thanks for any comments.
 

Jaydip

Diamond Member
Mar 29, 2010
3,691
21
81
I prefer klocwork K7 over Coverity Prevent because K7 seems to report way more bugs.But the later supports way more compilers though.
 

zoiks

Lifer
Jan 13, 2000
11,787
3
81
I'm biased because I work for one of the two companies mentioned here. :)
But IMO what really matters is how you value your time. Klocwork has a lot of false positives and sometimes way too many. Finding true defects in the pile is like sifting through a junkyard in order to find the right part or in this case a valid defect.
Coverity however has very very few false positives. The analysis is very conservative and almost every defect is valid so it actually saves a lot of time for your developer so that he/she can focus on other things.
On the other hand, Klocwork is much cheaper than Coverity. So it's your call in terms of what is important to you.
 

veri745

Golden Member
Oct 11, 2007
1,163
4
81
I have limited experience setting up and using PolySpace (mathworks) on a large (100k+ loc) embedded platform using C.

The tool seems very good if you plan your project to use it from the start. Tacking it on halfway through or after the project is already huge is difficult, and you end up spending time converting working code just so it doesn't give you false positives.
 

nForce2

Senior member
Aug 15, 2013
285
0
76
Have you tried Cppcheck?
http://cppcheck.sourceforge.net/

It's not as fancy as the commercial options you mentioned, but I can say from experience that it's easy to set up, it *does* find bugs, and it's pretty true to its design goal of minimizing false-positives. :thumbsup: