Free Newsletters
Technology & Business Daily

InfoWorld
Log-in | Register

Coverity and Klocwork code analyzers drill deeper

Industry leaders show remarkable scalability and prowess but differ in design philosophy


Remarkable increases in hardware performance are enabling the design and creation of tools that were simply not possible years ago. With two processor cores tearing through 3 billion instructions per second, it's now possible to devise tools that perform rich, very thorough analyses very quickly.

Return to special report

DOWNLOAD PDF

Click here to download InfoWorld's special report Code analyzers


Coverity Prevent and Klocwork K7 are two such tools; they analyze source code for bugs and defects using a variety of techniques, including stepping through all possible execution paths. As a result, they detect infelicities that are not caught in testing, nor necessarily detected in manual code inspections. These products are especially valuable to sites with very large code bases, especially if those applications are important or mission-critical. My review showed Klocwork K7 holding an edge over Coverity Prevent. However, the products are close enough in many respects  that both warrant consideration before any purchase is finalized.

Going to the source

Both tools transcend the traditional concept of static code analysis, so understanding them requires something of a mind shift. The most widely known static code analyzer is lint, the code scanner bundled with Unix for decades. Lint looks for infelicities in C and C++ code and for suspicious constructs. For example, it flags suspicious indentation, possible truncation when a large value is copied to a smaller variable, as well as a host of other possible bugs. Good lint utilities often generate hundreds of warnings, and using lint often means learning how to reduce the number of warnings generated by items of no real concern to you -- aka false positives.

K7 and Prevent do not traffic in this kind of bug sniffing. They relegate those bugs to lint and look for more insidious defects. For example, both specialize in stepping through every possible executable path through the code base. They search for functions that are called incorrectly or with invalid values and then report on the specific path through the code that leads to the undesired result. They also look for other dangerous items, such as references to variables whose memory has been de-allocated by code in other functions, and so on. Essentially, any defects that arise from cross-functional code errors are their stock in trade.

The intended beneficiaries of this analysis are sites with large code bases -- typically 500,000 or more lines of code. With that much code, sites simply cannot use other means to traverse all the code paths to ensure everything lines up as it should. So, having tools that automate this analysis and work backward through hundreds of function calls, if need be, to track down a possibly corrupted value is a valuable resource, especially in handling edge cases that might escape typical functional testing. In preparing this review, I looked at small to midsize code bases -- the largest being 80,000 lines -- and I spoke with customers of both vendors, some of whom used the products on projects that exceeded 20 million lines of code.

Andrew Binstock is senior contributing editor of the InfoWorld Test Center.
Continued
1 | 2 | 3 | NEXT PAGE » 

 The Bottom Line

Coverity Prevent 2.2.2
Coverity, coverity.com

Good  7.2
criteria score weight
Defect discovery 8 40%
Defect management 5 25%
Configurability 8 15%
Interoperability 8 10%
Value 7 10%

Cost:
Price based on total code size for all projects regardless of number of seats; 500,000 lines of code, $50,000 per year

Platforms:
Windows, Linux, Solaris (SPARC and x86), HP-UX, NetBSD, FreeBSD

Bottom Line:
Coverity Prevent is a highly configurable source analyzer that scales well and runs on numerous platforms. It goes beyond traditional static code analyzers in its discovery of defects but analyzes only C and C++, lacks defect management tools, and provides a constrained view of the kinds of bugs it reports.

About our Reviews and Scoring Methodology

 The Bottom Line

Klocwork K7 v. 7.0.4.15
Klocwork, klocwork.com

Very Good  8.2
criteria score weight
Defect discovery 8 40%
Defect management 9 25%
Configurability 7 15%
Interoperability 8 10%
Value 9 10%

Cost:
$3,995 per user; projects with as many as 500,000 lines of code require at least five seats, larger projects require more seats

Platforms:
Windows, Linux, Solaris

Bottom Line:
Klocwork K7 is a comprehensive analytical suite with excellent defect discovery and an extensive management console. In addition, it provides superior code navigation and analysis tools. K7 works on C, C++, and Java — source and bytecodes — but is limited to mainstream platforms.

About our Reviews and Scoring Methodology


Talkback:

commentPost a Comment

 

MOST COMMENTS

 
 





Virtualization: A Step by Step Approach to Success
Your virtual machines can be up and running in a matter of minutes. HP and Citrix have integrated XenServer with HP ProLiant servers and management tools, powered by hardware-assisted Intel Virtualization Technology to enable high- performance, cost-savings solutions for server consolidation and disaster recovery. Sponsor: HP

»  Click here to view this Webcast
  Storage is big, and getting bigger
The only certainty is that your requirement for storage will never be satisfied. While you clean out space and authorize POs, you might consider another alternative: outsourcing. The best way to deal with storage might be to let someone else deal with it. Sponsored by SGI

»  Click here to download now

- Special Advertising Partners -
WHITE PAPERS
 

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
INFOWORLD MARKETPLACE
 
» BUY A LINK NOW
 
 

Video

 
 
 

Podcasts

 
 
 

 

Columnists

 
 
 

Resource Center


Ads by techwords beta  [See your link here]
 




Sponsored Technology Links

 
 
 HOME  NEWS  BLOGS  PODCASTS  VIDEOS  TECHNOLOGIES  TEST CENTER  EVENTS  CAREERS  IT EXEC-CONNECT   About | Advertise | Awards | RSS | Contact Us 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy, Terms of Service.
All Rights reserved. InfoWorld is a leading publisher of technology information and product reviews on topics including viruses,
phishing, worms, firewalls, security, servers, storage, networking, wireless, databases, and web services.

CIO :: ComputerWorld :: CSO :: Demo :: GamePro :: Games.net :: IDG Connect :: IDG World Expo
Industry Standard :: IT World :: JavaWorld :: LinuxWorld :: MacUser :: Macworld :: Network World :: PC World :: Playlist