Static Testing – An Effective Method Between Coding and Testing Phase

Posted on Mar 20 2010 - 4:35am by Raj

Static Testing – An Effective Method Between Coding and Testing Phase

Software testing connotes real-time execution of software beta versions. However, real testing already starts even in coding phase, when developers present their initial code for review. The system is being tested statically once the reviewer began to analyze the code, and ends until a satisfactory code has been successfully compiled. In actual practice, static testing purposes are as follows:

Existential Check of Code Implementation for All User Requirements
This is one of the top priorities of code reviewers or static testers. They make sure that all requirements written in software specifications are implemented in the code. It also extends to check if hidden requirements are met.

Syntax Validation
The main focus of this testing is to have a theoretically working source code, and one way to do this is to ensure that code is syntactically correct. Input arguments for both customized and built-in functions can also be included in validation. Syntax checking is very important because having a compiled source code is the first step in acquiring a working prototype.

Improving Code Readability
Various developers have differing programming style. Having various developers in one source code might result to generally unreadable code, that is, logic flow within the code is difficult to follow and to maintain. Verifying the code statically calls for searching for an alternative solution to be lengthy, hard to follow, and difficult to manage code.

Developing Source Code Efficiency
Aside from well-structured design, efficiency is also achieved through proper implementation of the design. One data type will work better than others and choosing the best type for the entire code is crucial. In addition, poor coding implementation results to longer run-time. This problem can be solved by optimizing the code structure during reviews.

Creating Well-Documented Source Code
Code comments are often neglected in actual practice. Having sufficient comments can help developers to modify the work of each other and to have a more understandable source code. Static testers also aim to utilize modern methodologies, like XML tags, for better code documentation.

Modern static testing techniques offer a more benefit to the software development team. The advent of pair programming, a technique used in extreme programming and Agile process, paved the way for shorter development and review time. Some benefits of modern static techniques are higher quality, lower cost, and better knowledge transfer. It also has its disadvantages like intimidation issues when pairing more experienced developer with a newcomer. Such static technique can also help in skill improvement because studies show that developers increase their productivity as much as two times after participating in several pair programming.

The primary problem encountered in the static analysis is the fact that no method can give exact answers on whether the code will have run-time error or not. To resolve this issue, several formal methods have been developed, and some static testing implementation techniques include:

Model Checking
The system is checked if requirements are met by using a simplified model of its structure. It also includes elimination of situations where two different operations temporarily pause for their actions to wait for the other operations to finish, or commonly known as deadlock.

Abstract Interpretation
Computable mathematical representation of software behavior should be acquired to allow static testers to analyze its theoretical results and expected system action. If done efficiently, static analysis can be “sound”, or has the same result for both abstract and actual system.

Assertions
This is actually a programming keyword used in several code checker utilities. Assertions can validate if the output of the static system is the same with the expected value of the developer.

Advanced implementation can include process champions, trainers, and static analysts. They also use materials like policies, logs, metrics, etc.

About the Author

Leave A Response