Development of an Enhanced Automated Software Complexity Measurement System
Total Page:16
File Type:pdf, Size:1020Kb
Journal of Advances in Computational Intelligence Theory Volume 1 Issue 3 Development of an Enhanced Automated Software Complexity Measurement System Sanusi B.A.1, Olabiyisi S.O.2, Afolabi A.O.3, Olowoye, A.O.4 1,2,4Department of Computer Science, 3Department of Cyber Security, Ladoke Akintola University of Technology, Ogbomoso, Nigeria. Corresponding Author E-mail Id:- [email protected] [email protected] [email protected] 4 [email protected] ABSTRACT Code Complexity measures can simply be used to predict critical information about reliability, testability, and maintainability of software systems from the automatic measurement of the source code. The existing automated code complexity measurement is performed using a commercially available code analysis tool called QA-C for the code complexity of C-programming language which runs on Solaris and does not measure the defect-rate of the source code. Therefore, this paper aimed at developing an enhanced automated system that evaluates the code complexity of C-family programming languages and computes the defect rate. The existing code-based complexity metrics: Source Lines of Code metric, McCabe Cyclomatic Complexity metrics and Halstead Complexity Metrics were studied and implemented so as to extend the existing schemes. The developed system was built following the procedure of waterfall model that involves: Gathering requirements, System design, Development coding, Testing, and Maintenance. The developed system was developed in the Visual Studio Integrated Development Environment (2019) using C-Sharp (C#) programming language, .NET framework and MYSQL Server for database design. The performance of the system was tested efficiently using a software testing technique known as Black-box testing to examine the functionality and quality of the system. The results of the evaluation showed that the system produced functionality of 100, 100, 75, 75, and 100 %, and quality of 100, 100, 75, 75, and 100 % for the source code written in C++, C, Python, C# and JavaScript programming languages respectively. Hence, the tool helped software developers to view the quality of their code in terms of code metrics. Also, all data concerning the measured source code was well documented and stored for maintenance and functionality in the possibility of future development. Keywords: Software Metrics, Code-based Complexity, Sources Line of Code metric, McCabe Cyclomatic, Halstead Complexity. INTRODUCTION [15]. One of the functions of the Computational Complexity hypothesis hypothesis is establishing feasible focuses on identifying computational limitation of what the computer can issues as claimed by their built-in execute. problems and correlate these categories to In software lifetime development, one of one another [15]. These issues are task the significant concerns is software resolved by a system using other problem- complexity. The source code complexity solving operations mainly by a computer metrics are used to measure the quality of HBRP Publication Page 1-11 2019. All Rights Reserved Page 1 Journal of Advances in Computational Intelligence Theory Volume 1 Issue 3 software properties. Software complexity RELATED WORK in order words predicts analytical In [8], Jetter conducted a research on how information about reliability, testability, to apply the Bansiya software quality and maintainability of program source model to evaluate the development of 19 code from the automatic measurement of Azureus versions by making comparisons the code [12]. A complex source code will using the object-oriented metrics rather therefore be difficult to develop and than the metrics proposed by Bansiya and maintain by the software developer. his colleagues [1]. The researcher Recently, it’s important for software demonstrated the ability of this model to engineering to correctly predict the track the evolution of design quality in complexity of a program source code to several versions by providing access to save millions of people in maintaining important information in the internal life of time and effort [16]. A software metric can the software. This information can simply be defined as the quality of measuring the support design decisions at higher levels of level to which a software system or abstraction. His suggested model may operation possesses some attribute. require additional inputs to cover the However, the metrics and measurements highest levels of abstraction to assess all are often used but metrics are said to be aspects of the quality model at this level basis while measurements are the figures [8]. obtained by the application of metrics. According to literature quantitative Zhang and Baddoo [18], studied the measurements are vital in all sciences, performance of three complexity metrics. these leads to ceaseless effort by computer They selected McCabes Cyclomatic science practitioners and theoreticians to Complexity, Halstead’s Complexity, and bring similar perspective to software Douces Spatial Complexity. Their development [10]. In this paper the code- experiment is established on four based complexity metrics, Source Lines of hypotheses using dataset from Eclipse JDT Code metrics (SLOC), McCabe which is an open-source application. Cyclomatic Complexity metrics and Sequel to the result, they conclude that the Halstead Software Science metrics were three complexity metrics show different used to obtain the objective reproducible performance results during their measurements that can be useful for hypotheses testing, and finally they quality assurance, performance, debugging recommended combining Cyclomatic management, and defects rate. The complexity metric and Halstead metrics Software metrics have been accepted for better decisions on software under the idea that before any source code complexity. can be measured or quantified, it needs to be translated into numbers. There are Another study by Panovski [13] several areas where software complexity established a new assessment of software metrics are found to be useful. These areas product quality, which focused on simply include phases from software assessing the quality of the external planning to the steps that are meant to features of the software product, which improve the quality of certain software. means evaluating the behavior of the However, the software system can’t software product when implemented. In perform on its own without human addition, the study focused on the interaction. Therefore, the software development of the quality model (ISO / complexity metric is also a measure of a IEC 9126) at the level of software metrics. person's relation to the software that he or The study is based on seven samples of the she is handling [14]. software product and assesses them using HBRP Publication Page 1-11 2019. All Rights Reserved Page 2 Journal of Advances in Computational Intelligence Theory Volume 1 Issue 3 ISO / IEC 9126-2 quality model. In the complexity and usability, either in research, Panovski [13] concluded that monitoring software complexity during external product quality attributes are an development, or in evaluating the area or category that can be used, and that complexity of legacy software system. The the metrics provided by ISO / IEC 9126-2 researchers of this study, Widheden and can be regarded as a starting point for the Goran [17] suggested a new coupling definition of standards, but are not ready to metrics (Ecoup), and introduced the Java use in their present form. The software met tool, which works in a static analysis metrics of the software product need to be of programs written in Java programming more adapted to give better information language with respect to coupling, flow [13]. control, complexity and coherence. In the same year, Chandra et al. suggested the Borchert [3] examined the technique of use of Object Oriented metrics that code profiling by using a static analysis. introduced by Chidamber and Kemerer [5] The study was done on 19 industrial to assess program quality at the class level. samples and 37 samples of students' The suggested tool can be used to verify programs. He has analyzed software the class design conforms to the design samples through software metrics. The specifications of the Object Oriented results of this study recommended that the programming, through using the threshold code pattern could be a useful method for for each metric [4]. rapid program comparisons and quality observation in the field of industrial According to Silva et al. [16 who worked application and education. on the relevance of three software complexity metrics: McCabe’s Cyclomatic Jay et al. [7] compared two metrics to complexity, Halstead’s complexity, and calculate the complexity of code. They Shao and Wang’s cognitive functional used McCabe Cyclomatic Complexity size. In the research work, 10 different metric and Line of code metric (LOC) to programs of the same Java programming prove the stable linear relationship language were used and evaluate which between these two techniques. They used 5 one of the three complexity metrics is most NASA datasets with different suitable for software manufacturing. In programming languages, such as C, C++, order to calculate manually the ranking of and Java, to be the dataset for their the ten programs complexity based on the research. three metrics, quota sampling method was applied by selecting five different Bhatti [2] explored the research area companies and randomly asked six occupied by the software complexity