Software Metrics Tools PDF - St. John Paul II College of Davao
Document Details
Uploaded by DextrousBlessing
St. John Paul II College of Davao
Tags
Summary
This document provides information on software metrics tools, including SLOCCount, SourceMonitor, and NDepend. It discusses the characteristics of software metrics and unified modeling language. The document also touches on tools for counting source lines of code, measuring code quality and visualizing system design, including different types of source code, like C, C++, Java and others.
Full Transcript
ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached Week 9 Lesson Title Software Metrics Tools Realize th...
ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached Week 9 Lesson Title Software Metrics Tools Realize the obtain objective, reproducible and quantifiable measurements that can be useful for quality assurance, Learning Outcome(s) performance optimization, debugging, schedule planning, cost estimation, and proper management of workforce and other resources. At SJPIICD, I Matter! LEARNING INTENT! Terms to Ponder Software metric is the measurement of a particular characteristic of a software program. Unified Modeling Language is a general-purpose, developmental, modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. Use-case diagrams describe the high-level functions and scope of a system. Essential Content List of Software Metric Tools SLOCCount SLOCCount is a suite of programs for counting physical source lines of code in potentially large software systems. This tool was developed by David A. Wheeler, originally to count SLOC in a GNU/Linux distribution, but it can be used for counting the SLOC of arbitrary software systems. This tool has the ability to take a large list of files and then automatically categorize them using a number of different heuristics. It has some report-generating tools to collect the data generated and present it in several formats according to the requirement. This tool also has the ability to automatically estimate SCP-PF113 | 78 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached the effort, time and money required to develop the software depending on the count of lines of code. SourceMonitor SourceMonitor is a freeware program that collects software metrics in a fast, single pass through the source files. It lets the user see how much code they have inside the source code and makes it easy to identify the relative complexity of different code modules. SourceMonitor is written using C++ programming language and can measure metrics which includes method and function level metrics for source code written in C, C++, and C #, Java, Delphi or HTML. This program can be operated within a standard Windows GUI or by using XML commands inside the scripts. It can display and print the results of metrics in tables and charts and also has the ability to export the results to XML (Extensible Markup Language) or CSV (comma separated value) files for further processing with other tools. NDepend NDepend is a static analysis tool which is available as an extension for Visual Studio for.net managed code. It currently supports 82 code metrics which includes Lines of Code, Cyclomatic Complexity, Coupling, Nesting Depth, Rank, etc. and has more than 150 default code rules to check against best practices. It allows trend monitoring by displaying trend charts and visualizations for different code metrics. It has the ability to detect dependency cycles which can be eliminated to achieve higher code maintainability and can compare two versions of the code base to check the modifications and to warn the user if there are any incompatible changes in the code. It can generate reports with different details and analysis of the source code that can be used to keep track of the development SCP-PF113 | 79 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached process. Code Counter Pro Code Counter Pro is a standalone program that counts all the programming lines, SLOC (source lines of code) and KLOC (thousands of lines of code) automatically, calculates the productivity of the software development team, measures Function Points through Backfiring and measures the percentage of comments in the source code. It can handle several types of source code including that of C, C++, Java, C#, HTML, XML, and Pascal etc. It displays the result in a sortable grid that can be sorted by total lines, total comments, total blank lines, or total source code only lines depending on the requirement of the user and can then be saved to XML, HTML (HyperText Markup Language), CSV and XLS (spreadsheet file format) files directly from the program. SLOC Metrics SLOC Metrics is an application that measures the size of the source code based on the Physical Source Lines of Code metric recommended by the Software Engineering Institute at Carnegie Mellon University. According to the definition of this metric, the source lines that are included in the count are the executable statements, declarations, and/or compiler directives, excluding comments and blank lines from the count. It supports different programming languages including C, C++, C#, Java, HTML, etc. and the users are allowed to add additional definitions for other file types. The results generated can be formatted into a HTML, CSV or an XML file format which makes it easier to share the results and analyze the source code. SCP-PF113 | 80 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached Resource Standard Metrics Resource Standard Metrics is a commercial, source code metrics and quality analysis tool which is fast, flexible and an easy- to-use tool in the measurement of code quality and metrics. It supports any operating system while providing a standard method to analyze source code written in C, C++, C# and Java. It calculates a number of functional and object oriented metrics, has the ability to do that by function, class, file, and project, and has no limitations to the file length or the number of files. It has the ability to create an inheritance tree directly from the code, analyze source code for code style enforcement and can analyze class inheritance by depth and derivation. It can create reports in HTML with hyperlinks to the code, XML, CSV format for direct input to Microsoft Excel spreadsheets and in text format for screen, print and importing purposes. Semantic Designs C# Metrics Semantic Designs C# Metrics is a member of SD’s family of language-specific metrics tools which include tools for COBOL, Java, Logix5000 and VBScript. It provides standard metrics down to the level of methods or procedures and summary rollups of larger units such as classes, files and directories. Some of the metrics calculated by this tool at module level includes source lines of code (SLOC), comment lines, number of methods, Cyclomatic complexity, maximum loop nesting, maximum conditional nesting, decision density, Software SCP-PF113 | 81 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached EZ – Metrix EZ - Metrix is a web-based source code counting utility which combines a consistent measurement of source code across different programming languages, platforms and operating systems with the portability of a hosted application. It supports more than 80 programming languages including Ada, Assembly, BASIC, C, C++, C#, Delphi, HTML, Java, JavaScript, jsp, Pascal, PHP, SQL, Python, Ruby etc. The metrics that are calculated for each file by this tool are Source Lines of Code, Comments and Blank Lines. It has the ability to compare two versions of a file or a group of files to determine the differences between them and generate a report with the results. Reports are generally stored on the server and can be displayed on the screen or can even be downloaded or exported to a Microsoft Excel compatible file format. It uses a flexible and configurable rules engine which defines how to differentiate lines of code from comments and blank lines and which can be modified according to the specific needs of the user. McCabe IQ McCabe IQ is a quality management suite used to analyze the quality and test coverage of different applications. It uses advanced software metrics to identify, objectively measure and report on the complexity and quality of the code at the application and enterprise level. It is available in three editions, each suiting to a particular group or team in the software development process and are modified to suit their specific needs. The first is the Developers’ edition which performs static analysis of the code to measure software quality, visualizes the architecture, and highlights the complex blocks of the SCP-PF113 | 82 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached code which makes it easier to identify bugs and security vulnerabilities, second is the Test Team edition which helps in providing complete test/code coverage and in measuring the time and resources needed to ensure a well- tested application, and the last one is the Enterprise edition which provides the functionalities of both the Developers’ and Test Team editions along with other reporting and test data collection capabilities. It supports different programming languages including Ada, C, C++, C#, Java, COBOL, Perl, etc. CodeMetrics CodeMetrics is an add-in for Reflector, a.net decompiler, which analyzes and computes several code quality metrics on the assemblies. It calculates different metrics including Cyclomatic complexity, source lines of code, comments, number of local variables in a method, etc. and the results can be saved to a file. This tool and its source code are freely available to the users, but it is not a web- based tool. Visual Studio Code Metrics It is a set of software measures that help teams to identify risks and track progress during software development process. Using these metrics, developers can identify the parts of the code that needs some modifications or simplifications and to know which of them are to be more thoroughly tested. The different software metrics calculated by this tool includes Maintainability Index which is a value calculated to represent the relative ease of maintaining the code ranging between 0 and 100, Cyclomatic Complexity which measures the structural complexity of the code, Depth of Inheritance which measures the class hierarchy, Class Coupling which measures the SCP-PF113 | 83 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached interdependencies between different modules of the code, and Lines of Code which is the approximate number of lines in the code. This tool is in-built in the Microsoft Visual Studio Ultimate and Premium editions. Architecture The Software metrics tool is an application that can be accessed by the users through a web browser. The architecture of the tool is a typical three-layered architecture which consists of presentation, business and data layers. Each layer is a logical grouping of software components decomposed from the design of the application. These layers are very useful in differentiating the functionalities of different components which makes it easier to create a design that supports reusability of components, helps in maximizing the maintainability of the code and to optimize the way the tool works under different circumstances. Figure 1. The layered architecture view of the tool Image source: Vijay Reddy Reddy. July 2016. SOFTWARE METRICS TOOL. North Dakota State University Graduate School. Fargo, North Dakota SCP-PF113 | 84 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached Layered Design of the Tool PRESENTATION LAYER This layer contains the components that implement and display the user interface and provides components for user input and for displaying the output. The presentation layer for this tool will have a simple user interface through which users can upload the source files for which the metrics and statistics are to be calculated, select the software metrics to be calculated, select the statistics to be calculated and view the results of the calculated metrics and statistics. A user will have access to add new modules to the tool for calculating new metrics or statistics by uploading a source file through the web user interface to the application. BUSINESS LAYER The business layer typically implements the core functionality of the software application. It contains application logic which deals with the retrieval and processing of data, managing the user inputs and ensuring data consistency and validity. After the user uploads the data using the presentation layer components, the data is passed to the business layer where the source files are verified first and processed according to the requirement of the user by interacting with the other workflow components. DATA LAYER This layer contains the data access components which has the logic required to access the underlying data source. The data source for this tool is Microsoft SQL database which stores the information on the metrics and statistics calculated. SCP-PF113 | 85 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached System Design A Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing and documenting the artifacts of a software system. The UML mostly uses graphical notations to express the design of a software project which in turn helps to explore potential designs and validate the architectural design of the software. According to the UML specification, Structure diagrams and Behavior diagrams are the two major types of UML diagrams. Structure diagrams show the static structure of the system and its components on different abstraction and implementation levels and their relation with each other whereas Behavior diagrams show the dynamic behavior of the objects in a system which can be described as a series of changes to the system over time. Figure 2. The UML Use-case diagram of the tool Image source: Vijay Reddy Reddy. July 2016. SOFTWARE METRICS TOOL. North Dakota State University Graduate School. Fargo, North Dakota SCP-PF113 | 86 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached The Use-case diagram, a type of Behavior diagram for the software metrics tool. This diagram describes a set of actions (use cases) that this tool (subject) can perform in collaboration with one or more external users of the tool (actors) to provide some meaningful output to the users of the tool. The Class diagram, a type of Structure diagram, for the software metrics tool is shown in the figure below. The purpose of this diagram is to show the structure of the application as related classes and interfaces and to show the relationships between them. Figure 3. The UML Class diagram of the tool Image source: Vijay Reddy Reddy. July 2016. SOFTWARE METRICS TOOL. North Dakota State University Graduate School. Fargo, North Dakota SCP-PF113 | 87 ST. JOHN PAUL II COLLEGE OF DAVAO COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY Physically Detached Yet Academically Attached Figure 4. Class dependency graph of the tool Image source: Vijay Reddy Reddy. July 2016. SOFTWARE METRICS TOOL. North Dakota State University Graduate School. Fargo, North Dakota SELF-SUPPORT: You can click the URL Search Indicator below to help you further understand the lessons. Search Indicator Vijay Reddy Reddy. July 2016. SOFTWARE METRICS TOOL. North Dakota State University Graduate School. Fargo, North Dakota SCP-PF113 | 88