Ensuring Code Quality, Reducing Field Errors with Static Code Analysis
Some of the world’s largest network communications service providers and equipment manufacturers use Spirent Communications’ software to evaluate the performance of their network and communications technologies. These organizations rely on Spirent tools to secure, manage and troubleshoot their networks, so the products must be as error-free and secure as possible. Spirent can’t afford to ship faulty code.
To augment manual code testing and to replace a competing static analysis tool that proved difficult to scale and manage, Spirent introduced Klocwork Insight into its software development process. Klocwork enabled Spirent to develop higher-quality software, reduce errors in the field, and maintain its reputation as a leader in its industry.
Klocwork Helps Spirent Communications…
Find Coding Errors Earlier
Reduce Development Costs
Deliver High-quality Products
Scalable Source Code Analysis
“We’ve always had a sophisticated testing process in place to ensure code quality,” says Marc Hornbeek, Engineering Manager, SCM Systems at Spirent Communications. “But, we recognize that it’s much more efficient to find bugs early in the development process and fix them prior to testing.”
To enhance its testing process and deliver the highest-quality code possible, Spirent purchased a static code analysis solution. “We ran that tool for nine months, and while we could clearly see the benefits of static analysis, this particular product wasn’t a good fit with our large code base and highly distributed organizational structure.”
“Klocwork Insight helps us identify code problems that are difficult to obtain through testing such as memory leaks, error handling and edge cases that are hard to force. It finds the bugs that we wouldn’t otherwise notice and pinpoints the specific lines of code that have the defect. That makes it easy for us to both identify and repair any problems.” — Marc Hornbeek, Engineering Manager, SCM Systems at Spirent Communications
Spirent’s flagship product, Spirent TestCenter, features more than 35 million lines of code with a mix of embedded and non-embedded software. “Our setup made it difficult to administer the previous tool — there was no easy way to analyze code from multiple locations and the lines-of-code licensing didn’t scale well for a code base of our size,” Hornbeek notes.
Spirent chose to replace the incumbent static code analysis tool with Klocwork Insight and trialed the solution on a portion of the Spirent TestCenter code base.
“We understood the power of static analysis but wanted a product that accommodated our particular needs,” adds Hornbeek. “We could see right away that Klocwork Insight’s capabilities gave us the feature set we required. This, combined with its licensing flexibility, made the decision to replace the other solution easy.” Klocwork’s licensing model includes unlimited lines of code with no project restrictions — providing the company with cost certainty for future renewal expenses.
Rollout and Implementation
Spirent found that Klocwork Insight fit smoothly into its software development process. “It was remarkably easy to install and get up and running,” says Hornbeek. “We were comfortable with it within days, not weeks. Setup and training was almost trivial, and the solution is extremely easy to use.”
Klocwork Insight enables Spirent developers to run the analysis at their desktop, integrated with their preferred IDE such as Visual Studio. This allows developers to repair errors before code check-in and Hornbeek has found that this extra visibility has helped Spirent discover a number of errors that would have been uncovered only late in their testing cycle, or worse in the field.
“Klocwork Insight helps us identify code problems that are difficult to obtain through testing such as memory leaks, error handling and edge cases that are hard to force,” Hornbeek explains. “It finds the bugs that we wouldn’t otherwise notice, and pinpoints the specific lines of code that have the defect. That makes it easy for us to both identify and repair any problems.”
Return on Investment
By complementing its code testing processes with static analysis, Spirent has been able to dramatically reduce the cost of identifying and repairing code errors. “There are few overlaps between the errors we find during testing and the ones found during static analysis,” he explains. “This means that we’re now catching defects that previously could have made it into the field and cost much more to fix.”
Hornbeek estimates that it costs ten times more to repair an error in the field than during development, so the return on investment is clear. “We’ve calculated that the cost of fixing a defect in the field is $962 and the cost to fix it with static analysis is $96,” says Hornbeek. “With a large code base such as ours, we could easily find hundreds of bugs in one release cycle, so the ROI is very compelling and easy to justify. By catching these problems early in the development cycle we’re able to avoid a large number of costly field repairs.”
Future Benefits with Klocwork
To date, Spirent Communications has achieved excellent results with Klocwork Insight and is planning to extend its use across additional TestCenter development teams, as well as new deployments within other product lines.
“With Klocwork we’ve been able to identify problems that would have been missed, and discover errors more quickly than through traditional manual analysis and testing,” Hornbeek concludes. “That’s allowing us to deliver the high-quality software we pride ourselves on and that our customers expect.”
Catch More Errors Sooner
Klocwork helps companies like Spirent to catch more coding errors sooner. See for yourself how Klocwork can help you achieve that same goal.