Code quality tools

Authors:

Abstract
In this paper we share some of our experiences relating to tools used in coding phase. We primarily focus our discussion on two topics, namely UT (Unit Testing) and Memory related errors. Unit Testing (UT) [1] is a critical early-phase verification activity that ensures the quality of the product soon after the code is ready. Newer paradigms of software development like Extreme Programming [7] have a strong focus on UT. However, UT is very effort-intensive as it involves test harness development and repetitive execution. In Motorola software Group, we evaluated a set of commercial tools and selected a tool for use in our projects. In this paper, we will share the evaluation criteria, which was identified for the tool selection and the various technical challenges encountered in adopting a UT tool solution in a heterogeneous environment along with the associated learning. One of the major challenges encountered, was arriving to a consensus on definition of term 'Unit'. The other issues included handling of complex data structures, event driven code, integration with development environment etc. One of the major categories of errors introduced and found in coding phase relates to memory. As these errors may have security implications, leaving them undetected might be a big risk. For trapping memory related errors, a framework to categorize these errors was created along with the associated code samples. In this paper, two types of memory related errors will be discussed, namely memory leak and buffer overflow. This memory related errors can be exploited to compromise the security of the system. This paper also discusses the causes, types and impact of buffer overflows, as well as the precautions to be taken to prevent buffer overflows.