JP7799580B2 - Source code analysis device, source code analysis method, and source code analysis program - Google Patents
Source code analysis device, source code analysis method, and source code analysis programInfo
- Publication number
- JP7799580B2 JP7799580B2 JP2022132550A JP2022132550A JP7799580B2 JP 7799580 B2 JP7799580 B2 JP 7799580B2 JP 2022132550 A JP2022132550 A JP 2022132550A JP 2022132550 A JP2022132550 A JP 2022132550A JP 7799580 B2 JP7799580 B2 JP 7799580B2
- Authority
- JP
- Japan
- Prior art keywords
- source code
- program
- list
- path
- division
- 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.)
- Active
Links
Landscapes
- Stored Programmes (AREA)
Description
本発明は、ソースコード解析装置、ソースコード解析方法およびソースコード解析プログラムに関する。 The present invention relates to a source code analysis device, a source code analysis method, and a source code analysis program.
近年のソフトウェアの派生開発において、機能の拡張や変更が長年に渡って繰り返し行われることにより、ソフトウェアが複雑化している。ソフトウェアが複雑になると、ソースコードの可読性の低下を引き起こす。このような状況を解決するために、リファクタリングが行われている。リファクタリングとは、ソフトウェアの振る舞いを変化させず、その内部構造を変更することを意味する。メソッド、クラス、ファイルなどのプログラムの構成要素(以下、プログラム要素と呼ぶ)のうち、保守性が低いものを適切にリファクタリングすることで、ソフトウェアの複雑さを解消しやすくなる。 In recent years, software has become increasingly complex due to repeated functional expansions and changes over many years of derivative development. Software complexity can lead to a decrease in source code readability. Refactoring is used to resolve this situation. Refactoring means changing the internal structure of software without changing its behavior. By appropriately refactoring program components such as methods, classes, and files (hereafter referred to as program elements) that are difficult to maintain, software complexity can be more easily reduced.
リファクタリング手法の1つに要素分割がある。関数やメソッドで記述された複雑な処理をより細かい単位での処理に分け、他の独立した関数・メソッドに分けるという手法である。要素分割によって、複雑で長く読みにくいソースコードを、簡素で短く可読性の高いソースコードに細分化することができる。これにより、単体テストのテストケース作成、ソースコードの改修もしくは変更、または保守に係る工数を削減し、ソフトウェアの保守性を向上させることができる。 One refactoring technique is element splitting. This is a technique in which complex processing written in functions or methods is broken down into smaller units of processing, and then separated into other independent functions or methods. Element splitting makes it possible to break down complex, long, and difficult-to-read source code into simpler, shorter, and more readable source code. This reduces the amount of work required to create unit test cases, modify or change source code, or perform maintenance, and improves the maintainability of the software.
特許文献1には、ソースコードとモジュール分割ルールデータを基に、各モジュールの分割すべき箇所を提示する手法が記載されている。これにより、複雑なソースコードから、分割すべき箇所を特定することができる。 Patent Document 1 describes a method for suggesting where each module should be divided based on source code and module division rule data. This makes it possible to identify where division should be performed from complex source code.
特許文献1の手法では、ソースコードとモジュール分割ルールデータを基に、プログラムが分割すべき箇所に該当するかどうかを判定し、該当する場合には、そのソースコードの箇所を提示する。 The technique in Patent Document 1 uses source code and module division rule data to determine whether a program corresponds to a location that should be divided, and if so, presents the source code location.
しかし、提示される分割の箇所は、ソースコードをプログラム解析して得られるプログラム要素の特徴量(以下、ソースコードメトリクスと呼ぶ)などを用いたソースコードの保守性の評価がなされていない。したがって、特許文献1の手法では、分割を行った場合に、ソースコードの保守性が低下してしまう場合があると考えられる。 However, the presented division points are not evaluated for source code maintainability using features of program elements obtained by program analysis of the source code (hereinafter referred to as source code metrics). Therefore, it is thought that the method of Patent Document 1 may result in a decrease in source code maintainability when division is performed.
また、開発現場の開発者にとってのソースコードの可読性の維持のため、あるプログラム要素内の既存処理について、他の要素へと分割したくないというニーズ(以下、開発者可読性ニーズと呼ぶ)がある。例えば、開発の慣習でソースコード上では条件分岐文を用いているが、実際の処理はシーケンシャルな処理である部分が存在しており、開発者としては、その部分は1つの関数内で記述し、1つの関数として把握したいという場合である。このような開発者可読性ニーズに対応するためには、開発者にとって分割してほしくない部分は分割せずに、その他の部分のプログラム要素を要素分割する必要がある。開発者可読性ニーズに応えながら要素分割を行うためには、特許文献1の手法では、何度もモジュール分割ルールデータを変更し、開発現場の開発者が納得するまでソースコード解析を繰り返し行う必要がある。このような繰り返し作業は煩雑であり、工数も多く必要となる。 Furthermore, to maintain the readability of source code for developers in the development field, there is a need to avoid splitting existing processing within a certain program element into other elements (hereinafter referred to as developer readability needs). For example, a development practice may be to use conditional branch statements in the source code, but there may be a section where the actual processing is sequential, and the developer would like to describe that section within a single function and understand it as a single function. To meet these developer readability needs, it is necessary to leave the sections that developers do not want split unsplit and split the remaining program elements into elements. In order to split elements while meeting developer readability needs, the method described in Patent Document 1 requires multiple changes to module splitting rule data and repeated source code analysis until the developer in the development field is satisfied. This repetitive work is cumbersome and requires a lot of man-hours.
また、ソースコードの保守性の向上と、開発者可読性とは、どちらも開発にとって重要であるが、しばしばトレードオフの関係になる。ソースコード保守性の向上のため、プログラム要素の要素分割を行いすぎると、開発者可読性ニーズに応えられない場合がある。一方で、開発者可読性ニーズに全て応えようとすると、プログラム要素の要素分割を適切に行えず、ソースコード保守性の低下を招いてしまう場合がある。 Furthermore, while improving source code maintainability and developer readability are both important for development, there is often a trade-off between them. If program elements are divided too much in order to improve source code maintainability, developer readability needs may not be met. On the other hand, if an attempt is made to meet all developer readability needs, program elements may not be divided appropriately, which may result in a decrease in source code maintainability.
そこで、本開示においては、開発者可読性ニーズは、実際のプログラムで頻繁に実行される、まとまった処理の部分にあると考え、頻繁にプログラムで実行される部分を要素分割しない部分として残して開発者可読性ニーズに応えながら、一方でソースコードメトリクスを用いてソースコードの保守性の評価を行うことで、ソースコード保守性向上のためにプログラム要素の要素分割すべき箇所を提示する。 In this disclosure, we believe that developer readability needs lie in the parts of a program that are frequently executed and that are organized into processes. We address developer readability needs by leaving the parts that are frequently executed in the program as parts that are not split into elements, while at the same time evaluating the maintainability of the source code using source code metrics to indicate where program elements should be split into elements to improve source code maintainability.
この場合、プログラム要素の単位は、ある長さを持ったソースコードの部分であれば、どのような単位でもよく、例えば、関数の一部、クラス、モジュール、構造体などのいずれであってもよい。 In this case, the unit of program element can be any portion of source code with a certain length, such as part of a function, a class, a module, or a structure.
本開示に含まれるひとつの態様によるソースコード解析装置は、プログラムに対応するソースコードを解析するソースコード解析装置であって、解析対象となる前記ソースコードから、前記プログラムに含まれるプログラム要素それぞれのソースコードメトリクスを計算するソースコードメトリクス計算部と、前記ソースコードメトリクスから前記プログラム要素それぞれの保守性指標を計算する保守性指標計算部と、前記保守性指標と保守性指標閾値とに基づいて、分割の候補とするプログラム要素を記録した分割候補要素リストを生成する分割候補要素生成部と、前記ソースコードと前記プログラムと前記プログラムに対するテストケースとから、前記分割候補要素リストに含まれるプログラム要素のそれぞれについて、前記テストケースに基づいて前記プログラムを実行したときに実行される処理に対応する前記ソースコードの部分である実行パスを記録した動的情報リストを生成するプログラム処理追跡部と、前記動的情報リストと重複閾値とから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記ソースコードの部分のうち、前記テストケースのうち前記動的情報リストに示された前記実行パスに当該部分を含むテストケースの割合が前記重複閾値以上である部分を記録した基本パスリストを生成する基本パス生成部と、前記分割候補要素リストと前記基本パスリストから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記基本パスリストに含まれない部分を記録した分割パスリストを生成する分割パス生成部とを備える。 A source code analysis device according to one aspect of the present disclosure is a source code analysis device that analyzes source code corresponding to a program, and includes: a source code metrics calculation unit that calculates source code metrics for each program element included in the program from the source code to be analyzed; a maintainability index calculation unit that calculates a maintainability index for each program element from the source code metrics; a split candidate element generation unit that generates a split candidate element list recording program elements that are candidates for splitting based on the maintainability index and a maintainability index threshold; and a split candidate element generation unit that generates a split candidate element list recording program elements that are candidates for splitting based on the source code, the program, and test cases for the program, and calculates a split candidate element list corresponding to the test cases for each program element included in the split candidate element list. The program includes a program processing tracing unit that generates a dynamic information list that records execution paths, which are portions of the source code corresponding to the processing that is executed when the program is executed based on the dynamic information list; a basic path generation unit that generates, from the dynamic information list and an overlap threshold, a basic path list that records portions of the source code in each of the program elements included in the splitting candidate element list, where the proportion of test cases that include said portions in the execution paths shown in the dynamic information list is equal to or greater than the overlap threshold; and a split path generation unit that generates, from the splitting candidate element list and the basic path list, a split path list that records portions of each of the program elements included in the splitting candidate element list that are not included in the basic path list.
本開示に含まれるひとつの態様によるソースコードの解析方法は、プロセッサと記憶装置とを備えた装置が実行する、プログラムに対応するソースコードの解析方法であって、解析対象となる前記ソースコードから、前記プログラムに含まれるプログラム要素それぞれのソースコードメトリクスを計算し、前記ソースコードメトリクスから前記プログラム要素のそれぞれの保守性指標を計算し、前記保守性指標と保守性指標閾値とに基づいて、分割の候補とするプログラム要素を記録した分割候補要素リストを生成し、前記ソースコードと前記プログラムと前記プログラムに対するテストケースとから、前記分割候補要素リストに含まれるプログラム要素のそれぞれについて、前記テストケースに基づいて前記プログラムを実行したときに実行される処理に対応する前記ソースコードの部分である実行パスを記録した動的情報リストを生成し、前記動的情報リストと重複閾値とから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記ソースコードの部分のうち、前記テストケースのうち前記動的情報リストに示された前記実行パスに当該部分を含むテストケースの割合が前記重複閾値以上である部分を記録した基本パスリストを生成し、前記分割候補要素リストと前記基本パスリストから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記基本パスリストに含まれない部分を記録した分割パスリストを生成するというものである。 A source code analysis method according to one aspect of the present disclosure is a method for analyzing source code corresponding to a program, executed by an apparatus having a processor and a storage device, which calculates source code metrics for each program element included in the source code to be analyzed from the source code, calculates a maintainability index for each of the program elements from the source code metrics, generates a splitting candidate element list recording program elements that are candidates for splitting based on the maintainability index and a maintainability index threshold, and generates a splitting candidate element list for each program element included in the splitting candidate element list from the source code, the program, and test cases for the program. a dynamic information list that records execution paths that are portions of the source code corresponding to the processing that is executed when the program is executed based on the above; a basic path list that records, from the dynamic information list and an overlap threshold, portions of the source code for each program element included in the splitting candidate element list where the proportion of test cases that include said portions in the execution paths shown in the dynamic information list is equal to or greater than the overlap threshold; and a split path list that records portions of each program element included in the splitting candidate element list that are not included in the basic path list from the splitting candidate element list and the basic path list.
本開示に含まれるひとつの態様によるソースコード解析プログラムは、プログラムに対応するソースコードを解析するソースコード解析プログラムであって、プロセッサと記憶装置とを備えた装置に、解析対象となる前記ソースコードから、前記プログラムに含まれるプログラム要素それぞれのソースコードメトリクスを計算し、前記ソースコードメトリクスから前記プログラム要素のそれぞれの保守性指標を計算し、前記保守性指標と保守性指標閾値とに基づいて、分割の候補とするプログラム要素を記録した分割候補要素リストを生成し、前記ソースコードと前記プログラムと前記プログラムに対するテストケースとから、前記分割候補要素リストに含まれるプログラム要素のそれぞれについて、前記テストケースに基づいて前記プログラムを実行したときに実行される処理に対応する前記ソースコードの部分である実行パスを記録した動的情報リストを生成し、前記動的情報リストと重複閾値とから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記ソースコードの部分のうち、前記テストケースのうち前記動的情報リストに示された前記実行パスに当該部分を含むテストケースの割合が前記重複閾値以上である部分を記録した基本パスリストを生成し、前記分割候補要素リストと前記基本パスリストから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記基本パスリストに含まれない部分を記録した分割パスリストを生成する、ことを実行させるためのソースコード解析プログラムである。 A source code analysis program according to one aspect of the present disclosure is a source code analysis program that analyzes source code corresponding to a program, and is configured to: calculate source code metrics for each program element included in the program from the source code to be analyzed; calculate a maintainability index for each of the program elements from the source code metrics; generate a split candidate element list that records program elements that are candidates for splitting based on the maintainability index and a maintainability index threshold; and, based on the source code, the program, and test cases for the program, perform splitting for each of the program elements included in the split candidate element list based on the test cases. a dynamic information list that records execution paths that are portions of the source code corresponding to processes that are executed when the program is executed; a basic path list that records, from the dynamic information list and an overlap threshold, portions of the source code for each program element included in the splitting candidate element list, for which the proportion of test cases that include said portions in the execution paths shown in the dynamic information list is equal to or greater than the overlap threshold; and a split path list that records, from the splitting candidate element list and the basic path list, portions of each program element included in the splitting candidate element list that are not included in the basic path list.
本開示のひとつの態様によれば、要素分割すべきプログラム要素について、開発者可読性ニーズに応えながら、要素分割を行うべき箇所を改善箇所として提示することができる。 According to one aspect of the present disclosure, it is possible to present areas for improvement where element splitting is required for program elements while meeting developer readability needs.
以下、本開示の実施例について図面を参照しつつ説明する。なお以下に説明する実施例は、特許請求の範囲に係る発明を限定するものではない。また実施例において説明されている諸要素およびその組み合わせの全ては発明の解決手段に必須であるとは限らない。 The following describes embodiments of the present disclosure with reference to the drawings. Note that the embodiments described below do not limit the scope of the invention as claimed. Furthermore, not all of the elements and combinations thereof described in the embodiments are necessarily essential to the solution of the invention.
図1は、ソースコード解析装置のハードウェア構成例を示す概念図である。 Figure 1 is a conceptual diagram showing an example of the hardware configuration of a source code analysis device.
ソースコード解析装置100は、ソフトウェアシステムの開発や保守などに利用される情報処理装置である。ソースコード解析装置100は、クラウドシステムにより提供されるクラウドサーバなどのように、仮想的に実現されるものであってもよい。 The source code analysis device 100 is an information processing device used for the development and maintenance of software systems. The source code analysis device 100 may be realized virtually, such as a cloud server provided by a cloud system.
図1に示すように、ソースコード解析装置100は、プロセッサ101と、主記憶装置102と、補助記憶装置103と、入力装置104と、出力装置105と、通信装置106とを備える。これらは図示を省略するバスなどの通信手段を介して互いに通信可能に接続されている。 As shown in FIG. 1, the source code analysis device 100 includes a processor 101, a main memory device 102, an auxiliary memory device 103, an input device 104, an output device 105, and a communication device 106. These are connected to each other so that they can communicate with each other via communication means such as a bus (not shown).
プロセッサ101は、例えばCPU(Central Processing Unit)、MPU(Micro Processing Unit)、GPU(Graphics Processing Unit)、FPGA(Field-Programmable Gate Array)等で構成される。プロセッサ101が、主記憶装置102または補助記憶装置103に格納されている、ソースコード解析プログラム等の各種プログラムを読み出して実行することにより、ソースコード解析装置100の様々な機能が実現される。 The processor 101 is composed of, for example, a CPU (Central Processing Unit), an MPU (Micro Processing Unit), a GPU (Graphics Processing Unit), an FPGA (Field-Programmable Gate Array), etc. The processor 101 reads and executes various programs, such as a source code analysis program, stored in the main memory device 102 or the auxiliary memory device 103, thereby realizing various functions of the source code analysis device 100.
主記憶装置102はプログラムやデータを記憶する装置であり、例えば、Random Access Memory(RAM)、Read Only Memory(ROM)、不揮発性半導体メモリ(Non-Volatile RAM(NVRAM))である。 The main memory device 102 is a device that stores programs and data, and may be, for example, Random Access Memory (RAM), Read Only Memory (ROM), or non-volatile semiconductor memory (Non-Volatile RAM (NVRAM)).
補助記憶装置103は、例えば、Hard Disc Drive(HDD)、Solid State Drive(SSD)、ストレージシステム、Integrated Circuit(IC)カード、Secure Digital(SD)メモリカードや光学式記録媒体(Compact Disc(CD)、Digital Versatile Disc(DVD)など)などの記録媒体の読み取りおよび書き込み装置、クラウドサーバの記憶領域である。 The auxiliary storage device 103 is, for example, a reading and writing device for recording media such as a hard disc drive (HDD), solid state drive (SSD), storage system, integrated circuit (IC) card, secure digital (SD) memory card, or optical recording media (compact disc (CD), digital versatile disc (DVD), etc.), or a storage area of a cloud server.
入力装置104は、ユーザによる情報の入力を受け付ける装置である。入力装置104は、例えば、キーボード、マウス、タッチパネル、カードリーダ、音声入力装置である。 The input device 104 is a device that accepts information input by the user. The input device 104 is, for example, a keyboard, a mouse, a touch panel, a card reader, or a voice input device.
出力装置105は、ユーザに処理経過や処理結果などの各種情報を提供する装置である。出力装置105は、例えば、画面表示装置(Liquid Crystal Display(LCD)、Head Mounted Display(HMD)など)、音声出力装置、印字装置等である。 The output device 105 is a device that provides various information such as processing progress and results to the user. Examples of the output device 105 include a screen display device (such as a Liquid Crystal Display (LCD) or a Head Mounted Display (HMD)), an audio output device, or a printing device.
また、ソースコード解析装置100が通信装置106を介して、他の装置との間で情報の入力や出力を行ってもよい。 Furthermore, the source code analysis device 100 may input and output information to and from other devices via the communication device 106.
通信装置106はLocal Area Network(LAN)やInternetなどの通信回線を介した他の装置との間の通信を実現する有線方式または無線方式の通信インターフェースである。通信装置106は、例えば、Network Interface Card(NIC)、無線通信モジュール、Universal Serial Interface(USB)モジュール、シリアル通信モジュールである。 The communication device 106 is a wired or wireless communication interface that enables communication with other devices via communication lines such as a local area network (LAN) or the Internet. The communication device 106 is, for example, a network interface card (NIC), a wireless communication module, a universal serial interface (USB) module, or a serial communication module.
図2は、ソースコード解析装置の機能構成を示す概念図である。 Figure 2 is a conceptual diagram showing the functional configuration of a source code analysis device.
ソースコード解析装置100は、ソースコードメトリクス計算部201と、保守性指標計算部202と、分割候補要素生成部203と、プログラム処理追跡部204と、基本パス生成部205と、分割パス生成部206とを備える。 The source code analysis device 100 includes a source code metrics calculation unit 201, a maintainability index calculation unit 202, a division candidate element generation unit 203, a program processing tracking unit 204, a basic path generation unit 205, and a division path generation unit 206.
これら各部は、例えば、プロセッサ101が、主記憶装置102または補助記憶装置103に格納されているプログラムを読み出して実行することにより実現される。また、これら各部は、例えば、ソースコード解析装置100が備えるハードウェア(Application Specific Integrated Circuit(ASIC)など)によって実現されてもよい。 Each of these units is realized, for example, by the processor 101 reading and executing a program stored in the main memory device 102 or the auxiliary memory device 103. Furthermore, each of these units may also be realized, for example, by hardware (such as an Application Specific Integrated Circuit (ASIC)) included in the source code analysis device 100.
ソースコード解析装置100は情報記憶部207をさらに備える。情報記憶部207は情報を記憶する。情報記憶部207は、主記憶装置102および補助記憶装置103のうち少なくとも一方から構成される。情報記憶部207は、ソースコードメトリクス213を記憶する。情報記憶部207は、その他、ソースコードメトリクス計算部201、保守性指標計算部202、分割候補要素生成部203、プログラム処理追跡部204、基本パス生成部205、および分割パス生成部206が適宜参照もしくは生成する情報を記録する。情報記憶部207は、主記憶装置102および補助記憶装置103のうち少なくとも一方に記憶されている情報を、例えば、ファイルシステムやDataBase Management System(DBMS)などの形式で管理してよい。 The source code analysis device 100 further includes an information storage unit 207. The information storage unit 207 stores information. The information storage unit 207 is composed of at least one of the main memory device 102 and the auxiliary memory device 103. The information storage unit 207 stores source code metrics 213. The information storage unit 207 also records information referenced or generated as appropriate by the source code metrics calculation unit 201, maintainability index calculation unit 202, division candidate element generation unit 203, program processing tracking unit 204, basic path generation unit 205, and division path generation unit 206. The information storage unit 207 may manage the information stored in at least one of the main memory device 102 and the auxiliary memory device 103 in the form of, for example, a file system or a database management system (DBMS).
保守性指標閾値211、解析対象ソースコード208、解析対象プログラム209、テストケース210、および重複閾値212は、ソースコード解析装置100における入力情報である。これらの入力情報は、主記憶装置102または補助記憶装置103に予め保存されていてよい。また、ソースコード解析装置100が、外部装置に保存された入力データを、通信装置106を介して取得してもよい。 The maintainability index threshold 211, the source code to be analyzed 208, the program to be analyzed 209, the test cases 210, and the duplication threshold 212 are input information to the source code analysis device 100. This input information may be stored in advance in the main memory device 102 or the auxiliary memory device 103. In addition, the source code analysis device 100 may acquire input data stored in an external device via the communication device 106.
(ソースコードの解析処理)
ソースコードメトリクス計算部201は、解析対象ソースコード208を取得して、ソースコードメトリクス213を計算する。ソースコードメトリクスとは、上述のように、ソースコードをプログラム解析して得られるプログラム要素の特徴量である。
(Source code analysis process)
The source code metrics calculation unit 201 acquires the analysis target source code 208 and calculates source code metrics 213. As described above, source code metrics are feature quantities of program elements obtained by program analysis of the source code.
保守性指標計算部202は、前記ソースコードメトリクス213を取得して、保守性指標214を計算する。保守性指標の具体例については、図5および図11等を参照して後述する。 The maintainability index calculation unit 202 acquires the source code metrics 213 and calculates the maintainability index 214. Specific examples of the maintainability index will be described later with reference to Figures 5 and 11, etc.
分割候補要素生成部203は、前記保守性指標214と、保守性指標閾値211とを取得して、プログラムの分割候補要素リスト215を生成する。分割候補要素リスト215については、図6および図12等を参照して後述する。 The division candidate element generation unit 203 obtains the maintainability index 214 and the maintainability index threshold 211, and generates a division candidate element list 215 for the program. The division candidate element list 215 will be described later with reference to Figures 6 and 12, etc.
プログラム処理追跡部204は、解析対象ソースコード208と、解析対象プログラム209と、解析対象プログラム209に対するテストケース210を取得して、動的情報リスト216を生成する。動的情報リスト216については、図7および図13等を参照して後述する。 The program processing tracking unit 204 acquires the analysis target source code 208, the analysis target program 209, and test cases 210 for the analysis target program 209, and generates a dynamic information list 216. The dynamic information list 216 will be described later with reference to Figures 7 and 13, etc.
基本パス生成部205は、前記動的情報リスト216と、重複閾値212とを取得して、基本パスリスト217を生成する。基本パスリスト217については、図8および図14等を参照して後述する。 The basic path generation unit 205 obtains the dynamic information list 216 and the overlap threshold 212 and generates the basic path list 217. The basic path list 217 will be described later with reference to Figures 8 and 14, etc.
分割パス生成部206は、前記分割候補要素リスト215と、前記基本パスリスト217とを取得して、分割パスリスト218を生成する。分割パスリストについては、図9および図15等を参照して後述する。 The split path generation unit 206 obtains the split candidate element list 215 and the basic path list 217 and generates the split path list 218. Split path lists will be described later with reference to Figures 9 and 15, etc.
ソースコード解析装置100は、解析対象ソースコード208と、解析対象プログラム209と、テストケース210と、保守性指標閾値211と、重複閾値212とに基づいて、保守性指標214と動的情報リスト216とに応じた分割すべきプログラム要素の一覧を生成する。 The source code analysis device 100 generates a list of program elements to be divided according to the maintainability index 214 and dynamic information list 216 based on the source code to be analyzed 208, the program to be analyzed 209, the test cases 210, the maintainability index threshold 211, and the overlap threshold 212.
解析対象ソースコード208は、ソースコード解析装置100により解析されるソースコードを記録した入力情報である。 The analysis target source code 208 is input information that records the source code to be analyzed by the source code analysis device 100.
図3は、解析対象ソースコードの一例を示す図である。解析対象ソースコード208は、解析対象となるプログラムの、プログラム要素ごとのソースコード部分の集合301によって構成される。ここでプログラム要素の単位は、関数の一部や、クラス、モジュール、構造体など、ある長さを持ったソースコード部分であれば、どのような単位でも構わない。ソースコード部分とは、プログラム要素に対応するソースコードの少なくとも一部分を意味する。ソースコード部分は、プログラム要素に対応するソースコードの全部であってもよい。図3の例では、funcAとfuncBがプログラム要素である。funcAをプログラム要素Aとし、funcBをプログラム要素Bとする。プログラム要素Aには、処理A、処理B、処理C、処理D、および処理Eの各部分が含まれている。プログラム要素Bには、処理F、処理G、処理H、処理I、および処理Jの各部分が含まれている。 Figure 3 shows an example of source code to be analyzed. The source code to be analyzed 208 is composed of a set 301 of source code segments for each program element of the program to be analyzed. Here, the unit of program element can be any unit of source code of a certain length, such as part of a function, a class, a module, or a structure. A source code segment refers to at least a portion of the source code corresponding to a program element. A source code segment may also be all of the source code corresponding to a program element. In the example of Figure 3, funcA and funcB are program elements. funcA is program element A, and funcB is program element B. Program element A includes the following segments: process A, process B, process C, process D, and process E. Program element B includes the following segments: process F, process G, process H, process I, and process J.
解析対象プログラム209は、解析対象ソースコード208をビルドすることにより生成される実行可能なプログラムである。ソースコード解析装置100は、解析対象プログラム209に対応する解析対象ソースコード208を解析するものである。 The analysis target program 209 is an executable program generated by building the analysis target source code 208. The source code analysis device 100 analyzes the analysis target source code 208 corresponding to the analysis target program 209.
テストケース210は、解析対象プログラム209に対する様々なテストケースを記録した情報である。 Test cases 210 are information that records various test cases for the analysis target program 209.
保守性指標閾値211は、分割候補要素生成部203において、各プログラム要素の保守性が低いか否か、すなわち各プログラム要素を分割すべきか否かを判断する際に用いる保守性指標214の閾値を意味する。例えば、保守性指標閾値211として20が設定される。ただし、保守性指標閾値211の値は20以外であってもよい。 The maintainability index threshold 211 refers to the threshold of the maintainability index 214 used by the division candidate element generation unit 203 when determining whether each program element is low in maintainability, i.e., whether each program element should be divided. For example, the maintainability index threshold 211 is set to 20. However, the value of the maintainability index threshold 211 may be other than 20.
重複閾値212は、基本パス生成部205において、動的情報リスト216に含まれるソースコードの各要素が、動的情報リスト216全体において頻繁に出現するか否かを判断するときに用いる割合の閾値を記録したものである。例えば、重複閾値212として0.7(70%)が設定される。ただし、重複閾値212の値は0.7以外の値であってもよい。 The overlap threshold 212 is a recorded percentage threshold used by the basic path generation unit 205 when determining whether each element of source code included in the dynamic information list 216 appears frequently throughout the dynamic information list 216. For example, the overlap threshold 212 is set to 0.7 (70%). However, the value of the overlap threshold 212 may be a value other than 0.7.
図4は、ソースコードメトリクスの一例を示す図である。ソースコードメトリクス213は、解析対象ソースコード208を入力とし、ソースコードメトリクス計算部201が計算した様々なメトリクス値を、ソースコードメトリクスレコード400として記録したものである。ソースコードメトリクスレコード400は、ソースコードメトリクスレコードの計算対象であるプログラムのプログラム要素を記録したプログラム要素名401と、当該プログラム要素名の様々なソースコードメトリクス213のメトリクス値を記録したソースコードメトリクス402とで構成される。なお、メトリクス値は1つであるとは限らない。図4には、ソースコードメトリクスレコード400がメトリクス1とメトリクス2の少なくとも2つのメトリクス値を含む例が示されている。ソースコードメトリクス402の計算方法としては、当業者に既知の計算方法が用いられてもよい。 Figure 4 is a diagram showing an example of source code metrics. The source code metrics 213 are recorded as a source code metrics record 400, with various metric values calculated by the source code metrics calculation unit 201 using the source code 208 to be analyzed as input. The source code metrics record 400 is composed of a program element name 401 that records the program element of the program that is the target of the source code metrics record calculation, and source code metrics 402 that records the metric values of the various source code metrics 213 for that program element name. Note that the metric value is not limited to one. Figure 4 shows an example in which the source code metrics record 400 includes at least two metric values, Metric 1 and Metric 2. The source code metrics 402 may be calculated using a calculation method known to those skilled in the art.
図5は、保守性指標の一例を示す図である。保守性指標214は、ソースコードメトリクス213を入力とし、保守性指標計算部202が計算した保守性指標を、保守性指標レコード500として記録したものである。保守性指標レコード500は、当該保守性指標レコードの計算対象であるプログラムのプログラム要素を記録したプログラム要素名501と、当該プログラム要素の保守性指標214を記録した保守性指標502とで構成される。保守性指標502の計算方法として、当業者に既知の計算方法が用いられてもよい。例えば、保守性指標502の値が大きいほど、当該プログラム要素の保守性が高いことを表すような計算方法が用いられてよい。 Figure 5 is a diagram showing an example of a maintainability index. The maintainability index 214 is a maintainability index calculated by the maintainability index calculation unit 202 using the source code metrics 213 as input, and recorded as a maintainability index record 500. The maintainability index record 500 is composed of a program element name 501 that records the program element for which the maintainability index record is calculated, and a maintainability index 502 that records the maintainability index 214 of that program element. A calculation method known to those skilled in the art may be used to calculate the maintainability index 502. For example, a calculation method may be used in which the larger the value of the maintainability index 502, the higher the maintainability of the program element.
図6は、分割候補要素リストの一例を示す図である。分割候補要素リスト215は、保守性指標214を入力とし、分割されるべきプログラム要素に該当すると分割候補要素生成部203が判定したプログラム要素を、分割候補要素レコード600として記録したものである。分割候補要素レコード600は、分割されるべきプログラム要素に該当するプログラム要素名601で構成される。図6の例では、プログラム要素Aおよびプログラム要素Bが分割候補要素となっている。 Figure 6 is a diagram showing an example of a splitting candidate element list. The splitting candidate element list 215 uses the maintainability index 214 as input and records, as splitting candidate element records 600, program elements that the splitting candidate element generation unit 203 has determined to correspond to program elements that should be split. The splitting candidate element records 600 are composed of program element names 601 that correspond to program elements that should be split. In the example of Figure 6, program element A and program element B are splitting candidate elements.
分割候補要素リスト215は、ソースコード解析装置100が、解析対象ソースコード208を、ソースコードメトリクスに基づいた保守性指標によって静的に解析した解析結果に相当する。 The splitting candidate element list 215 corresponds to the analysis results obtained by the source code analysis device 100 statically analyzing the analysis target source code 208 using maintainability indicators based on source code metrics.
次に、解析対象ソースコードの動的な解析について説明する。 Next, we will explain the dynamic analysis of the source code to be analyzed.
図7は、動的情報リストの一例を示す図である。動的情報リスト216は、解析対象ソースコード208と、解析対象プログラム209と、テストケース210を入力とし、プログラム処理追跡部204が生成した実行パスを、動的情報レコード700として記録したものである。 Figure 7 shows an example of a dynamic information list. The dynamic information list 216 records the execution paths generated by the program processing tracking unit 204 as dynamic information records 700 using the analysis target source code 208, analysis target program 209, and test case 210 as input.
動的情報レコード700は、当該動的情報レコードの計算対象であるプログラムのプログラム要素の名称であるプログラム要素名701と、解析対象プログラム209のプログラム実行に際して用いられたテストケース210の名称であるテストケース名702と、当該プログラム要素と当該テストケースに対応する実行パスを記録した実行パス703で構成される。図7の例では、テストケースA-Iではプログラム要素Aにおける処理A、処理C、処理D、および処理Eが実行されている。また、テストケースA-IIではプログラム要素Aにおける処理A、処理C、および処理Dが実行されている。テストケースB-Iではプログラム要素Bにおける処理Gが実行されている。なお、実行パスについては、図13を参照して後述する。 Dynamic information record 700 is composed of program element name 701, which is the name of the program element of the program that is the target of calculation of that dynamic information record; test case name 702, which is the name of the test case 210 used during program execution of analysis target program 209; and execution path 703, which records the execution path corresponding to that program element and that test case. In the example of Figure 7, in test case A-I, processes A, C, D, and E in program element A are executed. In test case A-II, processes A, C, and D in program element A are executed. In test case B-I, process G in program element B is executed. Execution paths will be described later with reference to Figure 13.
図8は、基本パスリストの一例を示す図である。基本パスリスト217は、基本パス生成部20により生成された基本パスを、基本パスレコード800として記録したものである。基本パスレコード800は、当該基本パスレコードの計算対象であるプログラムのプログラム要素を記録したプログラム要素名801と、当該プログラム要素の基本パスを記録した基本パス802で構成される。図8の例では、プログラム要素Aの基本パスには処理A、処理C、および処理Dが含まれている。また、プログラム要素Bの基本パスには処理Gが含まれている。 Figure 8 shows an example of a basic path list. The basic path list 217 records the basic paths generated by the basic path generation unit 20 as basic path records 800. The basic path record 800 is composed of a program element name 801 that records the program element of the program that is the target of calculation for the basic path record, and a basic path 802 that records the basic path of that program element. In the example of Figure 8, the basic path of program element A includes processes A, C, and D. Furthermore, the basic path of program element B includes process G.
図9は、分割パスリストの一例を示す図である。分割パスリスト218は、分割パス生成部206が生成した分割パスを、分割パスレコード900として記録したものである。分割パスレコード900は、要素分割すべきと判断されたプログラム要素名901と、当該プログラム要素の分割パスを記録した分割パス902とで構成される。図9の例では、プログラム要素Aの分割パスには、図8に示した基本パスに含まれなかった処理Bおよび処理Eが含まれている。また、プログラム要素Bの分割パスには、図8に示した基本パスに含まれなかった処理F、処理H、および処理Iが含まれている。 Figure 9 is a diagram showing an example of a split path list. The split path list 218 records the split paths generated by the split path generation unit 206 as split path records 900. The split path record 900 is composed of a program element name 901 determined to be split, and a split path 902 that records the split path of that program element. In the example of Figure 9, the split path of program element A includes processes B and E that were not included in the basic path shown in Figure 8. Furthermore, the split path of program element B includes processes F, H, and I that were not included in the basic path shown in Figure 8.
(各処理ブロックの処理内容)
図10は、ソースコードメトリクス計算部の処理例を示すフローチャートである。
(Processing contents of each processing block)
FIG. 10 is a flowchart illustrating an example of processing by the source code metrics calculation unit.
ソースコードメトリクス計算部201は、解析対象ソースコード208を読み込む(1001)。 The source code metrics calculation unit 201 reads the source code 208 to be analyzed (1001).
ソースコードメトリクス計算部201は、取得した解析対象ソースコード208に含まれる各プログラム要素Eに対して、ステップ1003の処理を実行する(ステップ1002-1004)。 The source code metrics calculation unit 201 executes the processing of step 1003 for each program element E contained in the acquired analysis target source code 208 (steps 1002-1004).
ステップ1003においてソースコードメトリクス計算部201は、ソースコードメトリクス213を計算する。 In step 1003, the source code metrics calculation unit 201 calculates the source code metrics 213.
ソースコードメトリクス計算部201は、保守性指標計算部202で用いられるようなソースコードメトリクスを計算する。保守性容易性指数(Maintainability Index(MI))におけるHalsted Volume、循環的複雑度、注釈行を除いたソースコードの行数などが、計算されるソースコードメトリクスの一例である。 The source code metrics calculation unit 201 calculates source code metrics such as those used by the maintainability index calculation unit 202. Examples of source code metrics that are calculated include the Halsted Volume in the Maintainability Index (MI), cyclomatic complexity, and the number of lines of source code excluding comment lines.
図11は、保守性指標計算部の処理例を示すフローチャートである。 Figure 11 is a flowchart showing an example of the processing performed by the maintainability index calculation unit.
保守性指標計算部202は、各プログラム要素Eに対して、ステップ1102および1103の処理を実行する(ステップ1101-1104)。 The maintainability index calculation unit 202 executes steps 1102 and 1103 for each program element E (steps 1101-1104).
保守性指標計算部202は、ソースコードメトリクス213を読み込む(1102)。保守性指標計算部202は、読み込んだソースコードメトリクス213を用いて、保守性指標214を計算する(1103)。 The maintainability index calculation unit 202 reads the source code metrics 213 (1102). The maintainability index calculation unit 202 uses the read source code metrics 213 to calculate the maintainability index 214 (1103).
保守性指標とは、ソフトウェアの保守の容易性を示すメトリクスである。保守性指標の一例として、例えば次の式(1)に示す保守性容易性指数(Maintainability Index(MI))がある。 A maintainability index is a metric that indicates the ease of software maintenance. An example of a maintainability index is the Maintainability Index (MI) shown in the following equation (1):
保守容易性指数=max(0, (171 - 5.2*ln(HV) - 0.23*C - 16.2*ln(L))*100/171) …(1) Maintainability index=max(0, (171 - 5.2*ln(HV) - 0.23*C - 16.2*ln(L))*100/171) …(1)
ここで、HVはHalsted Volumeを意味している。Cは循環的複雑度を意味している。Lは注釈行を除いたソースコードの行数を意味している。lnは自然対数を意味している。 Here, HV stands for Halsted Volume. C stands for Cyclomatic Complexity. L stands for the number of lines of source code excluding comment lines. ln stands for the natural logarithm.
保守性指標214は上述の保守性容易性指数には限られず、プログラムの保守性に関与する任意の指標であってよい。 The maintainability index 214 is not limited to the maintainability index described above, but may be any index related to the maintainability of the program.
図12は、分割候補要素生成部の処理例を示すフローチャートである。 Figure 12 is a flowchart showing an example of the processing performed by the division candidate element generation unit.
分割候補要素生成部203は、保守性指標閾値211を読み込む(1201)。読み込んだ保守性指標閾値をAと表記する。 The division candidate element generation unit 203 reads the maintainability index threshold 211 (1201). The read maintainability index threshold is denoted as A.
分割候補要素生成部203は、各プログラム要素Eに対して、ステップ1203-1205の処理を実行する(ステップ1202-1206)。 The division candidate element generation unit 203 executes steps 1203-1205 for each program element E (steps 1202-1206).
分割候補要素生成部203は、保守性指標214を読み込む(1203)。読み込んだ保守性指標をHと表記する。 The division candidate element generation unit 203 reads the maintainability index 214 (1203). The read maintainability index is denoted as H.
分割候補要素生成部203は、保守性指標Hが保守性指標閾値A未満であるか否かを判定する(1204)。保守性指標Hが保守性指標閾値A未満である場合(ステップ1204:YES)、ステップ1205へと処理が遷移する。保守性指標Hが保守性指標閾値A未満ではない場合(ステップ1204:NO)、ステップ1205はスキップされる。 The division candidate element generation unit 203 determines whether the maintainability index H is less than the maintainability index threshold A (1204). If the maintainability index H is less than the maintainability index threshold A (step 1204: YES), processing proceeds to step 1205. If the maintainability index H is not less than the maintainability index threshold A (step 1204: NO), step 1205 is skipped.
ステップ1205において分割候補要素生成部203は、当該プログラム要素を分割候補要素リスト215に追加する。 In step 1205, the division candidate element generation unit 203 adds the program element to the division candidate element list 215.
なお上記は、値が大きいほど、プログラム要素の保守性が高いことを表すような保守性指標が用いられた場合の処理例を示している。値が小さいほどプログラム要素の保守性が高いことを表すような保守性指標が用いられた場合には、ステップ1204において、保守性指標214が保守性指標閾値211より大きい場合に、ステップ1205へと処理が遷移する。 The above shows an example of processing when a maintainability index is used in which the larger the value, the higher the maintainability of the program element. If a maintainability index is used in which the smaller the value, the higher the maintainability of the program element, then in step 1204, if the maintainability index 214 is greater than the maintainability index threshold 211, processing transitions to step 1205.
図13は、プログラム処理追跡部の処理例を示すフローチャートである。 Figure 13 is a flowchart showing an example of processing by the program processing tracking unit.
プログラム処理追跡部204は、解析対象ソースコード208を読み込む(1301)。プログラム処理追跡部204は、解析対象プログラム209を読み込む(1302)。プログラム処理追跡部204は、解析対象プログラム209に対応するテストケース210を読み込む(1303)。 The program processing tracing unit 204 reads the analysis target source code 208 (1301). The program processing tracing unit 204 reads the analysis target program 209 (1302). The program processing tracing unit 204 reads the test case 210 corresponding to the analysis target program 209 (1303).
プログラム処理追跡部204は、解析対象プログラム209に含まれる各プログラム要素Eに対して、ステップ1305-1308の処理を実行する(ステップ1304-1309)。ここでは解析対象プログラム209に含まれる全てのプログラム要素Eに対してステップ1305-1308の処理を実行する例を示すが、他の例として、分割候補要素リスト215に含まれる全てのプログラム要素Eに対してステップ1305-1308の処理を実行することにしてもよい。 The program processing tracking unit 204 executes steps 1305-1308 for each program element E included in the analysis target program 209 (steps 1304-1309). Here, an example is shown in which steps 1305-1308 are executed for all program elements E included in the analysis target program 209, but as another example, steps 1305-1308 may be executed for all program elements E included in the splitting candidate element list 215.
プログラム処理追跡部204は、テストケース210に含まれる各テストケースTに対して、ステップ1306-1307の処理を実行する(ステップ1305-1308)。 The program processing tracking unit 204 executes steps 1306-1307 for each test case T included in the test case 210 (steps 1305-1308).
プログラム処理追跡部204は、解析対象プログラム209を、テストケースTに基づいて実行する(1306)。 The program processing tracing unit 204 executes the analysis target program 209 based on test case T (1306).
プログラム処理追跡部204は、当該プログラム要素Eについて、実行された処理に対応するソースコードの部分からなる集合を、ソースコード208から抽出する(1307)。テストケースに対して実行された当該ソースコードの部分からなる集合を、実行パスと表現する。この実行パスが、図7を参照して説明した動的情報リスト216の動的情報レコード700に含まれることになる。 The program processing tracking unit 204 extracts from the source code 208 a set of source code portions corresponding to the executed processing for the program element E (1307). The set of source code portions executed for the test case is referred to as an execution path. This execution path will be included in the dynamic information record 700 of the dynamic information list 216 described with reference to Figure 7.
なお、解析対象ソースコード208の読み込み(ステップ1301)と、解析対象プログラム209の読み込み(ステップ1302)と、テストケース210の読み込み(ステップ1303)の順序は問わない。 The order in which the analysis target source code 208 (step 1301), the analysis target program 209 (step 1302), and the test case 210 (step 1303) are read does not matter.
図14は、基本パス生成部の処理例を示すフローチャートである。 Figure 14 is a flowchart showing an example of processing by the basic path generation unit.
基本パス生成部205は、重複閾値212を読み込む(1401)。読み込んだ重複閾値をBと表記する。 The basic path generation unit 205 reads the overlap threshold 212 (1401). The read overlap threshold is denoted as B.
基本パス生成部205は、各プログラム要素Eに対して、ステップ1403-1409の処理を実行する(1402-1410)。 The basic path generation unit 205 executes steps 1403-1409 for each program element E (1402-1410).
基本パス生成部205は、動的情報リスト216を読み込む(1403)。 The basic path generation unit 205 reads the dynamic information list 216 (1403).
基本パス生成部205は、プログラム要素Eに含まれるソースコードの各部分Sに対して、ステップ1405-1407の処理を実行する(1404-1408)。なお、プログラム要素Eに含まれるソースコードの部分Sを、ソースコード片と表記する。 The basic path generation unit 205 executes steps 1405-1407 for each portion S of source code included in program element E (1404-1408). Note that a portion S of source code included in program element E is referred to as a source code fragment.
基本パス生成部205は、当該プログラム要素Eにおけるソースコード片Sについて、テストケースのうち動的情報リストに示された実行パスに当該ソースコード片Sを含むテストケースの割合Rを計算する。(1405)。 For the source code fragment S in the program element E, the basic path generation unit 205 calculates the percentage R of test cases whose execution paths indicated in the dynamic information list include the source code fragment S (1405).
基本パス生成部205は、割合Rが、重複閾値B以上であるかどうか判断する(1406)。割合Rが重複閾値B以上である場合(ステップ1406:YES)、ステップ1407に処理が遷移する。割合Rが重複閾値B以上ではない場合(ステップ1406:NO)、ステップ1407はスキップされる。 The basic path generation unit 205 determines whether the ratio R is greater than or equal to the overlap threshold B (1406). If the ratio R is greater than or equal to the overlap threshold B (step 1406: YES), processing proceeds to step 1407. If the ratio R is not greater than or equal to the overlap threshold B (step 1406: NO), step 1407 is skipped.
ステップ1407において基本パス生成部205は、ソースコード片Sを基本パスに追加する(1407)。なお、1つのプログラム要素に対してステップ1407の処理を行うことによって形成される、ソースコード片Sの集合を、基本パスと表記する。 In step 1407, the basic path generation unit 205 adds the source code fragment S to the basic path (1407). Note that the set of source code fragments S formed by performing the processing of step 1407 on one program element is referred to as a basic path.
ステップ1409において基本パス生成部205は、基本パスを基本パスリスト217に追加する。 In step 1409, the basic path generation unit 205 adds the basic path to the basic path list 217.
ここで、ステップ1404-1408のループ処理について、より詳しく説明する。 Here, we will explain the loop processing of steps 1404-1408 in more detail.
図2および図7を参照すると、動的情報リスト216が、テストケース210に対してプログラム処理追跡部204が実行したソースコード208の部分からなる集合を含んでいる。これは、図7の実行パスに相当する。基本パス生成部205では、テストケース210に対してプログラム処理追跡部204が実行したソースコード208の部分からなる集合に含まれる割合が重複閾値212以上であるようなソースコード208の部分を基本パスに追加する(ステップ1405-1407)ことにより、動的情報リスト216と重複閾値212とから基本パスリスト217を生成する。 Referring to Figures 2 and 7, the dynamic information list 216 contains a set of parts of the source code 208 executed by the program processing tracing unit 204 for the test case 210. This corresponds to the execution path in Figure 7. The basic path generation unit 205 adds to the basic path parts of the source code 208 whose proportion in the set of parts of the source code 208 executed by the program processing tracing unit 204 for the test case 210 is equal to or greater than the overlap threshold 212 (steps 1405-1407), thereby generating a basic path list 217 from the dynamic information list 216 and the overlap threshold 212.
上述のように、開発現場の開発者にとってのソースコードの可読性の維持のため、あるプログラム要素内の典型的な処理については他の要素へと分割したくないという開発者可読性ニーズが想定される。実行パスに含まれる割合が重複閾値以上であるようなソースコード片を基本パスに追加すれば、実行頻度の高い典型的な処理は基本パスになり、分割対象とはならない(図15を参照して後述するステップ1505)。よって、開発者が1つのソースコードとしてまとまって読みたいと考えるであろう、実行頻度の高い典型的な処理が、開発者の意図に反して分割されずに済むという利点が得られる。 As mentioned above, in order to maintain the readability of source code for developers in the development field, it is assumed that there is a developer readability need to avoid splitting typical processing within a certain program element into other elements. If a source code fragment whose inclusion rate in the execution path is equal to or exceeds the overlap threshold is added to the base path, the typical processing with high execution frequency becomes the base path and is not subject to splitting (step 1505, described below with reference to Figure 15). This has the advantage that typical processing with high execution frequency that developers would want to read as a single piece of source code will not be split against the developer's intention.
図15は、分割パス生成部の処理例を示すフローチャートである。 Figure 15 is a flowchart showing an example of processing by the split path generation unit.
分割パス生成部206は、分割候補要素リスト215を読み込む(1501)。 The division path generation unit 206 reads the division candidate element list 215 (1501).
分割パス生成部206は、各プログラム要素Eに対して、ステップ1503-1507の処理を実行する(1502-1508)。 The split path generation unit 206 executes steps 1503-1507 for each program element E (1502-1508).
分割パス生成部206は、プログラム要素Eが分割候補要素リスト215に含まれるかどうかを判定する(1503)。プログラム要素Eが分割候補要素リスト215に含まれる場合(ステップ1503:YES)、ステップ1504へと処理が遷移する。プログラム要素Eが分割候補要素リスト215に含まれない場合(ステップ1503:NO)、ステップ1504-1507はスキップされる。 The split path generation unit 206 determines whether program element E is included in the split candidate element list 215 (1503). If program element E is included in the split candidate element list 215 (step 1503: YES), processing proceeds to step 1504. If program element E is not included in the split candidate element list 215 (step 1503: NO), steps 1504-1507 are skipped.
ステップ1504において分割パス生成部206は、基本パスリスト217を読み込む。 In step 1504, the split path generation unit 206 reads the basic path list 217.
分割パス生成部206は、プログラム要素Eのうち、基本パスリスト217に含まれないソースコードの部分(ソースコード片)を抽出する(1505)。なお、1つのプログラム要素に対してステップ1505を実行することによって抽出される、基本パスでないソースコード片の集合を分割パスと表記する。 The split path generation unit 206 extracts source code portions (source code fragments) from program element E that are not included in the basic path list 217 (1505). Note that the set of source code fragments that are not basic paths extracted by executing step 1505 for one program element is referred to as a split path.
分割パス生成部206は、分割パスが空でないかどうかを判定する(1506)。分割パスが空でない場合(ステップ1506:YES)、ステップ1507へと処理が遷移する。分割パスが空である場合(ステップ1506:NO)、ステップ1507はスキップされる。 The split path generation unit 206 determines whether the split path is empty (1506). If the split path is not empty (step 1506: YES), processing proceeds to step 1507. If the split path is empty (step 1506: NO), step 1507 is skipped.
分割パス生成部206は、分割パスを分割パスリストに追加する(1507)。 The split path generation unit 206 adds the split path to the split path list (1507).
以上のように、解析対象ソースコードを静的に解析した保守性指標214と、解析対象ソースコードに対応する解析対象プログラムをテストケースに基づいて実行して得られた実行パスを含む動的情報リスト216とを用いて、分割すべきプログラム要素を見つけ出し、リスト化することができる。 As described above, program elements to be divided can be found and listed using the maintainability index 214 obtained by statically analyzing the source code to be analyzed and the dynamic information list 216 containing the execution paths obtained by running the program to be analyzed corresponding to the source code to be analyzed based on test cases.
本実施例は、実施例1で示した基本パス生成部205において、プログラム要素を分割した後に残る基本パスの保守性指標を計算し、分割パスリストにおける分割パスレコードにおいて、分割パスに該当するプログラム要素名と分割パスに加え、当該プログラム要素の分割前保守性指標と、当該プログラム要素の基本パス保守性指標も記録する場合について示したものである。 This embodiment shows a case in which the basic path generation unit 205 shown in embodiment 1 calculates the maintainability index of the basic path remaining after splitting a program element, and in addition to the program element name and split path corresponding to the split path, the pre-split maintainability index of the program element and the basic path maintainability index of the program element are also recorded in the split path record in the split path list.
情報記憶部207は、実施例1の場合に加えて、基本パス保守性指標1602を主記憶装置102および補助記憶装置103のうち少なくとも一方に記憶する。また、情報記憶部207は、実施例1の場合に加えて、これらの情報以外にも、基本パス保守性指標計算部1601が適宜参照もしくは生成する情報などを記憶する。情報記憶部207は、主記憶装置102および補助記憶装置103のうち少なくとも一方に記憶されている情報を、実施例1の場合と同様に管理する。 In addition to the case of Example 1, the information storage unit 207 stores the base path maintainability index 1602 in at least one of the main memory device 102 and the auxiliary memory device 103. In addition to the case of Example 1, the information storage unit 207 also stores information other than the above information that is referenced or generated as appropriate by the base path maintainability index calculation unit 1601. The information storage unit 207 manages the information stored in at least one of the main memory device 102 and the auxiliary memory device 103 in the same way as in Example 1.
図16は、実施例2における、ソースコード解析装置が備える機能およびソースコード解析装置が記憶するデータを示す概念図である。 Figure 16 is a conceptual diagram showing the functions provided by the source code analysis device and the data stored by the source code analysis device in Example 2.
ソースコード解析装置100は、実施例1の場合に加えて、基本パス保守性指標計算部1601をさらに備える。基本パス保守性指標計算部1601は、基本パスリスト217から基本パス保守性指標1602を計算する。また、分割パス生成部206は、分割候補要素リスト215と基本パスリスト217に加えて、保守性指標214と、基本パス保守性指標1602とを取得する。 In addition to the configuration of Example 1, the source code analysis device 100 further includes a basic path maintainability index calculation unit 1601. The basic path maintainability index calculation unit 1601 calculates a basic path maintainability index 1602 from the basic path list 217. Furthermore, the split path generation unit 206 acquires the maintainability index 214 and the basic path maintainability index 1602 in addition to the split candidate element list 215 and the basic path list 217.
図17は、基本パス保守性指標の一例を示す図である。基本パス保守性指標1602は、基本パスリスト217を入力とし、基本パス保守性指標計算部1601が計算したメトリクス値を、基本パス保守性指標レコード1700として記録したものである。基本パス保守性指標レコード1700は、当該基本パス保守性指標レコードの計算対象であるプログラムのプログラム要素を記録したプログラム要素名1701と、当該プログラム要素の基本パスの保守性指標を記録した基本パス保守性指標1702で構成される。 Figure 17 is a diagram showing an example of a basic path maintainability index. The basic path maintainability index 1602 is a metric value calculated by the basic path maintainability index calculation unit 1601 using the basic path list 217 as input, and recorded as a basic path maintainability index record 1700. The basic path maintainability index record 1700 is composed of a program element name 1701 that records the program element of the program that is the subject of the calculation of the basic path maintainability index record, and a basic path maintainability index 1702 that records the maintainability index of the basic path of that program element.
図18は、実施例2における分割パスリストの一例を示す図である。実施例2における分割パスリスト218は、分割パス生成部206が生成した分割パスを、分割パスレコード1800として記録したものである。分割パスレコード1800は、要素分割すべきと判断されたプログラム要素1801の要素名と、当該プログラム要素の分割パスを記録した分割パス1802と、当該プログラム要素の保守性指標を記録した分割前保守性指標1803と、当該プログラム要素の基本パスの保守性指標を記録した分割後保守性指標1804で構成される。ソースコード解析装置100は、分割すべきプログラム要素1801の一覧に加え、要素分割前の保守性指標1803と要素分割後の保守性指標1804の一覧を生成する。 Figure 18 is a diagram showing an example of a split path list in Example 2. The split path list 218 in Example 2 records the split paths generated by the split path generation unit 206 as split path records 1800. The split path record 1800 is composed of the element name of a program element 1801 determined to be split, a split path 1802 recording the split path of the program element, a pre-split maintainability index 1803 recording the maintainability index of the program element, and a post-split maintainability index 1804 recording the maintainability index of the basic path of the program element. In addition to the list of program elements 1801 to be split, the source code analysis device 100 generates a list of the pre-split maintainability index 1803 and the post-split maintainability index 1804.
図19は、基本パス保守性指標計算部の動作例を示すフローチャートである。 Figure 19 is a flowchart showing an example of the operation of the basic path maintainability index calculation unit.
基本パス保守性指標計算部1601は、基本パスリスト217を読み込む(1901)。 The basic path maintainability index calculation unit 1601 reads the basic path list 217 (1901).
基本パス保守性指標計算部1601は、各プログラム要素Eに対して、ステップ1903-1904の処理を実行する(1902-1905)。 The basic path maintainability index calculation unit 1601 executes steps 1903-1904 for each program element E (1902-1905).
基本パス保守性指標計算部1601は、プログラム要素Eにおける基本パスのソースコードメトリクスを計算する(1903)。ソースコードメトリクスの計算方法は、ソースコードメトリクス計算部201で用いたものと同じ手法を用いてよい。 The basic path maintainability index calculation unit 1601 calculates the source code metrics of the basic path in program element E (1903). The source code metrics may be calculated using the same method as that used by the source code metrics calculation unit 201.
基本パス保守性指標計算部1601は、基本パスのソースコードメトリクスに基づいて、基本パスの保守性指標を計算する(1904)。保守性指標の計算方法は、保守性指標計算部202で用いたものと同じ手法を用いてよい。 The basic path maintainability index calculation unit 1601 calculates the maintainability index of the basic path based on the source code metrics of the basic path (1904). The maintainability index calculation method may be the same as that used by the maintainability index calculation unit 202.
図20は、分割パス生成部の動作例を示すフローチャートである。 Figure 20 is a flowchart showing an example of the operation of the split path generation unit.
図20に示したフローチャートは、基本的には図15に示したフローチャートと同様であるため、同様の処理については詳しい説明を省略する。 The flowchart shown in Figure 20 is basically the same as the flowchart shown in Figure 15, so detailed explanations of similar processes will be omitted.
図20に示したフローチャートには、図15に示したフローチャートに対し、ステップ2001および2002が追加されている。 The flowchart shown in Figure 20 adds steps 2001 and 2002 to the flowchart shown in Figure 15.
また、図15に示したフローチャートにおけるステップ1507が、図20に示したフローチャートにおいては、ステップ2003へと変更されている。 Furthermore, step 1507 in the flowchart shown in Figure 15 has been changed to step 2003 in the flowchart shown in Figure 20.
ステップ2001において分割パス生成部206は、保守性指標214を読み込む。ステップ2002において分割パス生成部206は、基本パス保守性指標1602を読み込む。ステップ2003において分割パス生成部206は、分割パスと、保守性指標214と、基本パス保守性指標1602とを、分割パスリストに追加する。 In step 2001, the split path generation unit 206 reads the maintainability index 214. In step 2002, the split path generation unit 206 reads the base path maintainability index 1602. In step 2003, the split path generation unit 206 adds the split path, the maintainability index 214, and the base path maintainability index 1602 to the split path list.
このように、分割パスと共に要素分割の前後の保守性指標を提示することで、本実施例により提示された要素分割によって、どれほど解析対象ソースコードの保守性が向上するかの効果の提示を行うことができる。 In this way, by presenting the split path along with the maintainability indicators before and after element splitting, it is possible to show how the element splitting proposed in this embodiment improves the maintainability of the source code being analyzed.
本実施例は、実施例1および実施例2に示した基本パス生成部205において、実施例1で示した入力に加え、保守性指標目標値も入力として用い、閾値設定者が重複閾値を変更することで、生成される基本パスを変更する場合について示したものである。 This embodiment shows a case in which the basic path generation unit 205 shown in Embodiments 1 and 2 uses a maintainability index target value as an input in addition to the input shown in Embodiment 1, and the threshold setter changes the overlap threshold to change the generated basic path.
図21は、実施例3における、ソースコード解析装置が備える機能およびソースコード解析装置が記憶するデータを示す概念図である。 Figure 21 is a conceptual diagram showing the functions provided by the source code analysis device and the data stored by the source code analysis device in Example 3.
ソースコード解析装置100は、実施例1および実施例2の場合に加えて、保守性指標目標値2101を入力とする。また、基本パス生成部205は、動的情報リスト216と重複閾値212に加えて、保守性指標目標値2101を入力とする。 In addition to the cases of Examples 1 and 2, the source code analysis device 100 inputs the maintainability index target value 2101. Furthermore, the basic path generation unit 205 inputs the maintainability index target value 2101 in addition to the dynamic information list 216 and overlap threshold 212.
保守性指標目標値2101は、基本パス生成部205で、閾値設定者が各プログラム要素の基本パスが適当か否かを判断するときに用いる保守性指標214の目標値を記録したものである。例えば保守性指標目標値2101として40が設定される。ただし、40以外の値であってもよい。 The maintainability index target value 2101 is a record of the target value of the maintainability index 214 used by the basic path generation unit 205 when the threshold setter determines whether the basic path of each program element is appropriate. For example, 40 is set as the maintainability index target value 2101. However, a value other than 40 may also be used.
図22は、基本パス生成部の動作例を示すフローチャートである。図22に示したフローチャートにおいて、図14に示したフローチャートと同様の処理については、詳しい説明を省略する。 Figure 22 is a flowchart showing an example of the operation of the basic path generation unit. In the flowchart shown in Figure 22, detailed explanations of processes that are the same as those in the flowchart shown in Figure 14 will be omitted.
実施例3においては、ステップ2201、2203、2204、2205、2206、および2207が追加されている。なお、ステップ2202および2208は、ステップ1403から2207までのループ処理を表している。ステップ2209は、図14に示したフローチャートにおけるステップ1409と同様の処理であるため、詳しい説明を省略する。 In Example 3, steps 2201, 2203, 2204, 2205, 2206, and 2207 are added. Note that steps 2202 and 2208 represent the loop processing from steps 1403 to 2207. Step 2209 is the same processing as step 1409 in the flowchart shown in Figure 14, so a detailed explanation will be omitted.
ステップ2201において基本パス生成部205は、保守性指標目標値2101を読み込む。読み込んだ保守性指標目標値をMと表記する。 In step 2201, the basic path generation unit 205 reads the maintainability index target value 2101. The read maintainability index target value is denoted as M.
ステップ2203において基本パス生成部205は、基本パスのソースコードメトリクスを計算する。 In step 2203, the basic path generation unit 205 calculates source code metrics for the basic path.
ステップ2204において基本パス生成部205は、基本パスの保守性指標を計算する。なお、基本パス保守性指標計算部1601を設ける場合、基本パス保守性指標計算部1601が実施例2に基づいて説明したように基本パスの保守性指標を計算してもよい。基本パス保守性指標計算部1601を設けない場合、基本パス生成部205が基本パスの保守性指標を同様にして計算してもよい。計算された基本パスの保守性指標をKと表記する。 In step 2204, the basic path generation unit 205 calculates the maintainability index of the basic path. If the basic path maintainability index calculation unit 1601 is provided, the basic path maintainability index calculation unit 1601 may calculate the maintainability index of the basic path as described based on Example 2. If the basic path maintainability index calculation unit 1601 is not provided, the basic path generation unit 205 may calculate the maintainability index of the basic path in a similar manner. The calculated basic path maintainability index is denoted as K.
ステップ2205において基本パス生成部205は、基本パスの保守性指標Kが保守性指標目標値M未満であるか否かを判定する。基本パスの保守性指標Kが保守性指標目標値M未満である場合(ステップ2205:YES)、ステップ2206へと処理が遷移する。基本パスの保守性指標Kが保守性指標目標値M未満ではない場合(ステップ2205:NO)、ステップ2209へと処理が遷移する。 In step 2205, the basic path generation unit 205 determines whether the maintainability index K of the basic path is less than the maintainability index target value M. If the maintainability index K of the basic path is less than the maintainability index target value M (step 2205: YES), processing transitions to step 2206. If the maintainability index K of the basic path is not less than the maintainability index target value M (step 2205: NO), processing transitions to step 2209.
ステップ2206は、人間が行う判定である。閾値設定者などのユーザは、生成された基本パスが適当であるか否かを判断する。生成された基本パスが適当であるとユーザが判断した場合(ステップ2206:YES)、ステップ2202-2208のループを抜けて、ステップ2209へと処理が遷移する。生成された基本パスが適当ではないとユーザが判断した場合(ステップ2206:NO)、ステップ2207へと処理が遷移する。 Step 2206 is a human judgment. A user, such as a threshold setter, determines whether the generated basic path is appropriate. If the user judges that the generated basic path is appropriate (step 2206: YES), the loop of steps 2202-2208 is exited and processing transitions to step 2209. If the user judges that the generated basic path is inappropriate (step 2206: NO), processing transitions to step 2207.
ステップ2207においてユーザは、重複閾値Bを変更する。そしてステップ1403へと処理が戻り、値が変更された新たな重複閾値Bに基づいて基本パスリストを再生成する(2202、2208)。ここでは重複閾値Bの値を高めることにより、基本パスを絞り込み基本パスの保守性指標Kが高まるようにするとよい。 In step 2207, the user changes the overlap threshold B. Processing then returns to step 1403, where the basic path list is regenerated based on the new overlap threshold B (2202, 2208). Here, by increasing the value of the overlap threshold B, it is advisable to narrow down the basic paths and increase the basic path maintainability index K.
ステップ2209において基本パス生成部205は、基本パスを基本パスリスト217に追加して、当該プログラム要素に関する基本パスの生成を終了する(ステップ2208)。 In step 2209, the basic path generation unit 205 adds the basic path to the basic path list 217 and completes the generation of the basic path for the program element (step 2208).
以上のように、実施例3においては、基本パス生成時に、基本パスの保守性指標が保守性指標目標値2101未満であるかどうかを判断する。また、値が変更された重複閾値に基づいて基本パスリストを再生成する。これにより、生成される基本パスが開発者可読性ニーズを満たしているかどうかをユーザに柔軟に判断させながら、ソースコード保守性向上のために、プログラム要素の要素分割すべき箇所を提示することができる。 As described above, in Example 3, when generating a basic path, it is determined whether the maintainability index of the basic path is less than the maintainability index target value 2101. In addition, the basic path list is regenerated based on the overlap threshold whose value has been changed. This allows the user to flexibly determine whether the generated basic path meets the developer's readability needs, while also presenting locations where program elements should be split to improve source code maintainability.
実施例4は、実施例2または実施例3で示した分割パスリストの生成後に、さらに分割箇所が示されたソースコードを生成するものである。 In Example 4, after generating the split path list shown in Example 2 or Example 3, source code is generated that further indicates the split locations.
図23は、実施例4における、ソースコード解析装置が備える機能およびソースコード解析装置が記憶するデータを示す概念図である。 Figure 23 is a conceptual diagram showing the functions provided by the source code analysis device and the data stored by the source code analysis device in Example 4.
実施例4に係るソースコード解析装置100は、実施例2または実施例3の場合に加えて、分割箇所マッピング部2301をさらに備える。 The source code analysis device 100 according to the fourth embodiment further includes a division location mapping unit 2301 in addition to the components of the second or third embodiment.
分割箇所マッピング部2301は、解析対象ソースコード208と分割パスリスト218とを取得して、分割箇所が他の部分と区別可能に示されたソースコード2302を生成する。 The division point mapping unit 2301 acquires the analysis target source code 208 and the division path list 218, and generates source code 2302 in which the division points are shown in a manner that makes them distinguishable from other parts.
図24は、分割箇所マッピング部の動作例を示すフローチャートである。 Figure 24 is a flowchart showing an example of the operation of the division point mapping unit.
分割箇所マッピング部2301は、解析対象ソースコード208を読み込む(2401)。分割箇所マッピング部2301は、分割パスリスト218を読み込む(2402)。なお、ステップ2401と2402の順序は問わない。 The division location mapping unit 2301 reads the analysis target source code 208 (2401). The division location mapping unit 2301 reads the division path list 218 (2402). Note that the order of steps 2401 and 2402 does not matter.
分割箇所マッピング部2301は、各プログラム要素Eに対して、ステップ2404-2406の処理を実行する(ステップ2403-2407)。 The division point mapping unit 2301 executes steps 2404-2406 for each program element E (steps 2403-2407).
分割箇所マッピング部2301は、プログラム要素Eが分割パスに含まれるか否かを判定する(2404)。プログラム要素Eが分割パスに含まれる場合(ステップ2404:YES)、ステップ2405へと処理が遷移する。プログラム要素Eが分割パスに含まれない場合(ステップ2404:NO)、ステップ2406へと処理が遷移する。 The division location mapping unit 2301 determines whether program element E is included in the division path (2404). If program element E is included in the division path (step 2404: YES), processing transitions to step 2405. If program element E is not included in the division path (step 2404: NO), processing transitions to step 2406.
ステップ2405において分割箇所マッピング部2301は、分割パスを解析対象ソースコードにマッピングし、分割箇所が示されたソースコード2302を生成する。分割箇所の示し方については特に限定しない。 In step 2405, the division point mapping unit 2301 maps the division paths to the source code to be analyzed, generating source code 2302 in which the division points are indicated. There are no particular limitations on how the division points are indicated.
ステップ2406において分割箇所マッピング部2301は、解析対象ソースコードにおけるマッピングされてない箇所を、分割後のソースコードとして切り出す(2406)。 In step 2406, the division portion mapping unit 2301 extracts the unmapped portions of the source code to be analyzed as the post-division source code (2406).
上記のように、ソースコード解析装置100は、分割パスリストの生成後に、ソースコードの分割箇所を示す。これにより、ソースコードの修正者によるソースコード修正作業を支援することができる。 As described above, the source code analysis device 100 indicates the split locations of the source code after generating the split path list. This can assist the person modifying the source code in their source code modification work.
実施例5は、実施例4における分割箇所が示されたソースコードにおいて、特に分割箇所をプログラムの行またはトークンの単位で示すものである。 Example 5 shows the division points in the source code shown in Example 4, specifically in units of program lines or tokens.
図25は、分割箇所が示されたソースコードの一例を示す図である。 Figure 25 shows an example of source code showing the division points.
分割箇所が示されたソースコード2500は、当該プログラム要素のソースコード2501と、当該プログラム要素のソースコード2501中の1以上の分割対象箇所2502と、当該プログラム要素の分割後のソースコード2503と、当該プログラム要素の保守性指標2504と、当該プログラム要素の分割後のソースコードの保守性指標2505で構成される。 Source code 2500 showing the division points is composed of source code 2501 of the program element, one or more division target points 2502 in source code 2501 of the program element, source code 2503 of the program element after division, maintainability index 2504 of the program element, and maintainability index 2505 of the source code of the program element after division.
上記のように、分割箇所をプログラムの行またはトークンの単位で示すことにより、ソースコード解析装置100は分割前後のソースコードの変更箇所を行またはトークンの単位で明示することができる。そのため、ソースコードの修正者などのユーザが要素分割の結果を把握しやすい。 As described above, by indicating the division locations in units of program lines or tokens, the source code analysis device 100 can clearly indicate the changes in the source code before and after division in units of lines or tokens. This makes it easier for users, such as those who modify the source code, to understand the results of the element division.
実施例6は、実施例5におけるソースコード解析装置による画面表示の一例を示すものである。 Example 6 shows an example of a screen display by the source code analysis device in Example 5.
図26は、ソースコード解析装置の画面遷移を例示する概念図である。画面は、ソースコード解析装置100の出力装置105に表示される。ただし、画面はソースコード解析装置100と通信可能に接続された表示装置に表示されてもよい。例えば、ソースコード解析装置100と通信可能に接続されたクライアント端末が備える表示装置などに画面が表示されてもよい。以下、画面が出力装置105に表示される場合を例示して説明する。 Figure 26 is a conceptual diagram illustrating screen transitions in the source code analysis device. The screen is displayed on the output device 105 of the source code analysis device 100. However, the screen may also be displayed on a display device communicatively connected to the source code analysis device 100. For example, the screen may be displayed on a display device provided in a client terminal communicatively connected to the source code analysis device 100. The following describes an example in which the screen is displayed on the output device 105.
ソースコード解析装置100の画面構成は、解析対象選択画面2601と、解析結果一覧画面2602と、分割箇所表示画面2603から成る。解析対象選択画面2601と、解析結果一覧画面2602との間は双方向に遷移することが可能である。解析結果一覧画面2602と、分割箇所表示画面2603との間は双方向に遷移することが可能である。分割箇所表示画面2603から解析対象選択画面2601へ遷移することが可能である。 The screen configuration of the source code analysis device 100 consists of an analysis target selection screen 2601, an analysis result list screen 2602, and a division location display screen 2603. It is possible to transition between the analysis target selection screen 2601 and the analysis result list screen 2602 in both directions. It is possible to transition between the analysis result list screen 2602 and the division location display screen 2603 in both directions. It is possible to transition from the division location display screen 2603 to the analysis target selection screen 2601.
図27は、解析対象選択画面を例示する概念図である。解析対象選択画面2601は、解析対象選択タブ2701と、解析開始ボタン2702とを有する。 Figure 27 is a conceptual diagram illustrating an example of the analysis target selection screen. The analysis target selection screen 2601 has an analysis target selection tab 2701 and a start analysis button 2702.
解析対象選択タブ2701は、解析対象ソースコード208を選択するための解析対象ソースコード選択部2703と、解析対象プログラム209を選択するための解析対象プログラム選択部2704と、テストケース210を選択するためのテストケース選択部2705と、保守性指標閾値211を選択するための保守性指標閾値選択部2706と、重複閾値212を選択するための重複閾値選択部2707とを有する。 The analysis target selection tab 2701 has an analysis target source code selection section 2703 for selecting the analysis target source code 208, an analysis target program selection section 2704 for selecting the analysis target program 209, a test case selection section 2705 for selecting the test case 210, a maintainability index threshold selection section 2706 for selecting the maintainability index threshold 211, and an overlap threshold selection section 2707 for selecting the overlap threshold 212.
ソースコード解析装置100のユーザは、解析対象ソースコード選択部2703と、解析対象プログラム選択部2704と、テストケース選択部2705と、保守性指標閾値選択部2706と、重複閾値選択部2707とを用いて各データを選択し、解析開始ボタン2702を押下し、解析を開始させる。 The user of the source code analysis device 100 selects each piece of data using the analysis target source code selection unit 2703, the analysis target program selection unit 2704, the test case selection unit 2705, the maintainability index threshold selection unit 2706, and the overlap threshold selection unit 2707, and presses the analysis start button 2702 to begin the analysis.
ユーザが解析開始ボタン2702を押下すると、ソースコード解析装置100内のソースコードメトリクス計算部201と、保守性指標計算部202と、分割候補要素生成部203と、プログラム処理追跡部204と、基本パス生成部205と、設けられている場合は基本パス保守性指標計算部1601と、分割パス生成部206と、設けられている場合は分割箇所マッピング部2301とが、それぞれ上述のような処理を行う。そして、画面は解析結果一覧画面2602へと画面遷移する。 When the user presses the analysis start button 2702, the source code metrics calculation unit 201, maintainability index calculation unit 202, division candidate element generation unit 203, program processing tracking unit 204, basic path generation unit 205, if provided, basic path maintainability index calculation unit 1601, division path generation unit 206, and if provided, division point mapping unit 2301 within the source code analysis device 100 each perform the processing described above. The screen then transitions to the analysis result list screen 2602.
図28は、解析結果一覧画面を例示する概念図である。解析結果一覧画面2602は、解析結果一覧タブ2801と、解析対象選択に戻るボタン2802とを有する。 Figure 28 is a conceptual diagram illustrating an example of the analysis result list screen. The analysis result list screen 2602 has an analysis result list tab 2801 and a button 2802 for returning to analysis target selection.
解析結果一覧タブ2801は、分割パスリスト表示部2803を有する。分割パスリスト表示部2803は、分割パスリスト218に係る内容を表示する。本例では、分割パスレコード1800における、分割すべきプログラム要素の名称と、分割前保守性指標の値と、分割後保守性指標の値とが、分割パスリスト表示部2803に表示されている。 The analysis result list tab 2801 has a split path list display section 2803. The split path list display section 2803 displays the contents of the split path list 218. In this example, the names of the program elements to be split in the split path record 1800, the values of the pre-split maintainability index, and the values of the post-split maintainability index are displayed in the split path list display section 2803.
ソースコード解析装置100のユーザが、分割パスリスト表示部2803中の各分割パスレコード1800における、分割すべきと判断されたプログラム要素名を押下すると、分割箇所マッピング部2301が上述の処理を行う。そして、分割箇所表示画面2603へと画面遷移する。 When the user of the source code analysis device 100 presses the name of a program element that has been determined to be split in each split path record 1800 in the split path list display section 2803, the split point mapping section 2301 performs the above-mentioned processing. The screen then transitions to the split point display screen 2603.
ユーザが、解析対象選択に戻るボタン2802を押下すると、解析対象選択画面2601へと画面遷移する。 When the user presses the "Return to analysis target selection" button 2802, the screen transitions to the analysis target selection screen 2601.
図29は、分割箇所表示画面を例示する概念図である。分割箇所表示画面2603は、分割箇所表示タブ2901と、解析対象選択に戻るボタン2902と、解析結果一覧に戻るボタン2903とを有する。 Figure 29 is a conceptual diagram illustrating the division point display screen. The division point display screen 2603 has a division point display tab 2901, a button 2902 for returning to analysis target selection, and a button 2903 for returning to the analysis results list.
分割箇所表示タブ2901は、ソースコード表示部2904を有する。ソースコード表示部2904は、分割箇所が他の部分と区別可能に示されたソースコード2500を表示する。ソースコード表示部2904は、分割箇所が他の部分と区別可能に示されたソースコード2500と共に、プログラムの分割前後のそれぞれの保守性指標を表示する。ソースコード解析装置100のユーザは、分割箇所表示画面2603を閲覧することにより、ソースコードの分割箇所および分割前後の保守性指標を知ることができる。 The division location display tab 2901 has a source code display section 2904. The source code display section 2904 displays source code 2500 in which the division locations are distinguishable from other parts. The source code display section 2904 displays the maintainability indexes before and after the program division, along with source code 2500 in which the division locations are distinguishable from other parts. By viewing the division location display screen 2603, a user of the source code analysis device 100 can learn the division locations of the source code and the maintainability indexes before and after the division.
ユーザが、解析対象選択に戻るボタン2902を押下すると、解析対象選択画面2601へと画面遷移する。ユーザが、解析結果一覧に戻るボタン2903を押下すると、解析結果一覧画面2602へと画面遷移する。 When the user presses the Return to Analysis Target Selection button 2902, the screen transitions to the analysis target selection screen 2601. When the user presses the Return to Analysis Results List button 2903, the screen transitions to the analysis results list screen 2602.
上述した本発明の実施形態は、本発明の説明のための例示であり、本発明の範囲をそれらの実施形態にのみ限定する趣旨ではない。当業者は、本発明の範囲を逸脱することなしに、他の様々な態様で本発明を実施することができる。 The above-described embodiments of the present invention are illustrative examples of the present invention and are not intended to limit the scope of the present invention to these embodiments alone. Those skilled in the art may implement the present invention in various other forms without departing from the scope of the present invention.
以上のように、プログラム209に対応するソースコード208を解析するソースコード解析装置100が、解析対象となるソースコード208からソースコードメトリクス213を計算するソースコードメトリクス計算部201を備える。ソースコード解析装置100が、ソースコードメトリクス213から保守性指標214を計算する保守性指標計算部202を備える。ソースコード解析装置100が、保守性指標214と保守性指標閾値211とに基づいてプログラムの分割候補要素リスト215を生成する分割候補要素生成部203を備える。ソースコード解析装置100が、ソースコード208とプログラム209とプログラム209に対するテストケース210とから動的情報リスト216を生成するプログラム処理追跡部204を備える。ソースコード解析装置100が、動的情報リスト216と重複閾値212とから基本パスリスト217を生成する基本パス生成部205を備える。ソースコード解析装置100が、分割候補要素リスト215と基本パスリスト217から分割パスリスト218を生成する分割パス生成部206を備える。ソースコード解析装置100が、ソースコード208と、プログラム209と、テストケース210と、保守性指標閾値211と、重複閾値212とに基づいて、保守性指標214と動的情報リスト216とに応じた分割すべきプログラム要素の一覧を生成する。これにより、要素分割すべきプログラム要素について、開発者可読性ニーズに応えながら、要素分割を行うべき箇所を改善箇所として提示することができる。その結果、開発者が1つのソースコードとしてまとまって読みたいと考えるであろう、実行頻度の高い典型的な処理が、開発者の意図に反して分割されずに済む。 As described above, the source code analysis device 100, which analyzes source code 208 corresponding to program 209, includes a source code metrics calculation unit 201 that calculates source code metrics 213 from the source code 208 to be analyzed. The source code analysis device 100 includes a maintainability index calculation unit 202 that calculates a maintainability index 214 from the source code metrics 213. The source code analysis device 100 includes a division candidate element generation unit 203 that generates a division candidate element list 215 for the program based on the maintainability index 214 and a maintainability index threshold 211. The source code analysis device 100 includes a program processing tracking unit 204 that generates a dynamic information list 216 from the source code 208, program 209, and test cases 210 for program 209. The source code analysis device 100 includes a basic path generation unit 205 that generates a basic path list 217 from the dynamic information list 216 and overlap threshold 212. The source code analysis device 100 includes a split path generation unit 206 that generates a split path list 218 from a split candidate element list 215 and a basic path list 217. The source code analysis device 100 generates a list of program elements to be split according to a maintainability index 214 and a dynamic information list 216 based on source code 208, a program 209, test cases 210, a maintainability index threshold 211, and an overlap threshold 212. This makes it possible to present areas for element splitting as areas for improvement for program elements to be split while meeting the developer's readability needs. As a result, typical frequently executed processes that a developer would want to read together as a single source code are not split against the developer's intention.
ソースコード解析装置100が、基本パスリスト217から基本パス保守性指標1602を生成する基本パス保守性指標計算部1601をさらに備え、分割すべきプログラム要素1801の一覧に加え、要素分割前の保守性指標1803と要素分割後の保守性指標1804の一覧を生成する。これにより、要素分割によってどれほど解析対象ソースコードの保守性が向上するかの効果の提示を併せて行うことができる。 The source code analysis device 100 further includes a basic path maintainability index calculation unit 1601 that generates a basic path maintainability index 1602 from the basic path list 217, and generates a list of program elements 1801 to be divided, as well as a list of maintainability indexes before element division 1803 and maintainability indexes after element division 1804. This makes it possible to present the effect of how much the maintainability of the source code being analyzed will be improved by element division.
基本パス生成部205では、基本パスの保守性指標が保守性指標目標値未満であるか否かを判定し、値が変更された重複閾値に基づいて基本パスリストを再生成する。これにより、生成される基本パスが開発者可読性ニーズを満たしているかどうかをユーザに柔軟に判断させながら、ソースコード保守性向上のために、プログラム要素の要素分割すべき箇所を提示することができる。 The basic path generation unit 205 determines whether the maintainability index of the basic path is less than the maintainability index target value, and regenerates the basic path list based on the modified overlap threshold value. This allows the user to flexibly determine whether the generated basic path meets the developer's readability needs, while also presenting locations where program elements should be split to improve source code maintainability.
ソースコード解析装置100が、ソースコード208と分割パスリスト218から、分割箇所が示されたソースコード2302を生成する分割箇所マッピング部2301をさらに備える。これにより、ソースコードの修正者によるソースコード修正作業を支援することができる。 The source code analysis device 100 further includes a division location mapping unit 2301 that generates source code 2302 indicating the division locations from the source code 208 and the division path list 218. This makes it possible to support the source code modification work by the person modifying the source code.
分割箇所マッピング部2301では、分割箇所がプログラムの行またはトークンの単位で示されたソースコード2302を生成する。分割箇所をプログラムの行またはトークンの単位で示すことにより、ソースコード解析装置100は分割前後のソースコードの変更箇所を行またはトークンの単位で明示することができる。そのため、ソースコードの修正者などのユーザに対して、要素分割の結果が把握しやすい態様で分割箇所を提示することができる。 The division location mapping unit 2301 generates source code 2302 in which the division locations are indicated in units of program lines or tokens. By indicating the division locations in units of program lines or tokens, the source code analysis device 100 can clearly show the changes in the source code before and after division in units of lines or tokens. This makes it possible to present the division locations to users, such as those modifying the source code, in a way that makes it easy to understand the results of the element division.
ソースコード解析装置100が、分割箇所が示されたソースコード2500を表示させる。これにより、ユーザがソースコードの分割箇所を知ることができる。 The source code analysis device 100 displays the source code 2500 showing the division locations. This allows the user to know the division locations of the source code.
ソースコード解析装置100が、分割箇所が示されたソースコード2500と共に、プログラムの分割前後のそれぞれの保守性指標を表示させる。これにより、ユーザがソースコードの分割箇所および分割前後の保守性指標を知ることができる。 The source code analysis device 100 displays the maintainability indexes before and after program division along with the source code 2500 showing the division locations. This allows the user to know the division locations of the source code and the maintainability indexes before and after division.
1…処理装置、100…ソースコード解析装置、101…プロセッサ、102…主記憶装置、103…補助記憶装置、104…入力装置、105…出力装置、106…通信装置、201…ソースコードメトリクス計算部、202…保守性指標計算部、203…分割候補要素生成部、204…プログラム処理追跡部、205…基本パス生成部、206…分割パス生成部、207…情報記憶部、208…解析対象ソースコード、209…解析対象プログラム、210…テストケース、211…保守性指標閾値、212…重複閾値、213…ソースコードメトリクス、214…保守性指標、215…分割候補要素リスト、216…動的情報リスト、217…基本パスリスト、218…分割パスリスト、1601…基本パス保守性指標計算部、1602…基本パス保守性指標、2301…分割箇所マッピング部、2601…解析対象選択画面、2602…解析結果一覧画面、2603…分割箇所表示画面、2701…解析対象選択タブ、2702…解析開始ボタン、2703…解析対象ソースコード選択部、2704…解析対象プログラム選択部、2705…テストケース選択部、2706…保守性指標閾値選択部、2707…重複閾値選択部、2801…解析結果一覧タブ、2802、2902、2903…ボタン、2803…分割パスリスト表示部
2901…分割箇所表示タブ、2904…ソースコード表示部
1...processing device, 100...source code analysis device, 101...processor, 102...main storage device, 103...auxiliary storage device, 104...input device, 105...output device, 106...communication device, 201...source code metrics calculation unit, 202...maintainability index calculation unit, 203...division candidate element generation unit, 204...program processing tracking unit, 205...basic path generation unit, 206...division path generation unit, 207...information storage unit, 208...analysis target source code, 209...analysis target program, 210...test case, 211...maintainability index threshold, 212...overlap threshold, 213...source code metrics, 214...maintainability index, 215...division candidate element list, 216...dynamic information list, 217...basic Main path list, 218... split path list, 1601... basic path maintainability index calculation section, 1602... basic path maintainability index, 2301... split location mapping section, 2601... analysis target selection screen, 2602... analysis result list screen, 2603... split location display screen, 2701... analysis target selection tab, 2702... analysis start button, 2703... analysis target source code selection section, 2704... analysis target program selection section, 2705... test case selection section, 2706... maintainability index threshold selection section, 2707... overlap threshold selection section, 2801... analysis result list tab, 2802, 2902, 2903... buttons, 2803... split path list display section, 2901... split location display tab, 2904... source code display section
Claims (9)
解析対象となる前記ソースコードから、前記プログラムに含まれるプログラム要素それぞれのソースコードメトリクスを計算するソースコードメトリクス計算部と、
前記ソースコードメトリクスから前記プログラム要素それぞれの保守性指標を計算する保守性指標計算部と、
前記保守性指標と保守性指標閾値とに基づいて、分割の候補とするプログラム要素を記録した分割候補要素リストを生成する分割候補要素生成部と、
前記ソースコードと前記プログラムと前記プログラムに対するテストケースとから、前記分割候補要素リストに含まれるプログラム要素のそれぞれについて、前記テストケースに基づいて前記プログラムを実行したときに実行される処理に対応する前記ソースコードの部分である実行パスを記録した動的情報リストを生成するプログラム処理追跡部と、
前記動的情報リストと重複閾値とから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記ソースコードの部分のうち、前記テストケースのうち前記動的情報リストに示された前記実行パスに当該部分を含むテストケースの割合が前記重複閾値以上である部分を記録した基本パスリストを生成する基本パス生成部と、
前記分割候補要素リストと前記基本パスリストから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記基本パスリストに含まれない部分を記録した分割パスリストを生成する分割パス生成部とを備える、
ソースコード解析装置。 A source code analysis device that analyzes source code corresponding to a program,
a source code metrics calculation unit that calculates source code metrics of each program element included in the program from the source code to be analyzed;
a maintainability index calculation unit that calculates a maintainability index for each of the program elements from the source code metrics;
a division candidate element generating unit that generates a division candidate element list that records program elements that are candidates for division based on the maintainability index and a maintainability index threshold;
a program processing tracing unit that generates, for each program element included in the division candidate element list, a dynamic information list that records an execution path that is a portion of the source code corresponding to a process that is executed when the program is executed based on the test case, from the source code, the program, and a test case for the program; and
a basic path generation unit that generates, from the dynamic information list and an overlap threshold, a basic path list that records portions of the source code in each of the program elements included in the splitting candidate element list, where the proportion of test cases that include the portions in the execution paths shown in the dynamic information list is equal to or greater than the overlap threshold;
a division path generating unit that generates a division path list from the division candidate element list and the basic path list, the division path list recording parts of each of the program elements included in the division candidate element list that are not included in the basic path list,
Source code analyzer.
請求項1に記載のソースコード解析装置。 a basic path maintainability index calculation unit that generates, from the basic path list, a basic path maintainability index that is a maintainability index for a basic path of a program element included in the division candidate element list,
The source code analysis device according to claim 1 .
請求項2に記載のソースコード解析装置。 the basic path generation unit increases the overlap threshold and regenerates the basic path list if the basic path maintainability index is less than a maintainability index target value;
The source code analysis device according to claim 2 .
請求項1に記載のソースコード解析装置。 a division point mapping unit that generates, from the source code and the division path list, source code in which parts included in the division path list are shown so as to be distinguishable from other parts,
The source code analysis device according to claim 1 .
請求項4に記載のソースコード解析装置。 the division portion mapping unit generates source code in which the portions included in the division path list are indicated in units of program lines or tokens.
The source code analysis device according to claim 4.
請求項4または請求項5に記載のソースコード解析装置。 displaying the source code in which the parts included in the split path list are distinguishable from other parts;
6. The source code analysis device according to claim 4 or 5.
請求項6に記載のソースコード解析装置。 displaying maintainability indicators before and after dividing the program together with source code in which the parts included in the divided path list are shown so as to be distinguishable from other parts;
The source code analysis device according to claim 6.
解析対象となる前記ソースコードから、前記プログラムに含まれるプログラム要素それぞれのソースコードメトリクスを計算し、
前記ソースコードメトリクスから前記プログラム要素のそれぞれの保守性指標を計算し、
前記保守性指標と保守性指標閾値とに基づいて、分割の候補とするプログラム要素を記録した分割候補要素リストを生成し、
前記ソースコードと前記プログラムと前記プログラムに対するテストケースとから、前記分割候補要素リストに含まれるプログラム要素のそれぞれについて、前記テストケースに基づいて前記プログラムを実行したときに実行される処理に対応する前記ソースコードの部分である実行パスを記録した動的情報リストを生成し、
前記動的情報リストと重複閾値とから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記ソースコードの部分のうち、前記テストケースのうち前記動的情報リストに示された前記実行パスに当該部分を含むテストケースの割合が前記重複閾値以上である部分を記録した基本パスリストを生成し、
前記分割候補要素リストと前記基本パスリストから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記基本パスリストに含まれない部分を記録した分割パスリストを生成する、ソースコード解析方法。 A method for analyzing source code corresponding to a program, executed by a device having a processor and a storage device, comprising:
Calculating source code metrics for each program element included in the program from the source code to be analyzed;
calculating a maintainability index for each of the program elements from the source code metrics;
generating a division candidate element list that records program elements that are candidates for division based on the maintainability index and a maintainability index threshold;
generating a dynamic information list for each program element included in the division candidate element list from the source code, the program, and test cases for the program, the dynamic information list recording an execution path that is a portion of the source code corresponding to a process that is executed when the program is executed based on the test cases;
From the dynamic information list and the overlap threshold, generate a basic path list that records, among the portions of the source code in each of the program elements included in the splitting candidate element list, portions of the test cases in which the proportion of test cases that include the portions in the execution paths shown in the dynamic information list is equal to or greater than the overlap threshold;
A source code analysis method for generating a split path list from the split candidate element list and the basic path list, the split path list recording parts of each program element included in the split candidate element list that are not included in the basic path list.
プロセッサと記憶装置とを備えた装置に、
解析対象となる前記ソースコードから、前記プログラムに含まれるプログラム要素それぞれのソースコードメトリクスを計算し、
前記ソースコードメトリクスから前記プログラム要素のそれぞれの保守性指標を計算し、
前記保守性指標と保守性指標閾値とに基づいて、分割の候補とするプログラム要素を記録した分割候補要素リストを生成し、
前記ソースコードと前記プログラムと前記プログラムに対するテストケースとから、前記分割候補要素リストに含まれるプログラム要素のそれぞれについて、前記テストケースに基づいて前記プログラムを実行したときに実行される処理に対応する前記ソースコードの部分である実行パスを記録した動的情報リストを生成し、
前記動的情報リストと重複閾値とから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記ソースコードの部分のうち、前記テストケースのうち前記動的情報リストに示された前記実行パスに当該部分を含むテストケースの割合が前記重複閾値以上である部分を記録した基本パスリストを生成し、
前記分割候補要素リストと前記基本パスリストから、前記分割候補要素リストに含まれるプログラム要素のそれぞれにおける、前記基本パスリストに含まれない部分を記録した分割パスリストを生成する、ことを実行させるためのソースコード解析プログラム。
A source code analysis program that analyzes source code corresponding to a program,
An apparatus having a processor and a storage device,
Calculating source code metrics for each program element included in the program from the source code to be analyzed;
calculating a maintainability index for each of the program elements from the source code metrics;
generating a division candidate element list that records program elements that are candidates for division based on the maintainability index and a maintainability index threshold;
generating a dynamic information list for each program element included in the division candidate element list from the source code, the program, and test cases for the program, the dynamic information list recording an execution path that is a portion of the source code corresponding to a process that is executed when the program is executed based on the test cases;
From the dynamic information list and the overlap threshold, generate a basic path list that records, among the portions of the source code in each of the program elements included in the splitting candidate element list, portions of the test cases in which the proportion of test cases that include the portions in the execution paths shown in the dynamic information list is equal to or greater than the overlap threshold;
A source code analysis program for executing the following: generating a split path list from the split candidate element list and the basic path list, the split path list recording the parts of each program element included in the split candidate element list that are not included in the basic path list.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2022132550A JP7799580B2 (en) | 2022-08-23 | 2022-08-23 | Source code analysis device, source code analysis method, and source code analysis program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2022132550A JP7799580B2 (en) | 2022-08-23 | 2022-08-23 | Source code analysis device, source code analysis method, and source code analysis program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2024030023A JP2024030023A (en) | 2024-03-07 |
| JP7799580B2 true JP7799580B2 (en) | 2026-01-15 |
Family
ID=90105650
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2022132550A Active JP7799580B2 (en) | 2022-08-23 | 2022-08-23 | Source code analysis device, source code analysis method, and source code analysis program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7799580B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120723614B (en) * | 2025-08-29 | 2025-11-21 | 国网信息通信产业集团有限公司 | A Machine Learning-Based Multi-Dimensional Analysis Method and System for App Performance |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005092532A (en) | 2003-09-17 | 2005-04-07 | Fukuoka Pref Gov Sangyo Kagaku Gijutsu Shinko Zaidan | Estimating device |
| JP2008250867A (en) | 2007-03-30 | 2008-10-16 | Fukuoka Pref Gov Sangyo Kagaku Gijutsu Shinko Zaidan | Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium |
| US20140181835A1 (en) | 2012-12-21 | 2014-06-26 | International Business Machines Corporation | Hybrid dependency analysis using dynamic and static analyses |
| JP2019219848A (en) | 2018-06-19 | 2019-12-26 | クラリオン株式会社 | Source code analysis method and source code analysis device |
-
2022
- 2022-08-23 JP JP2022132550A patent/JP7799580B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005092532A (en) | 2003-09-17 | 2005-04-07 | Fukuoka Pref Gov Sangyo Kagaku Gijutsu Shinko Zaidan | Estimating device |
| JP2008250867A (en) | 2007-03-30 | 2008-10-16 | Fukuoka Pref Gov Sangyo Kagaku Gijutsu Shinko Zaidan | Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium |
| US20140181835A1 (en) | 2012-12-21 | 2014-06-26 | International Business Machines Corporation | Hybrid dependency analysis using dynamic and static analyses |
| JP2019219848A (en) | 2018-06-19 | 2019-12-26 | クラリオン株式会社 | Source code analysis method and source code analysis device |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2024030023A (en) | 2024-03-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7051269B2 (en) | Systems and methods for summarizing and visualizing trace data | |
| US11762720B2 (en) | Information processing apparatus and non-transitory computer-readable storage medium for storing API use history display program | |
| CN114116441A (en) | UI (user interface) testing method and device, electronic equipment and storage medium | |
| CN103109264A (en) | Creating a configuration file template | |
| US9619364B2 (en) | Grouping and analysis of data access hazard reports | |
| CN110618926A (en) | Source code analysis method and source code analysis device | |
| CN115840673A (en) | Generating visualizations of code statement blocks related to errors in log files | |
| CN105278945A (en) | Program visualization device, program visualization method, and program visualization program | |
| US9996606B2 (en) | Method for determining condition of category division of key performance indicator, and computer and computer program therefor | |
| JP7799580B2 (en) | Source code analysis device, source code analysis method, and source code analysis program | |
| CN114822700A (en) | Methods, devices and media for rendering rearranged or fused structural isoforms | |
| US8782626B2 (en) | Search suggestions for static code analysis | |
| CN113742240A (en) | User interface testing method and device, storage medium and electronic equipment | |
| US20100251211A1 (en) | Generating and using code-based diagrams | |
| JP2007025497A (en) | Education support program and education support device | |
| CN114020257B (en) | Coding assistance method, device, equipment and storage medium | |
| JP6402637B2 (en) | Analysis program, analysis method, and analysis apparatus | |
| CN110866492B (en) | Baseline branch identification method and device and computer system | |
| EP4475027A1 (en) | Change history reproduction apparatus, change history reproduction method, and change history reproduction program | |
| CN117217628B (en) | Carbon credit project rating method and device | |
| US20230325295A1 (en) | Information processing system, information processing device, and information processing method | |
| JP2024090191A (en) | Refactoring effect evaluation device, refactoring effect evaluation method, and program | |
| JP5686687B2 (en) | Information processing apparatus, information processing method, and program | |
| JP7145919B2 (en) | ADVICE DATA GENERATION DEVICE, ADVICE DATA GENERATION METHOD, AND PROGRAM | |
| JP4721344B2 (en) | Word search device, word search method and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20240820 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20250221 |
|
| TRDD | Decision of grant or rejection written | ||
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20251128 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20251202 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20251226 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7799580 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |