SOFTWARE METRICS TOOL a Paper
Total Page:16
File Type:pdf, Size:1020Kb
SOFTWARE METRICS TOOL A Paper Submitted to the Graduate Faculty of the North Dakota State University of Agriculture and Applied Science By Vijay Reddy Reddy In Partial Fulfillment of the Requirements for the Degree of MASTER OF SCIENCE Major Department: Computer Science July 2016 Fargo, North Dakota North Dakota State University Graduate School Title SOFTWARE METRICS TOOL By Vijay Reddy Reddy The Supervisory Committee certifies that this disquisition complies with North Dakota State University’s regulations and meets the accepted standards for the degree of MASTER OF SCIENCE SUPERVISORY COMMITTEE: Kenneth Magel Chair Kendall Nygard Bernhardt Saini-Eidukat Approved: August 4, 2016 Brian M. Slator Date Department Chair ABSTRACT A software metric is the measurement of a particular characteristic of a software program. These metrics are very useful for optimizing the performance of the software, managing resources, debugging, schedule planning, quality assurance and periodic calculation of software metrics increases the success rate of any software project. Therefore, a software metrics tool is developed in this research which provides an extensible way to calculate software metrics. The tool developed is a web-based application which has the ability to calculate some of the important software metrics and statistics as well. It also provides a functionality to the user to add additional metrics and statistics to the application. This software metrics tool is a language- dependent tool which calculates metrics and statistics for only C# source files. iii ACKNOWLEDGEMENTS Though only my name appears on the cover of this disquisition, a great many people have contributed to its production. I owe my gratitude to all those people who have made this possible and because of whom my graduate experience has been one that I will cherish forever. I would like to extend my deepest gratitude to my advisor Dr. Kenneth Magel for introducing me with this topic and giving an opportunity to work under his guidance. The door of Dr. Magel was always open whenever I ran into any trouble spot or had any questions in my research or writing. I am very thankful to Mr. Rajat Singh whose help and effort was the biggest support for my research. I am very grateful to my committee members Dr. Kenneth Magel, Dr. Kendall Nygard and Dr. Bernhardt Saini-Eidukat for their valuable time and suggestions regarding my thesis. Finally, I would like to thank my parents and my friends, who have supported me throughout entire process, both by keeping me harmonious and helping me putting pieces together. I will be grateful forever for your support. iv TABLE OF CONTENTS ABSTRACT ................................................................................................................................... iii ACKNOWLEDGEMENTS ........................................................................................................... iv LIST OF TABLES ....................................................................................................................... viii LIST OF FIGURES ....................................................................................................................... ix INTRODUCTION ...........................................................................................................................1 LITERATURE REVIEW ................................................................................................................4 List of Software Metric Tools ..................................................................................................4 SLOCCount..........................................................................................................................4 SourceMonitor .....................................................................................................................5 NDepend ..............................................................................................................................6 Code Counter Pro .................................................................................................................6 SLOC Metrics ......................................................................................................................7 Resource Standard Metrics ..................................................................................................8 Semantic Designs C# Metrics ..............................................................................................8 EZ - Metrix ..........................................................................................................................9 McCabe IQ .........................................................................................................................10 CodeMetrics .......................................................................................................................10 Visual Studio Code Metrics ...............................................................................................11 Limitations of the Existing Applications ................................................................................11 Proposed Tool and its Advantages .........................................................................................11 ARCHITECTURE .........................................................................................................................13 Layered Design of the Tool ....................................................................................................14 Presentation Layer .............................................................................................................14 Business Layer ...................................................................................................................14 v Data Layer ..........................................................................................................................14 System Design ........................................................................................................................15 Software Development Methodology .....................................................................................18 RESEARCH APPROACH ............................................................................................................20 Software Metrics ....................................................................................................................20 Lines of Code .....................................................................................................................20 Lines of Comments ............................................................................................................21 Number of Declarations .....................................................................................................21 Number of Class Level Declarations .................................................................................21 Number of Method Level Declarations .............................................................................21 Cyclomatic Complexity .....................................................................................................21 Number of Parameters .......................................................................................................22 In-degree ............................................................................................................................22 Out-degree..........................................................................................................................22 Number of Inherited Data-items ........................................................................................22 Number of Inherited Data-items Actually Used ................................................................22 Number of Inherited Methods ............................................................................................22 Number of Inherited Methods Actually Used ....................................................................22 Number of Include Statements...........................................................................................22 Statistics ..................................................................................................................................23 Average ..............................................................................................................................23 Max ....................................................................................................................................23 Range .................................................................................................................................23 Roslyn APIs ............................................................................................................................24 Extensibility ............................................................................................................................26 vi Classification of Extensibility Mechanisms.......................................................................26 White-Box Extensibility ........................................................................................26 Black-Box Extensibility .........................................................................................27 Gray-Box Extensibility ..........................................................................................27 Approach for Adding a Metric/Statistic to the