COMPARATIVE STUDY OF STATIC METRICS OF PROCEDURAL AND OBJECT ORIENTED PROGRAMMING LANGUAGES

The goal of this study is to compute and analyze an assortment of static software metrics for different programming methods or techniques. Software engineering is branch of Computer Science that deals with an effective development and analysis of software product. Software engineering provides the concept of metrics with the help of which the complete investigation of code can be done in static or in dynamic way. The static metrics helps in measuring the effectiveness of code without executing the actual program. In this study the focus is given on analyzing the different programming methods like function, constructor, overloading and virtual functions.


INTRODUCTION
One of the major aspects of software engineering is to develop and manage software for commercial use. Software metric is a field of software engineering that is associated with diverse measurements of computer software and its developments. Software metrics [1] [2] [3] is one of the important tools for analyzing the software product in an effective way. In other words software metrics are measures that enable software developers and software analyst to gain insight into the efficiency of the software process and projects that are conducted using the process as framework. Software metrics measures different aspects of software complexity and therefore play an important role in analyzing and improving software quality [3]. With the help of software metric one is able to understand the software product in an effective way. We apply some software logic or mathematical technique to software process or product to supply or improve engineering and management information. One can create relationship between various measures by using the concept of software metrics. Normally metrics are classified [4] as metrics analytical model, metrics for software design, metrics for coding, software testing metrics, software quality and software reliability metrics.
Beside this classification Somerville [5] describes metrics into two types called static and dynamic metrics. Here static metrics help in analyzing the code before its execution whereas dynamic metric help in analyzing the code during execution. In this study the accentuate is given on static metrics to understand the performance and productivity of procedural and object oriented programming languages.
Software metric [6] plays a major role in civilizing the quality of software, planning its budget, its cost estimation etc.

PROBLEM DEFINTION
The objective of this study is to compute and analyze the static metrics for different approach of programming like functional approach, recursive approach, constructor approach, overloaded approach and virtual approach etc. The study starts with introduction and fundamentals of metrics. In this study main focus is given on coding metrics for their analysis in procedural and object oriented programming languages. The various objectives of this study are:  To gain basic knowledge about metrics and their types.


Understanding static metrics  Measuring the attributes of static metrics for different programming methods.


Comparing the various static metrics for different programming methods.

ANALYSIS
Software metrics plays a great role in coordinating [9] and managing the software project. With the help of software metrics one is able to compute and analyze various attributes of a software project. The favourable area of application of software metrics is the estimation of cost and size. There are different types of metrics like size metrics, quality metrics, satiability metrics, object oriented metrics etc. The credit of introducing the concept of software metrics goes to Wolver ton who performs a research on production ratio of the programmer by using the concept of LOC i.e. line of code. Software metrics explore the attributes of software to measure the different characteristics of software.. Metrics helps in to measure the various attributes like cost of software development, its complexity, number of operands, operators and statement, hiding factor, coupling factor etc. Predictive metric are normally associated with software product. According to Somerville the metric can be classified into two categories i.e. control metric and predictive metric. Predictive software metric [7] plays a major role in determining both static as well as dynamic characteristics of the software.
` First static metric [2] (LOC/KLOC) was used to measure the productivity of a program. The most commonly used complexity metric before 1990 was cyclomatic [8] complexity that was measured by McCabe. He uses the flow graph and some mathematical equations to compute software complexity. This metric was used in code development risk analysis [1], change risk analysis in maintenance and in test planning.
In 1976 McCabe [8] defined the cyclomatic complexity number metric. The metric measures the number of independent paths through a software module. Although cyclomatic complexity is widely used, critique on it exists claimed that it's based on poor theoretical foundations and an inadequate model of software development. The cyclometic complexity has been selected to be a part of the benchmarks.
Halstead has brought the revolution in the field of metric by collaborating information science and psychology. By using the concept of Halstead metrics an analyst is able to compute the size, complexity, volume, length, difficulty of a project. The basic attributes of Halstead metrics are n1,n2, N1 & N2. In this study we will try to analyze the various Halstead metrics for different programming approach as discussed above. A same segment of code will be implemented in different approached as given above and analyzed. Functional approach is one of the favorable approaches of structured programming that implement the concept of reusability in an effective way. Constructor approach is associated with object oriented programming In this case sample code is implemented using a constructor one of the important type of a member functional that is executed whenever an instance of a class is executed.
The following table will give the analysis of various metrics of programs developed using different approaches as given below: LOC: It is one the basic static metric that is used to measure the size of code segment. It helps in measuring the cost of project in an effective way.
The following chart shows the relationship between different programming approaches with Halstead basic metrics. From the following figure1(a) it is clear overloading approach has higher number of n1,n2,N1 and N2.

CONCLUSIONS
Every branch of science is associated with metrics and measurements. The above study shows the analysis of various static software metrics by taking different programming methods. From the study it become obvious to choose simple functional approach for coding when Halstead metrics are considered, because functional approach give better result in when the analysis of various metrics like n1,n2, N1 and N2 is performed. Further functional approach also takes least line of code as compare to other programming methods under study. In regard to complexity functional approach again gains priority.