Generating sequence diagrams using call trees
AssigneeInternational Business Machines Corporation
InventorsKapil Bhandari, Divya Bharti, Kallol Pal
Life of this patent
Estimating the term…
Abstract
A software tool is provided to analyze static source code. Source Code files are selected to define the project work space. A class and a method in the class are selected from said selected source code files. The tool generates a Call Tree as an ordered recursive sequence of all method calls in different classes or their instances that are invoked by said selected method in said selected class. A Sequence Diagram is generated from said Call Tree. The tool remembers all updates to the Call Tree used to generate the Sequence Diagram. This information is used when a generated Sequence Diagram is impacted due to changes made to any source code file included in the project.
Claims19
A computer-readable storage device, tangibly embodying a program of instructions executable by a machine to perform method steps for analyzing static source code of a computer program at static time, said method steps comprising:
- selecting the static source code of the computer program to be analyzed;
- selecting a class and method in the class based upon a selected class name from said selected static source code to be analyzed;
- generating a call tree as an ordered recursive sequence of all method calls in different classes or their instances that are invoked by said selected method in said selected class;
- generating a sequence diagram using said call tree by presenting the method calls as messages in the same order in which they appear in the call tree;
- and
- storing said sequence diagram, wherein the stored sequence diagram is used to analyze the effect of updates and changes made to the static source code of said computer program.
A computer-readable storage device, tangibly embodying a program of instructions executable by a machine to perform method steps for analyzing static source code of a computer program at static time, said method steps comprising:
- accessing the static source code of the computer program to be analyzed;
- accessing a class and method in the class based upon a selected class name from said static source code to be analyzed;
- generating a call tree as an ordered recursive sequence of all method calls in different classes or their instances that are invoked by said accessed method in said accessed class and creating a stored call tree file of said call tree;
- generating a sequence diagram using said call tree file by presenting the method calls as messages in the same order in which they appear in the call tree;
- and
- storing said sequence diagram, wherein said stored call tree and stored sequence diagram are used to analyze the effect of updates and changes made to the static source code of the computer program.
A computer readable storage device, tangibly embodying a program of instructions executable by a machine to perform method steps for analyzing static source code of a computer program at static time, said method steps comprising:
- accessing the static source code of a computer program to be analyzed;
- accessing a class and method in the class based upon a selected class name from said source code;
- parsing the accessed static source code of said class and method in the class to determine variable declarations, method declarations, constructor declarations, method invocations and constructor invocations;
- resolving all variables to determine their data type, including resolving the return types for invoked methods to determine the signature of other methods that use these return values as arguments;
- resolving method signatures and the method invocation order;
- generating a call tree as an ordered recursive sequence of all method calls in different classes or their instances that are invoked by said accessed method in said accessed class;
- generating a sequence diagram using said call tree by forming said method calls as messages in the sequence diagram in the same order in which they appear in said call tree;
- and
- storing said sequence diagram, wherein the stored sequence diagram is used to analyze the effect of updates and changes made to the static source code of said computer program.
Dependencies are inferred from the claim text.