KR20010075872A - Method for automatic generating call graph for software maintenance - Google Patents
Method for automatic generating call graph for software maintenance Download PDFInfo
- Publication number
- KR20010075872A KR20010075872A KR1020000002769A KR20000002769A KR20010075872A KR 20010075872 A KR20010075872 A KR 20010075872A KR 1020000002769 A KR1020000002769 A KR 1020000002769A KR 20000002769 A KR20000002769 A KR 20000002769A KR 20010075872 A KR20010075872 A KR 20010075872A
- Authority
- KR
- South Korea
- Prior art keywords
- node
- graph
- call graph
- call
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- F—MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
- F04—POSITIVE - DISPLACEMENT MACHINES FOR LIQUIDS; PUMPS FOR LIQUIDS OR ELASTIC FLUIDS
- F04D—NON-POSITIVE-DISPLACEMENT PUMPS
- F04D29/00—Details, component parts, or accessories
- F04D29/08—Sealings
- F04D29/10—Shaft sealings
- F04D29/106—Shaft sealings especially adapted for liquid pumps
-
- F—MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
- F04—POSITIVE - DISPLACEMENT MACHINES FOR LIQUIDS; PUMPS FOR LIQUIDS OR ELASTIC FLUIDS
- F04D—NON-POSITIVE-DISPLACEMENT PUMPS
- F04D29/00—Details, component parts, or accessories
- F04D29/60—Mounting; Assembling; Disassembling
- F04D29/605—Mounting; Assembling; Disassembling specially adapted for liquid pumps
Landscapes
- Engineering & Computer Science (AREA)
- Mechanical Engineering (AREA)
- General Engineering & Computer Science (AREA)
- Stored Programmes (AREA)
Abstract
본 발명은 소프트웨어 유지보수를 위한 콜 그래프 자동 생성방법에 관한 것으로, 번역부가 소스프로그램에서 매개언어를 추출하여 매개언어 저장부에 저장하는 제 1 단계; 추출부가 상기 매개언어로부터 콜 그래프 생성에 필요한 함수 정보를 추출하여 역공학 통합 정보파일에 저장하는 제 2 단계; 콜 그래프 자동 생성부가 상기 역공학 통합 정보파일로부터 함수의 호출정보인 입력 그래프의 노드 및 간선 정보들을 매개언어로부터 탐색하여 콜 그래프 정보모형 저장부에 저장하는 제 3 단계; 콜 그래프 방향그래프 생성부가 상기 함수 호출정보인 입력 그래프의 노드 및 간선 정보들을 이용하여 각 노드의 레벨을 결정하고, 해당 노드와 인접하고 있는 노드의 관계에 따라 간선의 종류를 식별하는 제 4 단계; 상기 콜 그래프 방향그래프 생성부가 상기 각 노드의 레벨에 있는 노드의 순서를 결정하는 제 5 단계; 상기 콜 그래프 방향그래프 생성부가 상기 노드와 간선들의 절대적인 좌표를 생성하는 제 6 단계; 및 콜 그래프 그래픽 인터페이스부가 방향그래프로 생성된 실제 노드와 간선들의 좌표를 이용하여 콜 그래프를 자동 생성하는 제 7 단계를 포함하며, 컴퓨터 지원 소프트웨어 공학 툴 등에 이용됨.The present invention relates to a method for automatically generating a call graph for software maintenance, comprising: a first step of a translation unit extracting a media language from a source program and storing the media language in a media language storage unit; A second step of extracting unit extracting function information necessary for generating a call graph from the intermediate language and storing it in a reverse engineering integrated information file; A third step of automatically generating a call graph information model node and edge information of an input graph, which is a call information of a function, from the reverse engineering integrated information file and storing the call graph information model storage unit in a call graph information model storage unit; A fourth step of determining, by the call graph direction graph generator, the level of each node using the node and edge information of the input graph which is the function call information, and identifying the type of the edge according to the relationship between the node and the adjacent node; A fifth step of the call graph direction graph generation unit determining an order of nodes at the level of each node; A sixth step of generating, by the call graph direction graph generator, absolute coordinates of the node and the edges; And a seventh step of automatically generating a call graph by using the coordinates of the real node and the edges generated by the call graph graphic interface unit in the direction graph, and used in a computer-aided software engineering tool.
Description
본 발명은 소프트웨어 유지보수를 위한 콜 그래프 자동 생성방법에 관한 것으로, 특히 코볼(COBOL), C, C++, 자바(JAVA) 등으로 작성된 소스 프로그램들의 함수 호출관계를 쉽게 이해하고 분석하기 위해 방향 그래프를 계층적으로 배치하는 콜 그래프의 자동 생성방법과 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체에 관한 것이다.The present invention relates to a method for automatically generating a call graph for software maintenance, and in particular, a direction graph for easily understanding and analyzing the function call relations of source programs written in COBOL, C, C ++, JAVA, etc. A method of automatically generating a call graph arranged hierarchically and a computer-readable recording medium recording a program for realizing the method.
일반적으로, 소프트웨어 유지보수를 위한 그래프 자동생성 방법은, 추상적인 구조와 상기 구조를 자동적으로 생성하는 알고리즘이 필요하며, 상기 그래프 생성 알고리즘은 그래프의 종류 및 그래프의 응용분야에 따라 다양한 유형으로 구분된다.In general, a graph automatic generation method for software maintenance requires an abstract structure and an algorithm for automatically generating the structure, and the graph generation algorithm is classified into various types according to the type of graph and the application field of the graph. .
먼저, 그래프의 종류에 따라 사이클(cycle) 방향 그래프(directed graph), 비사이클(acycle) 방향 그래프, 사이클 무방향 그래프(undirected graph), 비사이클 무방향 그래프, 트리 및 평면(planar) 그래프 등으로 구분되며, 그래프의 응용분야에 따라 소프트웨어 공학(software engineering), 컴퓨터 네트워크(computer network) 및 페트리 네트(petri net)등으로 나뉘어 진다. 특히, 소프트웨어 공학분야에서는 서로 다른 표현기법의 추상적인 구조들을 제공하는 컴퓨터 지원 소프트웨어 공학(Computer Aided Software Engineering : CASE) 예를 들면, 자료흐름도(data-flow diagram), 구조도(structure chart), 흐름도(flowchart), 상태 이행도(state transition diagram), 개체-관계도(entity relationship diagram)등이 있다.First, depending on the type of graph, the cycle directed graph, the cycleless graph, the cycle undirected graph, the cycleless direction graph, the tree and planar graphs, etc. It is divided into software engineering, computer network and petri net according to the application of the graph. In particular, in the field of software engineering, Computer Aided Software Engineering (CASE), which provides abstract structures of different representation techniques, for example, data-flow diagram, structure chart, flow chart. (flowchart), state transition diagram, entity relationship diagram, and so on.
상기의 컴퓨터 지원 소프트웨어 공학 툴들은 사용자가 그래프를 직접 생성하고 처리할 수 있는 사용자 인터페이스를 제공하고, 콜 그래프를 생성하는 작업은 실제 종이에 그리는 것보다 약간 개선된 레이아웃을 생성할 수 있다.The computer-aided software engineering tools provide a user interface that allows the user to create and process graphs directly, and the creation of call graphs can produce layouts that are slightly improved than drawing on real paper.
그러나, 상기한 바와 같은 컴퓨터 지원 소프트웨어 공학툴은, 복잡한 소스코드일 경우, 소스코드의 제어구조를 분석하여 콜 그래프를 생성하는데 많은 시간과 노력이 소비되며, 사용자가 콜 그래프를 생성했더라도, 계층적 방향성을 갖는 그래프이므로 판독성이 떨어지는 문제가 있다.However, the computer-aided software engineering tool as described above, in the case of complex source code, it takes much time and effort to analyze the control structure of the source code and generate the call graph, even if the user generates the call graph. Since it is a graph having positive orientation, there is a problem of poor readability.
상기한 바와 같은 문제를 해결하기 위하여, 콜 그래프를 자동으로 방향 그래프로 계층적 배치할 수 있는 방법이 개발되어 사용되고 있다.In order to solve the above problems, a method for automatically hierarchically arranging call graphs as direction graphs has been developed and used.
종래의 콜 그래프 자동생성 방법은, 선택된 그래프의 종류(평면그래프, 방향그래프, 트리그래프 등)를 배치하고, 특정유형의 배치(평면배치, 계층적 배치 등)을 생성한다.The conventional call graph automatic generation method arranges the type of the selected graph (plane graph, direction graph, tree graph, etc.), and generates a specific type of arrangement (plane arrangement, hierarchical arrangement, etc.).
방향 그래프의 계층적 배치 방법은 비사이클 방향그래프를 자동 생성하는데 사용되며, 특히 소프트웨어 공학분야 중 콜 그래프 생성에 유용하게 사용된다. 상기 비사이클 방향그래프의 생성은 유지보수 대상인 프로그램 언어의 소스 프로그램들을 분석하여 프로그램 언어에 종속된 그래프 데이터인 노드와 간선들을 저장한 후, 상기 저장된 그래프 데이터에 대한 이행적 폐쇄(transitive closure) 알고리즘, 무게 중심(barycenter) 알고리즘 등을 적용함으로써 자동 배치할 수 있다.The hierarchical layout method of the direction graph is used to automatically generate the bicycle direction graph, and is particularly useful for the call graph generation in the software engineering field. The generation of the bicyclic directional graph analyzes source programs of a programming language to be maintained, stores nodes and edges which are graph data dependent on the programming language, and then uses a transitive closure algorithm for the stored graph data. Automatic placement can be achieved by applying a barycenter algorithm or the like.
그러나, 상기한 바와 같은, 종래의 콜 그래프 자동생성 방법은, 다양한 프로그램 언어로 작성된 소스 프로그램으로부터 구문 단계의 모든 정보를 추출하여 특정 언어에 종속된 형태로 저장하기 때문에, 분석 대상인 프로그램 언어를 확장할 때마다 새로운 저장구조 즉, 다양한 프로그램 언어의 분석정보가 확장성이 용이한 하나의 문법의 형태로 통합 저장될 수 있는 구조가 필요하며, 사이클 형태의 콜 그래프가 발생하고, 래티스(lattice)형태의 위치 배치는 고려되지 않아 불균형된 위치 배치가 생성될 수 있는 문제가 있다.However, as described above, the conventional method for automatically generating a call graph extracts all the information of the syntax step from source programs written in various program languages and stores them in a form dependent on a specific language, thereby extending the program language to be analyzed. Each time, a new storage structure, that is, a structure in which analysis information of various programming languages can be integrated and stored in a single grammar form that is easily extensible, a cycle call graph occurs, and a lattice type Positional placement is not considered and there is a problem that an unbalanced positional arrangement can be created.
따라서, 본 발명은 상기와 같은 문제점을 해결하기 위해 안출된 것으로, 소스코드의 함수 호출정보를 계층적 방향그래프로 자동 생성하여 사용자에게 프로그램 구조를 쉽게 이해할 수 있도록 지원할 뿐만 아니라, 각 함수에 대한 복잡도 및 구조도 등의 측정정보를 제공함으로써 유지보수되어야 할 소스 코드를 용이하게 분석할 수 있는 소프트웨어 유지보수를 위한 콜 그래프 자동 생성방법과 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는데 그 목적이 있다.Accordingly, the present invention has been made to solve the above problems, and by automatically generating the function call information of the source code in a hierarchical direction graph to support the user to easily understand the program structure, the complexity of each function And a computer-readable recording medium recording a method for automatically generating a call graph for software maintenance that can easily analyze source code to be maintained by providing measurement information such as a structure diagram and a program for realizing the method. The purpose is to provide.
도 1 은 본 발명이 적용되는 콜 그래프 자동 생성시스템의 일실시예 구성도.1 is a configuration diagram of an embodiment of an automatic call graph generation system to which the present invention is applied.
도 2 는 본 발명에 따른 소프트웨어 유지보수를 위한 콜 그래프 자동 생성방법에 대한 일실시예 처리 흐름도.2 is a flowchart illustrating an embodiment of a method for automatically generating a call graph for software maintenance according to the present invention.
도 3 은 상기 도 2 에서 노드의 레벨을 결정하는 서브루틴에 대한 일실시예 상세 흐름도.FIG. 3 is a flow diagram of one embodiment of a subroutine for determining the level of a node in FIG.
도 4 는 상기 도 2 에서 콜 그래프 레이아웃의 위-무게중심 순서를 결정하는 서브루틴에 대한 일실시예 상세 흐름도.4 is a detailed flowchart of one embodiment of a subroutine for determining the above-weighted order of call graph layout in FIG.
도 5 는 상기 도 2 에서 콜 그래프 레이아웃의 아래-무게중심 순서를 결정하는 서브루틴에 대한 일실시예 상세 흐름도.FIG. 5 is a flow diagram of one embodiment of a subroutine for determining the bottom-weighted order of call graph layout in FIG.
도 6 은 상기 도 2 에서 콜 그래프 레이아웃의 위-무게중심 위치를 결정하는 서브루틴에 대한 일실시예 상세 흐름도.FIG. 6 is a detailed flowchart of one embodiment of a subroutine for determining the above-weighted position of the call graph layout in FIG.
도 7 은 상기 도 2 에서 콜 그래프 레이아웃의 아래-무게중심 위치를 결정하는 서브루틴에 대한 일실시예 상세 흐름도.FIG. 7 is a flow diagram of one embodiment of a subroutine for determining the bottom-weight center position of the call graph layout in FIG.
도 8 은 상기 도 2 에서 콜 그래프 레이아웃의 위-래티스-무게중심 위치를결정하는 서브루틴에 대한 일실시예 상세 흐름도.8 is a detailed flowchart of an embodiment of a subroutine for determining the up-lattice-weighted position of the call graph layout in FIG.
도 9 는 상기 도 2 에서 콜 그래프 레이아웃의 노드 X, Y의 좌표를 생성하는 서브루틴에 대한 일실시예 상세 흐름도.9 is a detailed flowchart illustrating a subroutine for generating coordinates of nodes X and Y of the call graph layout of FIG. 2.
도 10 은 상기 도 2 에서 콜 그래프 레이아웃의 간선 X, Y의 좌표를 생성하는 서브루틴에 대한 일실시예 상세 흐름도.FIG. 10 is a detailed flowchart illustrating a subroutine for generating coordinates of the edges X and Y of the call graph layout of FIG. 2.
* 도면의 주요 부분에 대한 부호의 설명* Explanation of symbols for the main parts of the drawings
10 : 모니터 11 : 프린터10: monitor 11: printer
12 : 콜 그래프 자동생성 시스템 13 : 소스코드 분석 시스템12: call graph automatic generation system 13: source code analysis system
14 : 소스프로그램 15 : 매개언어 저장부14: source program 15: intermediate language storage unit
16 : 역공학 통합 정보파일 20 : 콜 그래프 그래픽 인터페이스부16: reverse engineering integrated information file 20: call graph graphical interface
21 : 콜 그래프 자동 생성부 30 : 콜 그래프 방향그래프 생성부21: call graph automatic generation unit 30: call graph direction graph generation unit
31 : 콜 그래프 정보모형 저장부 40 : 번역부31: call graph information model storage unit 40: translation unit
41 : 추출부41: extraction unit
상기 목적을 달성하기 위한 본 발명의 방법은, 소프트웨어 유지보수를 위한 콜 그래프 생성방법에 있어서, 번역부가 소스프로그램에서 매개언어를 추출하여 매개언어 저장부에 저장하는 제 1 단계; 추출부가 상기 매개언어 저장부에 저장된 매개언어로부터 콜 그래프 생성에 필요한 함수 정보를 추출하여 역공학 통합 정보파일에 저장하는 제 2 단계; 콜 그래프 자동 생성부가 상기 역공학 통합 정보파일로부터 콜 그래프 생성에 필요한 함수의 호출정보인 입력 그래프의 노드 및 간선 정보들을 매개언어로부터 탐색하여 콜 그래프 정보모형 저장부에 저장하는 제 3 단계; 콜 그래프 방향그래프 생성부가 상기 콜 그래프 정보모형 저장부에 저장된 함수 호출정보인 입력 그래프의 노드 및 간선 정보들을 이용하여 각 노드의 레벨을 결정하고, 해당 노드와 인접하고 있는 노드의 관계에 따라 간선의 종류를 식별하는 제 4 단계; 상기 콜 그래프 방향그래프 생성부가 상기 각 노드의 레벨에 있는 노드의 순서를 결정하는 제 5 단계; 상기 콜 그래프 방향그래프 생성부가 상기 노드와 간선들의 절대적인 좌표를 생성하는 제 6 단계; 및 콜 그래프 그래픽 인터페이스부가 방향그래프로 생성된 실제 노드와 간선들의 좌표를 이용하여 콜 그래프를 자동 생성하는 제 7 단계를 포함한다.According to an aspect of the present invention, there is provided a method for generating a call graph for software maintenance, comprising: a first step of a translation unit extracting a media language from a source program and storing the media language in a media language storage unit; A second step of extracting unit extracting function information necessary for generating a call graph from the intermediate language stored in the intermediate language storage unit and storing the extracted function information in a reverse engineering integrated information file; A third step in which an automatic call graph generation unit searches node and edge information of an input graph, which is call information of a function necessary for generating a call graph, from the reverse engineering integrated information file from a media language and stores it in a call graph information model storage unit; The call graph direction graph generator determines the level of each node by using the node and edge information of the input graph which is the function call information stored in the call graph information model storage unit, and determines the level of the edge according to the relationship of the node adjacent to the corresponding node. A fourth step of identifying the type; A fifth step of the call graph direction graph generation unit determining an order of nodes at the level of each node; A sixth step of generating, by the call graph direction graph generator, absolute coordinates of the node and the edges; And a seventh step of automatically generating a call graph by using the coordinates of the real node and the edges generated by the call graph graphic interface unit as the direction graph.
또한, 본 발명은, 마이크로 프로세서를 구비한 콜 그래프 자동 생성시스템에, 소프트웨어 유지보수를 위한 콜 그래프 생성방법에 있어서, 번역부가 소스프로그램에서 매개언어를 추출하여 매개언어 저장부에 저장하는 제 1 기능; 추출부가 상기 매개언어 저장부에 저장된 매개언어로부터 콜 그래프 생성에 필요한 함수 정보를 추출하여 역공학 통합 정보파일에 저장하는 제 2 기능; 콜 그래프 자동 생성부가 상기 역공학 통합 정보파일로부터 콜 그래프 생성에 필요한 함수의 호출정보인 입력 그래프의 노드 및 간선 정보들을 매개언어로부터 탐색하여 콜 그래프 정보모형 저장부에 저장하는 제 3 기능; 콜 그래프 방향그래프 생성부가 상기 콜 그래프 정보모형 저장부에 저장된 함수 호출정보인 입력 그래프의 노드 및 간선 정보들을 이용하여 각 노드의 레벨을 결정하고, 해당 노드와 인접하고 있는 노드의 관계에 따라 간선의 종류를 식별하는 제 4 기능; 상기 콜 그래프 방향그래프 생성부가 상기 각 노드의 레벨에 있는 노드의 순서를 결정하는 제 5 기능; 상기 콜 그래프방향그래프 생성부가 상기 노드와 간선들의 절대적인 좌표를 생성하는 제 6 기능; 및 콜 그래프 그래픽 인터페이스부가 방향그래프로 생성된 실제 노드와 간선들의 좌표를 이용하여 콜 그래프를 자동 생성하는 제 7 기능을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공한다.In addition, the present invention, in the automatic call graph generation system having a microprocessor, in the call graph generation method for software maintenance, the first function that the translation unit extracts the intermediate language from the source program and stores it in the intermediate language storage unit; ; A second function of an extracting unit extracting function information necessary for generating a call graph from an intermediate language stored in the intermediate language storage unit and storing the function information in a reverse engineering integrated information file; A third function of automatically generating a call graph information model storing unit and edge information of an input graph which is call information of a function required for generating a call graph from the reverse engineering integrated information file from an intermediate language, and storing them in a call graph information model storage unit; The call graph direction graph generator determines the level of each node by using the node and edge information of the input graph which is the function call information stored in the call graph information model storage unit, and determines the level of the edge according to the relationship of the node adjacent to the corresponding node. A fourth function of identifying a kind; A fifth function of the call graph direction graph generator determining an order of nodes at the level of each node; A sixth function of generating, by the call graph direction graph generator, absolute coordinates of the node and the edges; And a computer-readable recording medium having recorded thereon a program for realizing a seventh function of automatically generating a call graph using coordinates of real nodes and edges generated by the call graph graphic interface unit in the direction graph.
상술한 목적, 특징들 및 장점은 첨부된 도면과 관련한 다음의 상세한 설명을 통하여 보다 분명해 질 것이다. 이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 일실시예를 상세히 설명한다.The above objects, features and advantages will become more apparent from the following detailed description taken in conjunction with the accompanying drawings. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.
도 1 은 본 발명이 적용되는 소프트웨어 유지보수를 위한 콜 그래프 자동생성 시스템의 일실시예 구성도이다.1 is a configuration diagram of an embodiment of an automatic call graph generation system for software maintenance to which the present invention is applied.
도면에 도시된 바와 같이, 본 발명이 적용되는 소프트웨어 유지보수를 위한 콜 그래프 자동생성 시스템은, 콜 그래프 자동생성 시스템(12)과, 소스 코드 분석시스템(13)을 구비하며, 상기 소스 코드 분석시스템(13)은, 코볼(COBOL), C, C++, 자바(JAVA)등으로 작성된 소스 프로그램(14)을 번역부(40)에 의해 독립적인 중간언어인 매개언어를 추출하여 매개언어 저장부(15)에 저장한 후, 상기 저장된 매개언어에서 콜 그래프 생성에 필요한 함수 정보만을 추출부(41)에서 추출하여 역공학 통합 정보파일(16)에 저장한다.As shown in the figure, a call graph automatic generation system for software maintenance to which the present invention is applied includes a call graph automatic generation system 12 and a source code analysis system 13, and the source code analysis system. 13, the source program 14 written in COBOL, C, C ++, JAVA, etc. is extracted by the translation unit 40 to extract the intermediate language, which is an independent intermediate language, and the intermediate language storage unit 15. ), And extracts only the function information necessary for generating the call graph in the stored intermediate language from the extracting unit 41 and stores it in the reverse engineering integrated information file 16.
또한, 상기 콜 그래프 자동생성 시스템(12)은, 콜 그래프 자동생성부(21)와, 콜 그래프 그래픽 인터페이스부(20)를 포함한다. 여기서, 상기 콜 그래프 자동 생성부(21)는, 콜 그래프 정보모형 저장부(31)와, 콜 그래프 방향그래프 생성부(30)를 구비한다.In addition, the call graph automatic generation system 12 includes a call graph automatic generation unit 21 and a call graph graphic interface unit 20. The call graph automatic generation unit 21 includes a call graph information model storage unit 31 and a call graph direction graph generation unit 30.
상기 콜 그래프 자동 생성부(21)는 상기 역공학 통합 정보파일(16)로부터 콜 그래프 생성에 필요한 함수 호출정보인 입력 그래프의 노드 및 간선 정보들을 매개언어로부터 탐색하여 상기 콜 그래프 정보모형 저장부(31)에 저장한 후, 상기 콜 그래프 방향그래프 생성부(30)는 상기 콜 그래프 정보모형 저장부(31)에 저장된 입력 그래프의 노드 및 간선 정보들을 이용하여 콜 그래프 방향그래프를 생성하고, 상기 콜 그래프 그래픽 인터페이스부(20)는 상기 콜 그래프 방향그래프로 생성된 실제 노드와 간선들의 X, Y좌표를 이용하여 콜 그래프 및 콜 트리(call tree)를 자동 생성하여 모니터(10) 또는 프린터(11)로 출력한다.The call graph automatic generation unit 21 searches node and edge information of an input graph, which is a function call information necessary for generating a call graph, from the reverse engineering integrated information file 16 from the media language and stores the call graph information model storage unit ( 31), the call graph direction graph generation unit 30 generates a call graph direction graph using node and edge information of the input graph stored in the call graph information model storage unit 31, and the call. The graph graphic interface unit 20 automatically generates a call graph and a call tree by using the X and Y coordinates of the real nodes and edges generated by the call graph direction graph and monitors 10 or the printer 11. Will output
첨부된 도 2 는 본 발명에 따른 콜 그래프 자동 생성방법에 대한 일실시예 처리 흐름도로서, 먼저, 번역부(40)가 소스프로그램(14)로부터 매개언어를 추출하여 매개언어 저장부(15)에 저장하고(100), 추출부가(41) 상기 매개언어 저장부(15)에 저장된 매개언어로부터 콜 그래프 생성에 필요한 함수 정보를 역공학 정보 통합파일(16)에 저장하고, 상기 역공학 정보 통합파일(16)에 저장되어 있는 콜 그래프 생성에 필요한 함수 호출정보인 입력 그래프의 노드 및 간선들의 정보를 'n'라인의 문장을 탐색하여 콜 그래프 정보모형 저장부(31)에 저장한 후(102), 콜 그래프 방향그래프 생성부(30)에서 레벨 알고리즘을 사용하여 각 노드의 레벨 및 간선의 종류를 식별하고(104), 순서 알고리즘을 사용하여, 콜 그래프 레이아웃의 위-무게중심 순서를 결정한 후(106), 아래-무게중심 순서를 결정한다(108).2 is a flowchart illustrating an embodiment of a method for automatically generating a call graph according to the present invention. First, the translation unit 40 extracts an intermediate language from the source program 14 to the intermediate language storage unit 15. Store (100), the extraction unit 41, the function information for generating a call graph from the intermediate language stored in the intermediate language storage unit 15 is stored in the reverse engineering information integrated file 16, and the reverse engineering information integrated file 102, after searching the sentence of the 'n' line of the information of the nodes and the edges of the input graph, the function call information required for generating the call graph stored in (16) in the call graph information model storage unit 31 (102) In the call graph direction graph generation unit 30, the level algorithm of each node is identified using the level algorithm (104), and the order-based algorithm is used to determine the top-weight center order of the call graph layout. 106), down-weight Determine the seam order (108).
그리고, 콜 그래프 레이아웃의 위-무게중심 위치, 아래-무게중심 및 위-래티스-무게중심의 위치를 결정하고(110 내지 114), 콜 그래프 레이아웃의 노드 X, Y좌표를 생성한 후(116), 간선 X, Y의 좌표를 생성하며(118), 상기 생성된 노드 및 간선의 좌표를 이용하여 콜 그래프 그래픽 인터페이스부(20)가 모니터(10) 및 프린터(11)에 콜 그래프 및 콜 트리를 출력한다.Then, the positions of the top-weight center, the bottom-weight center, and the top-lattice-weight center of the call graph layout are determined (110 to 114), and after generating nodes X and Y coordinates of the call graph layout (116). And generating coordinates of the edges X and Y (118), and using the generated coordinates of the nodes and the edges, the call graph graphic interface unit 20 sends the call graph and the call tree to the monitor 10 and the printer 11. Output
첨부된 도 3 내지 도 10 은 콜 그래프 방향그래프 생성부(30)에서 수행되는 콜 그래프를 생성하기 위한 일련의 처리과정이다.3 to 10 are a series of processes for generating a call graph performed by the call graph direction graph generator 30.
도 3 은 상기 도 2 에서 노드의 레벨을 결정하는 서브루틴에 대한 일실시예 상세 흐름도로서, 깊이 우선 탐색(depth first search)을 확장하여 모든 노드들을 각 레벨에 계층적으로 배치하고 간선의 종류를 식별하는 과정이다.FIG. 3 is a detailed flowchart illustrating a subroutine for determining a level of a node in FIG. 2. The depth first search is extended to arrange all nodes hierarchically at each level and to define the types of edges. Identification process.
먼저, 모든 노드들 중 맨 처음 방문하는 노드의 서수 i를 '0'으로 초기화하고(202), 서수 i를 '1'로 초기화한다(203).First, ordinal i of the first visited node among all nodes is initialized to '0' (202), and ordinal i is initialized to '1' (203).
다음으로, 서수 i가 탐색된 노드의 크기인 n보다 작은가를 판단한다(203).Next, it is determined whether ordinal i is smaller than n, the size of the searched node (203).
상기 판단결과(203), 서수 i가 탐색된 노드의 크기인 n보다 크거나 같으면, 반환되고, 서수 i가 탐색된 노드의 크기인 n보다 작으면, 서수 i인 노드가 방문되었는지를 판단한다(204).The determination result 203 returns if ordinal i is greater than or equal to n, the size of the searched node, and if ordinal i is less than n, the size of the searched node, it is determined whether the node of ordinal i has been visited ( 204).
상기 판단결과(204), 서수 i인 노드가 방문되었으면, i를 1 증가시킨 후(207), 다음 노드의 방문을 위해 상기 서수 i가 탐색된 노드의 크기인 n보다 작은가를 판단하는 과정(203)을 수행하고, 서수 i인 노드가 방문되지 않았으면, 서수 i의 레벨에 '1'을 부여하고(205), 서수 i인 노드에 인접한 노드가 널인가를 판단한다(206).In step 204, if the node of ordinal i is visited, i is increased by 1 (207), and then the process of determining whether ordinal i is smaller than n, the size of the searched node, for the next node visit (203). If the node of ordinal i is not visited, '1' is assigned to the level of ordinal i (205), and it is determined whether the node adjacent to the node of ordinal i is null (206).
상기 판단결과(206), 서수 i인 노드에 인접한 노드가 널이면, 상기 i를 1 증가시키는 과정(207)을 수행하고, 서수 i는 노드에 인접한 노드가 널이 아니면, 서수 i인 노드로부터 도달할 수 있는 모든 노드를 방문하고(208), 서수 i인 노드에 인접한 노드 j에 방문했는가를 판단한다(209).The determination result 206, if the node adjacent to the node of ordinal i is null, performs step 207 of increasing i by 1, and ordinal i arrives from the node of ordinal i if the node adjacent to the node is not null. It visits all possible nodes (208) and determines whether or not it visited node j adjacent to the node of ordinal number i (209).
상기 판단결과(209), 서수 i인 노드에 인접한 노드 j에 방문하지 않았으면, 서수 i인 노드와 인접한 노드 j간의 트리 에지(tree edge)를 생성하고(210), 인접 노드 j에 i레벨+1의 레벨을 생성하고(211), 상기 서수 i인 노드에 인접한 노드 j에 방문했는가를 판단하는 과정(209)을 수행한다.As a result of the determination (209), if the node j adjacent to the ordinal i is not visited, a tree edge is generated between the node ordinal i and the adjacent node j (210), and i level + is applied to the adjacent node j. A level of 1 is generated (211), and a process (209) is performed to determine whether a visit has been made to a node j adjacent to the node of ordinal i.
상기 판단결과(209), 서수 i인 노드에 인접한 노드 j에 방문했으면, 서수 i인 노드의 레벨이 인접한 노드 j의 레벨보다 작은가를 판단한다(212).As a result of the determination (209), if a visit is made to the node j adjacent to the node of ordinal i, it is determined whether the level of the node of ordinal i is smaller than the level of the adjacent node j (212).
상기 판단결과(212), 서수 i인 노드의 레벨이 인접한 노드 j의 레벨보다 작으면, 서수 i인 노드와 인접한 노드 j간의 포워드 에지(forward edge)를 생성하고(213), 상기 포워드 에지(forward edge)에 대해 더미 노드(dummy node) 및 더미 에지(dummy edge)를 생성하고(214), 상기 서수 i인 노드에 인접한 노드 j에 방문했는가를 판단하는 과정(209)을 수행한다.The determination result 212, if the level of the node of ordinal i is less than the level of the adjacent node j, generates a forward edge between the node of ordinal i and the adjacent node j (213), the forward edge (forward) A dummy node and a dummy edge are generated for the edge (214), and a process (209) is performed to determine whether a visit has been made to the node j adjacent to the ordinal node i.
상기 판단결과(212), 서수 i인 노드의 레벨이 인접한 노드 j의 레벨보다 작지 않으면, 서수 i인 노드의 레벨이 인접한 노드 j의 레벨보다 큰지를 판단한다(215).As a result of the determination 212, if the level of the ordinal node i is not smaller than the level of the adjacent node j, it is determined whether the level of the ordinal node i is greater than the level of the adjacent node j (215).
상기 판단결과(215), 서수 i인 노드의 레벨이 인접한 노드 j의 레벨보다 크면, 서수 i인 노드와 인접한 노드 j간의 백 에지(back edge)를 생성하고(216), 상기 백 에지(back edge)에 대한 더미노드(dummy node) 및 더미에지(dummy edge)를생성한 후(217), 상기 서수 i인 노드에 인접한 노드 j에 방문했는가를 판단하는 과정(209)을 수행한다.As a result of the determination 215, if the level of the node of ordinal i is greater than the level of adjacent node j, a back edge is generated between the node of ordinal i and the adjacent node j (216), and the back edge After generating a dummy node and a dummy edge for the node (217), a process (209) is performed to determine whether a visit is made to the node j adjacent to the ordinal node i.
상기 판단결과(215), 서수 i인 노드의 레벨이 인접한 노드 j의 레벨보다 크지 않으면, 서수 i인 노드와 인접한 노드 j간의 트리 에지(tree edge)를 생성 및 노드 j의 조상 노드들 간의 포워드 에지(forward edge)를 생성하고(218), 서수 i인 노드의 인접한 노드 j의 레벨에 1을 더하여 레벨을 수정하며(219), 상기 포워드 에지(forward edge)에 대해 더미노드(dummy node) 및 더미에지(dummy edge)를 생성한 후(220), 상기 서수 i인 노드에 인접한 노드 j에 방문했는가를 판단하는 과정(209)을 수행한다.In the determination result 215, if the level of the ordinal node is not greater than the level of the adjacent node j, a tree edge is generated between the ordinal node i and the adjacent node j and the forward edge between the ancestor nodes of the node j. generate a forward edge (218), modify the level by adding 1 to the level of adjacent node j of the ordinal node i (219), and add a dummy node and a dummy node to the forward edge. After generating a dummy edge (220), a process (209) is performed to determine whether a visit has been made to a node j adjacent to the ordinal node i.
첨부된 도 4 및 도 5 는 고품질의 판독성 및 추적성을 제공하기 위하여 간선들간의 교차점을 줄여 각 레벨 상에서 모든 노드들의 순서를 결정하는 과정으로, 위-무게중심 및 아래-무게중심이 활용되고, 그 절차순서는 도 3 과 도 4 를 수행한 후, 다시 한번 도 3 을 반복 수행한다.4 and 5 are a process of determining the order of all nodes on each level by reducing intersections between edges in order to provide high quality readability and traceability, wherein up-weight center and down-weight center are utilized. The procedure is carried out after repeating Figure 3 and 4, and then repeating Figure 3.
첨부된 도 4 는 상기 도 2 에서 콜 그래프 레이아웃의 위-무게중심 순서를 결정하는 서브루틴에 대한 일실시예 상세 흐름도이다.4 is a detailed flowchart of an embodiment of a subroutine for determining the above-weighted order of the call graph layout in FIG. 2.
먼저, 계층적으로 배치된 n개의 레벨을 탐색하고(301), 첫 번째 레벨의 서수 i를 '0'으로 초기화시킨 후(302), 상기 서수 i가 탐색된 레벨의 크기인 n보다 작은가를 판단한다(303).First, search n levels arranged hierarchically (301), initialize ordinal i of the first level to '0' (302), and determine whether ordinal i is smaller than n, the size of the searched level. (303).
상기 판단결과(303), 서수 i가 탐색된 레벨의 크기인 n보다 작으면, 서수 i번째 레벨의 노드들을 서수의 오름차순으로 가중치를 부여하고(304), i+1번째 레벨의 각 노드들을 그의 조상들의 가중치 평균으로 위-무게 중심을 다음과 같이 계산한다(305).In the determination result 303, if ordinal i is smaller than n, which is the magnitude of the searched level, the nodes of ordinal i th level are weighted in ascending order of ordinal number 304, and each node of the i + 1 th level is assigned to its node. The center of gravity is calculated as the weighted average of ancestors as follows (305).
각 노드의 위-무게 중심 = 조상들의 가중치의 합/조상들의 수Upper-weight center of each node = sum of weights of ancestors / number of ancestors
서수 i+1번째 레벨의 각 노드들을 측정된 가중치에 의해 오름차순으로 정렬하며(306), 서수 i를 1 증가시킨 후(307), 다음 레벨의 방문을 위해 상기 i가 n보다 작은가를 판단하는 과정(303)을 수행한다.Sorting the nodes of ordinal i + 1th level in ascending order by the measured weight (306), increasing ordinal i by 1 (307), and determining whether i is less than n for the next level visit Perform 303.
상기 판단결과(303), 서수 i가 탐색된 레벨의 크기인 n보다 크거나 같으면, 반환된다.The determination result 303 returns if ordinal i is greater than or equal to n, which is the magnitude of the searched level.
첨부된 도 5 는 상기 도 2 에서 콜 그래프 레이아웃의 아래-무게중심 순서를 결정하는 서브루틴에 대한 일실시예 상세 흐름도이다.FIG. 5 is a detailed flowchart of an exemplary embodiment of a subroutine for determining the down-weight centering order of the call graph layout in FIG. 2.
먼저, 계층적으로 배치된 n개의 레벨을 탐색하고(401), 마지막 레벨의 서수를 n으로 초기화한 후(402), 마지막 레벨의 서수 i가 탐색된 레벨의 크기인 '0'보다 큰가를 판단한다(403).First, search for n levels arranged hierarchically (401), initialize the ordinal of the last level to n (402), and determine whether ordinal i of the last level is greater than '0', the size of the searched level. (403).
상기 판단결과(403), 마지막 레벨의 서수 i가 탐색된 레벨의 크기인 '0'보다 크면, 마지막 레벨의 서수 i번째 레벨의 노드들을 서수의 오름차순으로 가중치를 부여하고(404), 서수 i-1번째 레벨의 각 노드들을 그의 후손들의 가중치 평균으로 아래-무게중심을 다음과 같이 계산한다(405).In the determination result 403, if ordinal i of the last level is greater than '0' which is the size of the searched level, the nodes of ordinal i th level of the last level are weighted in ascending ordinal order (404), and ordinal i- Each node of the first level is computed as below-weight center as the weighted average of its descendants as follows (405).
각 노드의 아래-무게 중심 = 후손들의 가중치의 합/후손들의 수Bottom-weight center of each node = sum of weights of descendants / number of descendants
서수 i-1번째 레벨의 각 노드들을 측정된 가중치에 의해 오름차순으로 정렬한 후(406), i를 1 감소시키고(407), 상기 i가 '0'보다 큰가를 판단하는 과정(403)을 수행한다.After arranging each node of the ordinal i-1 level in ascending order by the measured weight (406), i is decreased by 1 (407), and it is determined whether i is greater than '0' (403). do.
상기 판단결과(403), 마지막 레벨의 서수 i가 탐색된 레벨의 크기인 '0'보다 작거나 같으면, 반환된다.The determination result 403 returns if the ordinal i of the last level is less than or equal to '0' which is the size of the searched level.
첨부된 도 6 내지 도 8 은 위치 알고리즘의 단계들로서 레벨들간의 간격 및 노드들 간의 간격의 옵셋을 위한 휴리스틱(heuristic)한 과정이다.6 to 8 are heuristic processes for offsetting the spacing between levels and the spacing between nodes as steps of a location algorithm.
도 6 은 상기 도 2 에서 콜 그래프 레이아웃의 위-무게중심 위치를 결정하는 서브루틴에 대한 일실시예 상세 흐름도이다.FIG. 6 is a detailed flowchart of an exemplary embodiment of a subroutine for determining a position of the center of gravity of the call graph layout in FIG. 2.
먼저, 각 레벨에서 노드들의 순서가 결정된 n개의 레벨을 탐색하고(501), 첫 번째 레벨의 서수 i를 '0' 으로 초기화한 후(502), 서수 i가 탐색된 레벨의 크기인 n보다 작은가를 판단한다(503).First, search for n levels in which the order of nodes in each level is determined (501), initialize the ordinal i of the first level to '0' (502), and then ordinal i is less than n, the size of the searched level. Determine (503).
상기 판단결과(503), i가 n보다 작으면, 서수 i번째 레벨의 노드들을 서수의 오름차순으로 가중치를 부여하고(504), i+1번째 레벨의 노드들을 서수의 오름차순으로 가중치를 부여한 후, 위-무게중심 방법으로 노드의 위치를 계산하기 위해 m개의 노드를 방문하고(505), 첫 번째 노드의 서수 j를 '0'으로 초기화한 후(506), 서수 j가 i+1번째 레벨의 노드 총 수인 m보다 작은가를 판단한다(507).In the determination result 503, if i is less than n, the nodes of ordinal i th level are weighted in ascending ordinal order (504), and the nodes of i + 1 th level are weighted in ascending ordinal order, After visiting m nodes to compute the position of the node in the above-weighted method (505), initializing ordinal j of the first node to '0' (506), ordinal j is the i + 1th level It is determined whether the number of nodes is less than m (507).
상기 판단결과(503), i가 n보다 크거나 같으면, 반환된다.If i is greater than or equal to n, the determination result 503 is returned.
상기 판단결과(507), j가 m보다 작으면, j노드의 위-무게 중심을 다음과 같이 계산하고, 측정된 j노드의 가중치를 저장한다(509).In the determination result 507, if j is less than m, the above-weight center of the j node is calculated as follows, and the weight of the measured j node is stored (509).
각 노드의 위-무게중심 = 조상들의 가중치의 합/조상들의 수Center of gravity of each node = sum of weights of ancestors / number of ancestors
그리고, j노드의 가중치가 다음 노드인 j+1노드의 가중치보다 큰가를 판단한다(510).In operation 510, it is determined whether the weight of the j node is greater than the weight of the j + 1 node, which is the next node.
상기 판단결과(507), j가 m보다 크거나 같으면, i를 1증가시킨 후, 다음 레벨의 방문을 위하여 상기 i가 n보다 작은가를 판단하는 과정(503)을 수행한다.In the determination result 507, if j is greater than or equal to m, i is increased by 1, and then a process 503 of determining whether i is less than n is performed for the next level of visit.
상기 판단결과(510), j노드의 가중치가 j+1노드의 가중치보다 크면, j+1 노드로부터 마지막 노드인 m-1 노드까지, 각각에 부여된 가중치에 순차적으로 j노드의 가중치+1을 더하여 각 노드들의 가중치를 수정하여 저장하고(511), j를 1증가시킨 후(512), 다음 노드의 방문을 위하여 상기 j가 m보다 작은가를 판단하는 과정(507)을 수행한다.In the determination result 510, if the weight of j node is greater than the weight of j + 1 node, the weight of j node +1 is sequentially added to the weights assigned to each node from the j + 1 node to the last node m-1. In addition, after modifying and storing the weights of the nodes (511), increasing j by 1 (512), and determining whether j is less than m for a visit of the next node (507).
상기 판단결과(510), j노드의 가중치가 j+1노드의 가중치보다 작거나 같으면, 상기 j를 1 증가시키는 과정(512)을 수행한다.As a result of the determination 510, if the weight of the j node is less than or equal to the weight of the j + 1 node, the process of increasing j by 1 is performed 512.
첨부된 도 7 은 상기 도 2 에서 콜 그래프 레이아웃의 아래-무게중심 위치를 결정하는 서브루틴에 대한 일실시예 상세 흐름도이다.FIG. 7 is a detailed flowchart illustrating an embodiment of a subroutine for determining a bottom-weighted position of the call graph layout in FIG. 2.
먼저, 위-무게중심에 의해 재배치된 n개의 레벨을 탐색하고(601), 마지막 레벨의 서수인 i를 n으로 초기화한 후(602), 서수 i가 마지막 레벨의 크기인 '0'보다 큰 가를 판단한다(603).First, we search for n levels rearranged by the above-weight centers (601), initialize the last ordinal i to n (602), and then determine whether ordinal i is greater than the last level '0'. Determine (603).
상기 판단결과(603), i가 0보다 크면, 서수 i-1번째 레벨에 있는 노드들의 위치를 아래-무게중심 방법으로 계산하기 위해 m개의 노드를 방문하고(604), 첫 번째 방문한 노드의 서수 j를 '0'으로 초기화한 후(605), j가 m보다 작은가를 판단하고(606), i가 0보다 작거나 같으면, 반환된다.In the determination result 603, if i is greater than 0, m nodes are visited (604) to calculate the position of nodes in the ordinal i-1 th level by the below-weighted method (604), and the ordinal number of the first visited node After initializing j to '0' (605), it is determined whether j is less than m (606), and if i is less than or equal to 0, it is returned.
상기 판단결과(606), j가 m보다 작으면, j노드의 아래-무게중심을 다음과 같이 계산하고, 측정된 가중치에 의해 j노드의 가중치를 저장한다(608).In the determination result 606, if j is smaller than m, the bottom-weight center of the j node is calculated as follows, and the weight of the j node is stored according to the measured weight (608).
각 노드의 아래-무게중심 = 후손들의 가중치의 합/후손들의 수Down-weight center of each node = sum of weights of descendants / number of descendants
그리고, j노드의 가중치가 j+1노드의 가중치보다 큰가를 판단하여(609), j노드의 가중치가 j+1노드의 가중치보다 크면, j+1노드로부터 마지막 노드인 m-1노드까지, 각각에 부여된 가중치에 순차적으로 j노드의 가중치+1을 더하여 각 노드들의 가중치를 수정하여 저장하고(610), 다음 노드의 방문을 위하여 j를 1증가시킨 후(611), 상기 j가 m보다 작은가를 판단하는 과정(606)을 수행하고, j노드의 가중치가 j+1노드의 가중보다 작거나 같으면, 상기 j를 1 증가시키는 과정(611)을 수행한 후, 다음 노드의 방문을 위하여 상기 j가 m보다 작은가를 판단하는 과정(606)을 수행한다.If the weight of j node is greater than the weight of j + 1 node (609), if the weight of j node is greater than the weight of j + 1 node, from node j-1 to node m-1, which is the last node, The weight of each node is sequentially added to the weights assigned to each node, and the weights of the nodes are modified and stored (610), and j is increased by 1 for the next node visit (611), where j is greater than m. If the weight of the j node is less than or equal to the weight of the j + 1 node, the process of increasing j by 1 is performed (611), and then the next node is visited. A process 606 of determining whether j is less than m is performed.
상기 판단결과(606), j가 m보다 크거나 같으면, 다음 레벨의 방문을 위하여 i를 1 증가시킨 후(607), 상기 i가 0보다 큰가를 판단하는 과정(603)을 수행한다.If j is greater than or equal to m, the determination result 606 increases i by 1 for a next level visit (607), and determines whether i is greater than 0 (603).
첨부된 도 8 은 상기 도 2 에서 콜 그래프 레이아웃의 위-래티스-무게중심 위치를 결정하는 서브루틴에 대한 일실시예 상세 흐름도로서, 래티스 구조(자신의 조상이 둘 이상인 노드만을 찾아 균형된 레이아웃을 생성하기 위한 과정이다.8 is a detailed flowchart of a subroutine for determining the up-lattice-weighted position of the call graph layout in FIG. 2, wherein the lattice structure (only a node having two or more ancestors of its own is found in a balanced layout). It is a process to generate.
먼저, 아래-무게중심에 의해 재배치된 n개의 레벨을 탐색하고(701), 두 번째 레벨의 서수 i를 1로 초기화한 후(702), 서수 i가 탐색된 레벨의 크기인 n보다 작은가를 판단한다(703).First, search for n levels relocated by the down-weight center (701), initialize ordinal i of the second level to 1 (702), and determine whether ordinal i is less than n, the magnitude of the searched level. (703).
상기 판단결과(703), 서수 i가 탐색된 레벨의 크기인 n보다 작으면, 서수 i번째 레벨의 래티스 구조의 노드들을 탐색하여 위-래티스-무게중심 방법으로 노드의 위치를 계산하기 위하여 노드의 총 수인 m개의 노드를 방문하고(704), 첫 번째 노드의 서수 j를 0으로 초기화한 후(705), 서수 j가 i번째 레벨의 노드 총 수인 m보다 작은가를 판단하고(706), 상기 판단결과(703), 서수 i가 탐색된 레벨의 크기인 n보다 크거나 같으면, 반환된다.In the determination result 703, if ordinal i is smaller than n, which is the size of the searched level, nodes of the lattice structure of ordinal i th level are searched to calculate the position of the node in the above-lattice-weighted method. After visiting m nodes of the total number (704), initializing the ordinal j of the first node to 0 (705), determining whether ordinal j is less than m, the total number of nodes of the i th level (706), and determining If the result 703, ordinal i, is greater than or equal to n, the magnitude of the level searched, it is returned.
상기 판단결과(706), 서수 j가 i번째 레벨의 노드 총 수인 m보다 크거나 같으면, 서수 i의 값을 1 증가시킨 후(707), 다음 레벨의 방문을 위하여 상기 서수 i가 탐색된 레벨의 크기인 n보다 작은가를 판단하는 과정(703)을 수행하고, 서수 j가 i번째 레벨의 노드 총 수인 m보다 작으면, j 노드에 래티스 구조가 존재하는가를 판단한다(708).As a result of the determination (706), if ordinal j is greater than or equal to m, the total number of nodes of the i-th level, the value of ordinal i is increased by one (707), and then the level of the ordinal i is searched for the next level visit. If the ordinal j is smaller than m, the total number of nodes of the i-th level, it is determined whether a lattice structure exists in the j node (708).
상기 판단결과(708), j 노드에 래티스 구조가 존재하지 않으면, 서수 j를 1 증가시킨 후(712), 다음 노드의 방문을 위하여 상기 서수 j가 i번째 레벨의 노드 총 수인 m보다 작은가를 판단하는 과정(706)을 수행하고, j 노드에 래티스 구조가 존재하면, j노드의 위-래티스-무게중심을 다음과 같이 계산하고, 측정된 가중치에 의해 j노드의 가중치를 저장한다(709).If the lattice structure does not exist in the j node, the determination result 708 increases the ordinal j by 1 (712), and then determines whether the ordinal j is smaller than m, the total number of nodes of the i th level, for the next node to visit. If the lattice structure is present in the j node, the lattice-weight center of the j node is calculated as follows, and the weight of the j node is stored according to the measured weight (709).
각 노드의 위-래티스-무게중심 = 조상들의 가중치의 합/조상들의 수Upper-lattice-weight center of each node = sum of weights of ancestors / number of ancestors
그리고, j노드의 기존 가중치가 j노드의 측정된 가중치보다 작은가를 판단한다(710).In operation 710, it is determined whether the existing weight of the j node is smaller than the measured weight of the j node.
상기 판단결과(710), j노드의 기존 가중치가 j노드의 측정된 가중치보다 작으면, j노드의 모든 후손 노드들을 j의 가중치 차이만큼 더하여 가중치를 수정하고(711), 상기 서수 j를 1 증가시키고(712), 다음 노드의 방문을 위하여 상기 서수 j가 i번째 레벨의 노드 총 수인 m보다 작은가를 판단하는 과정(706)을 수행한다.In the determination result 710, if the existing weight of j node is smaller than the measured weight of j node, the weight is corrected by adding all descendant nodes of j node by the weight difference of j (711), and the ordinal j is increased by one. In operation 712, a process 706 is performed to determine whether ordinal j is smaller than m, the total number of nodes of the i-th level, for the next node to visit.
상기 판단결과(710), j노드의 기존 가중치가 j노드의 측정된 가중치보다 크거나 같으면, 상기 서수 j를 1 증가시키고(712), 다음 노드의 방문을 위하여 서수 j가 i번째 레벨의 노드 총 수인 m보다 작은가를 판단하는 과정(706)을 수행한다.In the determination result 710, if the existing weight of the j node is greater than or equal to the measured weight of the j node, the ordinal j is increased by 1 (712), and the ordinal j is the total number of nodes of the i th level for the visit of the next node. A process 706 of determining whether the number is smaller than m is performed.
첨부된 도 9 및 도 10 은 콜 그래프를 출력하는 과정으로써, 실제 노드와 간선의 X, Y의 좌표를 결정하여 계층적 방향 그래프인 콜 그래프를 자동 생성하는 과정이다.9 and 10 are a process of outputting a call graph, which is a process of automatically generating a call graph which is a hierarchical direction graph by determining coordinates of X and Y of a real node and an edge.
도 9 는 상기 도 2 에서 콜 그래프 레이아웃의 노드 X, Y의 좌표를 생성하는 서브루틴에 대한 일실시예 상세 흐름도이다.FIG. 9 is a detailed flowchart illustrating a subroutine for generating coordinates of nodes X and Y of the call graph layout of FIG. 2.
먼저, 각 레벨에서 노드들의 위치가 결정된 n개의 레벨을 탐색하고(801), 첫 번째 레벨의 서수 i를 '0'으로 초기화한 후(802), 서수 i가 탐색된 레벨의 크기인 n보다 작은가를 판단한다(803).First, search for n levels at which nodes are located at each level (801), initialize ordinal i of the first level to '0' (802), and then ordinal i is less than n, the size of the level found. Determine (803).
상기 판단결과(803), 서수 i가 탐색된 레벨의 크기인 n보다 작으면, i번째 레벨에 있는 노드들의 위치를 출력하기 위한 좌표로 계산하기 위해 m개의 노드를 방문하고(804), 첫 번째 노드의 서수 j를 '0'으로 초기화한 후(805), 서수 j가 i번째 레벨의 총 수인 m보다 작은가를 판단한다(806).In the determination result 803, if ordinal i is smaller than n, the size of the searched level, m nodes are visited to calculate coordinates for outputting positions of nodes in the i-th level (804), and the first After initializing the ordinal j of the node to '0' (805), it is determined whether the ordinal j is smaller than m, which is the total number of the i-th level (806).
상기 판단결과(803), 서수 i가 탐색된 레벨의 크기인 n보다 크거나 같으면, 리턴된다.As a result of the determination 803, if ordinal i is greater than or equal to n, which is the magnitude of the searched level, it is returned.
상기 판단결과(803), 서수 j가 i번째 레벨의 총 수인 m보다 크거나 같으면,서수 i를 1 감소시킨 후(807), 다음 상기 서수 i가 탐색된 레벨의 크기인 n보다 작은가를 판단하는 과정(803)을 수행한다.In the determination result 803, if ordinal j is greater than or equal to m, which is the total number of i-th levels, the ordinal i is decreased by 1 (807), and then it is determined whether ordinal i is smaller than n, the size of the searched level. Perform process 803.
상기 판단결과(803), 서수 j가 i번째 레벨의 총 수인 m보다 작으면, 서수 j가 모조노드인가를 판단하여(808), j가 모조노드이면, j 모조노드를 절대적인 간선의 교차점으로 변형하기 위해 삭제하고, 그 교차점은 레벨들 및 노드들 간의 옵셋에 따라 X, Y좌표를 계산한 후(809), j를 1 증가시키고(812), 다음 노드의 방문을 위하여 상기 j가 m보다 작은가를 판단하는 과정(803)을 수행하며, j가 모조노드가 아니면, 노드들 간의 간격 옵셋에 의해 j노드 X좌표와 폭 위치를 계산하고(810), 레벨들 간의 간격 옵셋에 의해 j노드의 Y좌표와 높이 위치를 계산한 후(811), j를 1 증가시킨다(812).In the determination result 803, if ordinal j is less than m, which is the total number of i-th levels, it is determined whether ordinal j is a pseudo node (808), and if j is a pseudo node, the j pseudo node is transformed into an intersection point of an absolute edge. And the intersection is calculated by calculating the X and Y coordinates according to the offsets between the levels and the nodes (809), then increasing j by 1 (812), and is j less than m for the next node visit? In operation 803, if j is not the parent node, the j node X coordinate and the width position are calculated by the gap offset between the nodes (810), and the Y node of the j node by the gap offset between the levels. After calculating the coordinates and the height position (811), j is increased by 1 (812).
첨부된 도 10 은 상기 도 2 에서 콜 그래프 레이아웃의 간선 X, Y의 좌표를 생성하는 서브루틴에 대한 일실시예 상세 흐름도로서, 방향그래프 레이아웃의 간선 X, Y좌표 생성흐름도로서, 모든 간선들의 실제 X, Y의 좌표를 생성하여 콜 그래프를 모니터(10) 또는 프린터(11)에 출력하기 위한 과정이다.10 is a detailed flowchart illustrating a subroutine for generating the coordinates of the edges X and Y of the call graph layout in FIG. 2, and shows the flow chart of the edges X and Y coordinates of the direction graph layout. This is a process for outputting a call graph to the monitor 10 or the printer 11 by generating coordinates of X and Y.
먼저, n개의 레벨에서 간선들이 있는 n-1 개의 레벨 쌍을 탐색하고(901), 첫 번째 레벨의 서수 i를 1로 초기화한 후(902), 첫 번째 레벨의 서수 i가 탐색된 레벨의 크기인 n-1보다 작은가를 판단한다(903).First, n-1 level pairs with edges at n levels are searched (901), the ordinal i of the first level is initialized to 1 (902), and then the magnitude of the level at which the ordinal i of the first level is searched. It is determined whether is smaller than n-1 (903).
상기 판단결과(903), 첫 번째 레벨의 서수 i가 탐색된 레벨의 크기인 n-1보다 크거나 같으면, 반환되고, 첫 번째 레벨의 서수 i가 탐색된 레벨의 크기인 n-1보다 작으면, i번째 레벨과 i+1번째 레벨 사이에 있는 간선들의 위치를 출력하기위한 좌표로 계산하기 위해 m개의 간선을 방문하고(904), 첫 번째 노드의 서수 j를 '0'으로 초기화한다(905).In the determination result 903, if the ordinal i of the first level is greater than or equal to n-1, which is the size of the searched level, is returned, and if the ordinal i of the first level is less than n-1, the size of the searched level, In order to calculate coordinates for outputting positions of edges between the i th level and the i + 1 th level, m edges are visited (904), and the ordinal j of the first node is initialized to '0' (905). ).
그리고, 상기 서수 j가 i번째 레벨의 노드 총 수인 m보다 작은가를 판단하여(906), 서수 j가 i번째 레벨의 노드 총 수인 m보다 크거나 같으면, 상기 첫 번째 레벨의 서수 i를 1 감소시킨 후(907), 상기 첫 번째 레벨의 서수 i가 탐색된 레벨의 크기인 n-1보다 작은가를 판단하는 과정(903)을 수행하고, 첫 번째 노드의 서수 j가 i번째 레벨의 노드 총 수인 m보다 작으면, 서수 j의 간선이 모조간선인가를 판단한다(908).Then, it is determined whether ordinal j is smaller than m, the total number of nodes of the i th level (906), and if ordinal j is greater than or equal to m, the total number of nodes of the i th level, the ordinal i of the first level is reduced by one. Thereafter, in operation 907, a process 903 of determining whether ordinal i of the first level is smaller than n-1, which is the size of the searched level, is performed, and ordinal j of the first node m is the total number of nodes of the i th level. If smaller, it is determined whether the trunk of ordinal j is a dummy trunk (908).
상기 판단결과(908), 서수 j의 간선이 모조간선이면, 서수 j의 모조간선은 절대적인 간선으로 교체되고(909), i번째 레벨에서 노드의 X좌표와 폭 위치에 의해, 노드 j 간선의 X 좌표를 계산하고, 노드의 Y 좌표와 높이위치에 의해 노드 j 간선의 Y좌표를 계산한 후(910), i+1번째 레벨에서 노드의 X 좌표와 폭 위치에 의해 j 간선의 X 좌표를 계산하고, 노드의 Y 좌표와 높이 위치에 의해 j간선의 Y 좌표를 계산한 후(911), 서수 j를 1 증가시키고(912), 다음노드의 방문을 위하여 상기 j가 m보다 작은가를 판단하는 과정(906)을 수행한다.In the determination result 908, if the trunk of ordinal j is a dummy trunk, the dummy trunk of ordinal j is replaced with an absolute trunk (909), and the X coordinate of the node j trunk is determined by the X coordinate and the width position of the node at the i th level. Calculate the coordinates, calculate the Y coordinate of the node j edge by the node's Y coordinate and the height position (910), and then calculate the X coordinate of the j edge by the node's X coordinate and the width position at the i + 1th level. After calculating the Y coordinate of the j trunk by the Y coordinate and the height position of the node (911), the ordinal j is increased by 1 (912), and determining whether j is less than m for the next node to visit. Perform 906.
상기 판단결과(908), 서수 j의 간선이 모조간선이 아니면, 상기 i번째 레벨에서 노드의 X 좌표와 폭 위치에 의해 j간선의 X 좌표를 계산하고, 노드의 Y 좌표와 높이 위치에 의해 서수 j 간선의 Y 좌표를 계산하는 과정(910)을 수행한다.In the determination result 908, if the edge of ordinal j is not a dummy trunk, the X coordinate of the j edge is calculated based on the X coordinate and the width position of the node at the i th level, and the ordinal number is determined by the Y coordinate and the height position of the node. A process 910 of calculating the Y coordinate of the j edge is performed.
이상에서 설명한 본 발명은, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 있어 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 여러 가지 치환, 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 한정되는 것이 아니다.The present invention described above is capable of various substitutions, modifications, and changes without departing from the spirit of the present invention for those skilled in the art to which the present invention pertains. It is not limited to the drawing.
상기와 같은 본 발명은, 계층적으로 판독성 및 추적성이 용이한 고품질의 콜 그래프를 통해 프로그램 유지 보수자에게 소스 프로그램 구조의 이해 및 분석정보를 용이하게 제공하고, 각 함수 호출정보를 이용하여 프로그램 복잡도 및 구조도 등의 측정정보를 제공함으로써 유지보수 되어야 할 소스코드를 분석하는데 용이하게 사용되므로써, 프로그램의 유지보수 작업에 필요한 시간과 노력 및 비용을 최소화할 수 있으며, 다양한 형태를 갖는 콜 그래프를 자동 생성할 수 있는 효과가 있다.As described above, the present invention provides a program maintainer with an easy-to-read and traceable high-quality call graph to easily provide the program maintainer with the understanding and analysis of the source program structure, and using each function call information. By providing measurement information such as complexity and structure diagram, it is easily used to analyze the source code to be maintained, thereby minimizing the time, effort, and cost required for the maintenance work of the program. There is an effect that can be automatically generated.
Claims (3)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020000002769A KR100333670B1 (en) | 2000-01-21 | 2000-01-21 | Method for automatic generating call graph for software maintenance |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020000002769A KR100333670B1 (en) | 2000-01-21 | 2000-01-21 | Method for automatic generating call graph for software maintenance |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| KR20010075872A true KR20010075872A (en) | 2001-08-11 |
| KR100333670B1 KR100333670B1 (en) | 2002-04-22 |
Family
ID=19640197
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| KR1020000002769A Expired - Fee Related KR100333670B1 (en) | 2000-01-21 | 2000-01-21 | Method for automatic generating call graph for software maintenance |
Country Status (1)
| Country | Link |
|---|---|
| KR (1) | KR100333670B1 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101016755B1 (en) * | 2008-07-18 | 2011-02-25 | 한국과학기술원 | How to create a list of functions related to a specific function |
| WO2014101585A1 (en) * | 2012-12-24 | 2014-07-03 | Tencent Technology (Shenzhen) Company Limited | Systems and methods for generating function-relation call trees |
| US8990792B2 (en) | 2008-05-26 | 2015-03-24 | Samsung Electronics Co., Ltd. | Method for constructing dynamic call graph of application |
-
2000
- 2000-01-21 KR KR1020000002769A patent/KR100333670B1/en not_active Expired - Fee Related
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8990792B2 (en) | 2008-05-26 | 2015-03-24 | Samsung Electronics Co., Ltd. | Method for constructing dynamic call graph of application |
| KR101016755B1 (en) * | 2008-07-18 | 2011-02-25 | 한국과학기술원 | How to create a list of functions related to a specific function |
| WO2014101585A1 (en) * | 2012-12-24 | 2014-07-03 | Tencent Technology (Shenzhen) Company Limited | Systems and methods for generating function-relation call trees |
Also Published As
| Publication number | Publication date |
|---|---|
| KR100333670B1 (en) | 2002-04-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Weinzierl et al. | Peano—a traversal and storage scheme for octree-like adaptive Cartesian multiscale grids | |
| US7167817B2 (en) | Automated approach to resolving artificial algebraic loops | |
| US8667462B1 (en) | Model and subsystem function signatures | |
| Balasa et al. | Background memory area estimation for multidimensional signal processing systems | |
| Kirner et al. | Transformation of path information for WCET analysis during compilation | |
| KR102013582B1 (en) | Apparatus and method for detecting error and determining corresponding position in source code of mixed mode application program source code thereof | |
| US6519742B1 (en) | Local naming for HDL compilation | |
| Mårdberg et al. | Using a formal high-level language and an automated manikin to automatically generate assembly instructions | |
| WO1999023555A1 (en) | Method for the generation of isa simulators and assemblers from a machine description | |
| Del Castillo | The ASM Workbench: A Tool Environment for Computer-Aided Analysis and Validation of Abstract State Machine Models: Tool Demonstration | |
| US7111278B1 (en) | Automated translation of a microprocessor opcode summary table to an architecture description language | |
| KR100333636B1 (en) | Method for automatic generating control flow graph for software maintenance | |
| KR100333670B1 (en) | Method for automatic generating call graph for software maintenance | |
| Pelupessy et al. | The oceanographic multipurpose software environment (OMUSE v1. 0) | |
| US6282694B1 (en) | IC design floorplan generation using ceiling and floor contours on an O-tree structure | |
| Woodbury et al. | Code checking by representation comparison | |
| KR20030018722A (en) | Method for automatic generating data flow graph for software maintenance | |
| Vangheluwe et al. | DOMAIN-SPECIFIC MODELLING WITH ATOM | |
| Von Pilgrim | Mental map and model driven development | |
| Essawy et al. | Elemental graph data model: a semantic and topological representation of building elements | |
| Parsons et al. | Generating parallel programs from skeleton based specifications | |
| KR20030018721A (en) | Method for automatic generating structure chart for software maintenance | |
| Hekmatpour et al. | Hierarchical modeling of the VLSI design process | |
| Barbier et al. | Automatic generation of shape functions for finite element analysis using REDUCE | |
| Cyre et al. | Knowledge visualization from conceptual structures |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A201 | Request for examination | ||
| PA0109 | Patent application |
St.27 status event code: A-0-1-A10-A12-nap-PA0109 |
|
| PA0201 | Request for examination |
St.27 status event code: A-1-2-D10-D11-exm-PA0201 |
|
| R17-X000 | Change to representative recorded |
St.27 status event code: A-3-3-R10-R17-oth-X000 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-3-3-R10-R13-asn-PN2301 St.27 status event code: A-3-3-R10-R11-asn-PN2301 |
|
| PG1501 | Laying open of application |
St.27 status event code: A-1-1-Q10-Q12-nap-PG1501 |
|
| E902 | Notification of reason for refusal | ||
| PE0902 | Notice of grounds for rejection |
St.27 status event code: A-1-2-D10-D21-exm-PE0902 |
|
| P11-X000 | Amendment of application requested |
St.27 status event code: A-2-2-P10-P11-nap-X000 |
|
| P13-X000 | Application amended |
St.27 status event code: A-2-2-P10-P13-nap-X000 |
|
| E701 | Decision to grant or registration of patent right | ||
| PE0701 | Decision of registration |
St.27 status event code: A-1-2-D10-D22-exm-PE0701 |
|
| GRNT | Written decision to grant | ||
| PR0701 | Registration of establishment |
St.27 status event code: A-2-4-F10-F11-exm-PR0701 |
|
| PR1002 | Payment of registration fee |
St.27 status event code: A-2-2-U10-U11-oth-PR1002 Fee payment year number: 1 |
|
| PG1601 | Publication of registration |
St.27 status event code: A-4-4-Q10-Q13-nap-PG1601 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-5-5-R10-R13-asn-PN2301 St.27 status event code: A-5-5-R10-R11-asn-PN2301 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 4 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 5 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 6 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 7 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 8 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-5-5-R10-R13-asn-PN2301 St.27 status event code: A-5-5-R10-R11-asn-PN2301 |
|
| FPAY | Annual fee payment |
Payment date: 20100401 Year of fee payment: 9 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 9 |
|
| LAPS | Lapse due to unpaid annual fee | ||
| PC1903 | Unpaid annual fee |
St.27 status event code: A-4-4-U10-U13-oth-PC1903 Not in force date: 20110411 Payment event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE |
|
| PC1903 | Unpaid annual fee |
St.27 status event code: N-4-6-H10-H13-oth-PC1903 Ip right cessation event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE Not in force date: 20110411 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-5-5-R10-R13-asn-PN2301 St.27 status event code: A-5-5-R10-R11-asn-PN2301 |
|
| P22-X000 | Classification modified |
St.27 status event code: A-4-4-P10-P22-nap-X000 |