Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
PROGRAM ANALYZER -BYHARSHA VARDHAN REDDY VISHNU VARDHAN REDDY S LAKKI REDDY SUNDEEP REDDY VISHNU VARDHAN REDDY K MANNEVARU SAMPATH KUMAR -UNDER THE GUIDANCE OFDr. YOUNG LEE K00305054 K00304033 K00305272 K00305507 K00305227 PROGRAM ANALYZER • The Program Analyzer is a software tool which determines the Size, Complexity, Structure and Dependency Metrics of the programs. • In this project, we can analyze the given .java program’s Size Metrics (which calculates Lines Of Code (LOC) of the class and each method in the class and number of methods and attributes in the class), McCabe cyclometic complexity and Dependency metric and we use java platform for the implementation of the project. HOW DOES IT WORK? • The Program Analyzer describes the working design of the project. • In order to describe the working design of the project we design a architecture, the architecture of the program analyzer is such that the user of the program analyzer gives a java program as an input and then the program analyzer calculates the size metrics, McCabe cyclomatic complexity, and dependency metric for the java program and then it shows the output in the form of a report. ARCHITECTURE WHAT ARE THE SIZE METRICS? This module calculates the program’s size and that of each of method. Size of the program depends on following attributes: • • • • • LOC of program. LOC of class. Number of methods in class. Number of attributes in class. LOC of each method in class. All the above calculations must be done as they play a very crucial part in calculating the complexity of the program, a point here to remember is that when calculating the number of lines of code in the program the program analyzer must not count the white spaces and comment lines. WHAT IS MCCABE CYCLOMATIC COMPLEXITY? • The McCabe cyclomatic complexity of the input file is the count of the number of linearly independent paths through the input code. McCabe cyclomatic complexity V is calculated by • V = (number of arcs) – (number of nodes) + 2 • If the code has a single IF statement containing a single condition there would be two paths through the code, one path where the IF statement is evaluated as TRUE and one path where the IF statement is evaluated as FALSE. DEPENDENCY METRIC CONSISTS OF • Dependency metrics uses three parameters Afferent Coupling (Ca), Efferent Coupling (Ce) and Instability (I) and calculates the Dependency Metrics using these parameters. Where the three parameters are • Ca (Afferent Coupling): The number of classes outside this category that depend upon classes within this category. • Ce (Efferent Coupling) : The number of classes inside this category that depend upon classes outside this categories. • I (Instability) : This can be calculated using the formula (I=Ce ÷ (Ca+Ce)). USE CASE DIAGRAM • Use case diagram describes the behavior of the system and mostly on how it responds to a request. In the use case diagram below we see that the programmer/user gives a java program as a input file. The use cases on the right shows the behavior of the system. Once all these cases are completed then it returns the output to the user. CLASS DIAGRAM • A Class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, and the relationships between the classes SEQUENCIAL DIAGRAM PROCEDURE TO RUN THE SOFTWARE : • The user gives a .java file as input and the system (Program Analyzer) passes the input to the size metric class which calculates the size of the program and returns the result to report class and returns the control to the system. • The system then passes the input file to the McCabe cyclomatic complexity class which calculates the complexity of the program and returns the result to report class and returns the control back to the system. • The system finally passes the input file to the dependency metric class which calculates the stability of the program and returns the result to report class and returns the control back to the system. The report class then displays the output file through the graphical user interface. SCREEN SHORTS THANK YOU