Manual code inspection could lead to fatal consequences


Founded in 1985 and headquartered in the UK, PRQA specialises in defect prevention and promoting safe code practices to ensure reliability of safety-critical, mission-critical and commercial systems. It maintains full voting representation on ISO working groups for ‘C’ and ‘C++,’ and is a founding member of MISRA (producer of ‘C’ and ‘C++’ standards) committee. The programming research company is also originator of high-integrity ‘C++’ coding standard (HICPP).

Sanjay Shanbhag, director- PRQA India, spoke to Abhishek Mutha and Ashwin Gopinath of EFY about the importance of static analysis and why automated solutions be preferred over manual inspection methods

Sanjay Shanbhag, director- PRQA India
Sanjay Shanbhag, director- PRQA India

Let’s start with an overview of PRQA

Established in 1985, PRQA is recognised throughout the industry as a pioneer in static analysis, championing automated coding standard inspection and defect detection, delivering its expertise through industry-leading software inspection and standards enforcement technology.

PRQA’s industry-leading tools, QA·C, QA·C++ and QA·Verify, offer the closest possible examination of C and C++ code. They contain powerful, proprietary parsing engines combined with deep accurate dataflow which deliver high fidelity language analysis and comprehension. They identify problems caused by language usage that is dangerous, overly complex, non-portable or difficult to maintain. Plus, they provide a mechanism for coding standard enforcement. PRQA has corporate offices in UK, USA, India, Ireland and Netherlands, complemented by a worldwide distribution network.

Explore Circuits and Projects Explore Videos and Tutorials

Q. What are your views on manual code inspection?
A. We advocate the use of automated code inspection process simply due to the exponential growth in the amount of code being generated and its complexity. For example, a simple washing machine now has one million lines of embedded code and it would be a gargantuan task for a human being to detect issues manually in this maze of code.

Another factor is that every time a fresh code is added to the existing code base, the entire code has to be inspected all over again, wasting time and effort when this can be automated. We, however, recognise that for the proper functioning of this automated process, human intervention is still necessary to control deviations and certain exception defects.

Q. Are manual methods of coding inspection and defect detection still prevailing in India?
A. Yes, some companies still use manual methods. The trouble is that they are worried about the cost of tool investment, rather than looking at the long-term benefits of automating the process.

Q. What is the difference between bug catching and coding standard compliance?
A. Basically, bug catching is finding defects, whereas coding standard compliance means adhering to best practices and therefore preventing introduction of defects in the first instance.
There are some static tools in the market that only look at finding defects and don’t aid in process improvement. We, on the other hand, enable our clients to improve their coding process and develop high-quality code by recommending tracking issues early and often during the development phase. We believe in the saying “prevention is better than cure.” Hence we enforce a coding standard to help our customers develop robust and high-integrity code.

ARM Extends Their Portfolio with Apical Acquisition

The fundamental purposes of a coding standard is to define a safer sub-set of the programming language by framing a set of rules that eliminate coding constructs known to be hazardous, educating all developers to the same standard and promoting the best practice.

Q. Are there any language insecurities while coding?
A. No coding language is perfect and all come with their advantages (such as flexibility) and flaws (known as undefined behaviour). Undefined behaviour occurs when language definition is unclear and no outcome specification has been defined, or where the compiler or library vendor has some explicit freedom of implementation.

Typically, ‘C’ language is used in embedded and safety/mission-critical applications (high cost-of-failure areas such as aerospace, military, automotive and medical devices). ‘C++,’ on the other hand, could be used mainly in human-machine interface. Its use has started in embedded as well as commercial applications.

Q. How does static analysis tool assist developers in improving the quality of the code?
A. Static analysis tools are a very important means to catch bugs and identify coding issues extremely early in the development cycle, passing better code into the latter stages of the development process. At PRQA we recommend the use of a static analysis tool with a coding standard – this solution enables to detect defects, comply with best practice and prevents the introduction of bugs.

Static analysis is a crucial element of high-quality software development processes, enabling developers to identify defects in the code very early in the development process. By ensuring compliance to a coding standard, static analysis not only identifies defects that can cause program crashes but also provides best practice, enabling the developer to reach higher level of standards, and thus prevents introduction of defects.

Static analysis automates code reviews, removing the chances of human error in the process whilst ensuring a deterministic result that removes the emotion often associated with individuals reviewing another developer’s code.

There are also some static analysis tools that offer developers immediate feedback on the code they have written, allowing them to address issues before committing changes to the organisation’s repository of code. These tools can also be used to provide a measure of overall project quality when used in conjunction with a software quality management system.

Q. How fast can these static tools detect errors?
A. There was an interesting case study of one of our prospects working in industrial automation space and developing control instrumentation products. They were not using any static analysis tool and were mainly relying on manual code inspection. They gave a beta release of their product to one of their existing customers for testing. There was a serious bug in the code, which they were unable to find for almost six months. We were called on-site, and within 30 minutes we were able to set up and configure the tool for their environment and identify the defect.

Q. What are the guidelines set by IEC61508 standard?
A. The IEC 61508 standard includes guidance that helps developers mitigate risks or systematic failures and random hardware failures through provision of appropriate requirements and processes. With an extensive hazard analysis of not only the resulting software but also the processes used during the development cycle, these risks should be addressed.

GaN Solutions for Next Generation Military Communications

Additional challenges include peer reviews at each decision phase and documenting bidirectional traceability of requirements through design and testing to release. On the software part, the international standard IEC 61508 mandates use of better development processes, including use of coding standards to encourage further improvements in software quality.

Q. Are there any kinds of certifications for your products?
A. TÜV SÜD has certified QA·C & QA·C++ as “fit for purpose” for safety-related development under ISO 26262 and IEC 61508, enabling our customers to achieve product certifications to these standards more easily and in less time.

Q. What languages other than ‘C’ and ‘C++’ are emerging for code development?
A. ‘C’ is the most widely used language, followed by ‘C++.’ ‘C++’ is actually growing in the embedded market and also in the aviation industry. We are also looking at ‘C#’ as some of our clients are using it.

Q. What kind of coding standards do your products enforce?
A. Historically several industries have created specific coding standards that are adopted by manufacturers throughout the supply chain. Some of the key standards that we support are:

  • MISRA-C++
  • JSF AV C++
  • High Integrity C++ (HICPP)
  • In-House / Internal Coding Standards

Q. Could you throw some light on Structure 101?
A. Structure 101 provides a visual display of rolled-up dependencies across complex projects, partitioning of code bases according to your own view of structure, focus on intensely tangled code portions, and the ability to set architectural rules and constraints and trigger warnings for any breaches. Structure101 for QA·C & QA·C++ offers unmatched power and functionality in managing the most complex code bases.

Q. What is QA·Verify all about?
A. QA·Verify is Quality Management System for industrial-scale software projects and leverages the success of QA·C and QA·C++, extending the functionality of these static analysis tools and also extending the audience beyond the core traditional developers and quality professionals to encourage collaboration amongst key stakeholders, such as development leads, architects, project managers, senior management and even external customers and suppliers.

Semtech Enables Leader's UHDTV T&M Platform

Some of its key features are – management of project software quality, legacy code handling facilities, sophisticated code compliance structures, more effective code reviews through automated code inspection & rich user-defined measurement system for advanced quality profiling.

Q. What about your market segments?
A. We have multiple markets which are safety critical, mission critical and increasingly commercial critical not only in the automotive industry and we are building quite a reputation in defence and aerospace as well as medical. In India, we deal mainly with service providers apart from defence & space organisations and local OEM’s.

Q. Who are your major clients?
A. In Automotive, our main clients are BMW, Toyota, Delphi, and Autoliv. Defence and Aerospace include SELEX Galileo, Thales, Northrop Grumman, and BAE Systems. Medical devices are getting a lot of traction these days and amongst our clients, we can name Abiomed, Novo Nordisk, and Gambro. Some of the Indian companies include Wipro Ltd., HCL Technologies, iGate, L&T, Tata Elxsi Ltd., Sony, DRDO, VSSC to name few.

Q. Do you provide software training for your products?
A. On-going quality improvement and continued education is a key part of a successful and quality driven development environment. PRQA technical consultants provide a number of training courses and also mentoring options that target both inexperienced and experienced engineers and focus on effective and robust language and product usage. All our training courses are instructor-led and are typically tailored to individual needs.

Q. Do you believe in after-sale-service?
A. For any company to survive in this tough market, the after sales service is one of the most important factors. PRQA supports its customers from the start of an evaluation through to post-sale by offering a wide variety of training, consultancy and services to ensure that our products are embedded into the client’s process and used effectively.

Q. What are your marketing strategies?
A. We help organizations around the world to develop high quality C and C++ code. Our marketing approach emphasizes the fact that the most effective way to use Static Analysis is ‘early and often’ in the development lifecycle and strongly advocate “Continuous Code Inspection”, so that issues are identified and resolved as soon as possible before they turn into latent problems.

We find defects and identify code which is poorly written, through a very accurate dataflow engine and by analyzing how well code conforms to coding standards. We help to create coding languages (we are voting members of ISO C++) and also to write coding standards (such as MISRA – where we sit on the MISRA-C Working Group and HIC++ published by us in 1993).