Thursday, March 11, 2010

Software Testing Demystified part 2

In my previous post, I discussed about the classification of Software Testing on the basis of the Software requirements. In this post, I will try to cover how these are being accomplished in different phases across the development cycle in different Institutions. Since we have been talking about software testing alone, I will be following a bottom-up approach in describing about the various testing methodologies that are followed. Please note that this does not mean that the processes are always adopted in similar fashion and order always. There can be deviations at any phase.



How to identify Phases? When we think about numbers, we start with "unit", "ten", "hundred", "thousand" and so on with respect to the individual position of numbers and digits. These are all parts of the same number, but we separate them in terms of their positions. A similar approach could be adopted in identifying the phases of Software testing as well. Since the software gets developed right from small and simple code snippets/functions till it emerges as a full product, the various testing institutions across the world have identified the different phases of testing that needs to be followed accordingly. This could be Unit/Module Testing, Integration Testing, System Testing, User Acceptance Testing and Beta Testing, if necessary. I mentioned Beta Testing as an optional one, because this category is not actually required for products which already exist in market. If you are going to launch a new service or an innovative idea, then certainly one would opt to include this phase as well in order that the user experience could be taken into consideration. Perhaps I will discuss this in more detail when explaining Beta Testing.


Unit Testing: Right after our "Hello World" program in C, we all are/will be, quite familiar that a software program is actually built as pieces of code which are then arranged them in a good fashion to accomplish the final functionality. When in the process of Software Development, we can think of it as a basic unit of software. This unit it the basic building block of a software and is nothing else, but a function that is written in some programming language. In the unit testing phase we accomplish testing of these chunks of code, or functions. In order to accomplish Unit Testing, there are quite a large number of techniques which are used, which collectively can be gathered under the categories of Static Analysis and Dynamic Analysis.


Static Analysis is that phase of Unit Testing, where the code remains static, i.e., it is not executed even once. This involves Syntax checking, Data Flow Analysis, Coverage Analysis of Conditions, Statements, Analysis of Loops, Functions and Procedures etc. as well as analyzing the program code complexity (For E.g.: Cyclomatic Complexity). Security is another perspective which most of the institutions describe as the usage of Static Analysis. There are quite a number of tools available for static code analysis like RATS, Checkstyle, Frama-C etc.


Dynamic code Analysis is a phase in Unit Testing where the code is tested for errors by executing it in a real or any virtual environment. This is accomplished by continuously debugging the code while monitoring it. The areas that are covered and the benefits achieved with Dynamic Analysis are performance optimization, cost reduction, early identification of errors like memory leaks, buffer overflows etc. Profiling is a method that is mostly adopted in performing a dynamic code analysis. This is achieved through code instrumentation (modifying the code with custom controls to measure) or through operating system/platform counters. The more efficient method, although is code instrumentation. The dynamic analysis also assists in performance optimization because here the counters provide a better and clear picture of function execution times. Run-time error detection is also made easy through the introduction of Dynamic Analysis. There are several tools available for profiling like JRAT, Glowcode, IBM Rational PurifyPlus etc.


One thing that needs attention is that these two methodologies do not stand alone. Static code analysis, together with dynamic analysis performed with the help of a tool will lead to an effective and increased amount of problem identification and eradication at an earlier stage of software development.


I will cover more on Static and Dynamic code analysis techniques in the coming posts.

Labels: ,


Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]