Friday, September 12, 2008

Static and Dynamic Software Testing

Static Software Testing: Making the Code Clean As Early As Possible

During the stages of development of software, there is need for conducting static software testing on the software before it is released either to the customer for use in production or to the market for sale. Static software testing is one form of software testing where we do not have to use the software for testing. This is contrary to other testing methods where the program code has to run e.g. in dynamic testing it is essential that you run the software for testing. This article analysis the importance of static testing in the software testing process and look at some considerations which need to be borne in mind when it is being carried out.

Static testing is also called as dry run testing. This is a form of software testing where the actual program or application is not used and analysis of a program is carried out without executing the program. In this testing method the programmers manually read their own code to find any errors in the software. This is not a detailed test and it checks only for the sanity of the code, document and algorithm.

This type of testing warrants checking of the code by physically going through the syntax of the code line by line to find errors; hence the best person to check is the software programmer who has written the code. By running through the requirements specifications of the software the Static software testing can be done as part of black box testing; however, in practice, it is done as white box testing.

Static code analysis is the analysis of computer software that is performed without actually executing programs built from that software. The analysis is performed either on the source code or on the object code. The term is usually applied to the analysis performed by an automated tool. The degree of sophistication of the analysis performed by tools varies from those that only consider the behavior of individual statements and declarations, to those that include the complete source code of a program in their analysis. The analysis highlights possible coding errors to formal methods that mathematically prove properties about a given program. Some of the static analysis tools are lint-like tools and metric tools and these are used for static testing of software. These tools are effective in checking the static within the system. The main advantage in finding bugs while doing a static software test is that they are inexpensive to fix than if they were discovered later in the development.

Software testing can also be categorized based on how it is executed. Execution could be in the form of verification or static analysis or it could be validation or dynamic analysis. Verification is the human examination or review of the work product. There are many forms of verification which ranges from informal verification to formal verification. Verification can be used for various phases in SDLC and can be in the form of formal inspection, walkthrough or buddy-checking. Static software testing is part of the verification process.

The verification process indicates to the software testers and developers that the system and software met the requirements and qualifications for quality. This is a signal for moving on to the next phase of software testing.

Static software quality analysis techniques are useful in debugging at the code level and helps in a clean software development. Such testing at the code level as it is being written ensures that problems are kept to a minimum for the future. If the static software testing is kept as a normal part of the development process, you will reduce the number of errors to a minimum.

Dynamic Software Testing: An Essential Stage in the Software Testing Process

Development of any software application involves repetitive building and testing of software until the software is error free and passes successfully the tests for quality, performance, security, etc. One of the types of software testing is dynamic testing or dynamic analysis. This is a term used in software engineering to describe the testing of the dynamic behavior of code. The dynamic analysis refers to the examination of the physical response from the system to variables that are not constant and change with time. The dynamic software testing indicates whether the code is correct or has errors. These are the Validation activities.

The dynamic behavior of any application can be illustrated by the following.

The system may be functioning satisfactorily with a certain flow of activity. Any sudden increase in the level of activity has a negative effect on the system and the performance decreases.

The application may load quickly as a standalone. However, when more and more applications are loaded the system will get slower, hang or fail altogether.

The dynamic software testing is designed to detect such malfunctioning given above. Dynamic Testing involves working with the software, giving input values and checking if the output is as given in the requirements specifications. The output as compared with the requirements will indicate the correct functioning of the software or otherwise. Any deviation in this indicates the presence of bug and the bug has to be cleared. Dynamic testing is also used to test large exterior problems.

In dynamic testing the software must actually be compiled and run and this is in contrast to static testing wherein there is no need to run the system. Dynamic testing is the validation portion of Verification and Validation. Validation part is testing to make sure they are making the right product. Validation or dynamic analyses is associated with the execution, and could be related to the execution of test cases or testing in general.
Unit Tests, Integration Tests, System Tests and Acceptance Tests form the Dynamic Testing methodologies. Briefly, these testing types are as follows.

Unit testing – This is the method of making sure that smallest unit of your software is working properly in isolation. In this, testing is carried out on the minimal software component or module. They get integrated once the module testing is completed.

Integration testing – The objective of Integration testing is to make sure that the interaction of two or more components produces results that satisfy functional requirement. This test checks for any defects in the interfaces and interaction between integrated modules. The integrated software should function as a group in the same way as its components.

System testing – System testing is the most important phase of complete testing cycle. This phase is started after the completion of other phases like Unit, Component and Integration testing. During the System Testing phase performance testing, load testing, stress testing, Scalability etc. are also performed. Non functional testing is normally carried out during the System Testing phase only.

Acceptance testing - Acceptance Testing is the formal testing conducted to determine whether a software system satisfies its acceptance criteria and to enable buyer to determine whether to accept the system or not.

The above tests contribute to make up what is broadly referred to as dynamic testing.

No comments: