[go: up one dir, main page]

JP7480082B2 - Software development support device, method and program - Google Patents

Software development support device, method and program Download PDF

Info

Publication number
JP7480082B2
JP7480082B2 JP2021036370A JP2021036370A JP7480082B2 JP 7480082 B2 JP7480082 B2 JP 7480082B2 JP 2021036370 A JP2021036370 A JP 2021036370A JP 2021036370 A JP2021036370 A JP 2021036370A JP 7480082 B2 JP7480082 B2 JP 7480082B2
Authority
JP
Japan
Prior art keywords
line
branch
source code
measurement
input
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
Application number
JP2021036370A
Other languages
Japanese (ja)
Other versions
JP2022136658A (en
Inventor
雄磨 松本
里奈 田中
信之 池田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2021036370A priority Critical patent/JP7480082B2/en
Publication of JP2022136658A publication Critical patent/JP2022136658A/en
Application granted granted Critical
Publication of JP7480082B2 publication Critical patent/JP7480082B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Description

本発明の実施形態は、ソフトウェア開発支援装置、方法及びプログラムに関する。 Embodiments of the present invention relate to a software development support device, method, and program.

一般に、ソフトウェア製品の開発は、パーソナルコンピュータ等の情報処理装置上で提供される統合開発環境(IDE:Integrated Development Environment)において行われることが知られている。IDEは、ソフトウェア製品の総合的な開発環境であり、様々なツールの集合から構成される。 It is generally known that software products are developed in an integrated development environment (IDE) provided on an information processing device such as a personal computer. An IDE is a comprehensive development environment for software products, and is made up of a collection of various tools.

このようなIDEを構成する様々なツールを用いることによって、効率的なソフトウェア製品の開発が可能となる。 By using the various tools that make up such an IDE, it becomes possible to develop software products efficiently.

ところで、上記したソフトウェア製品の開発においては必要に応じてソースコードを編集(改修)することがあるが、当該ソースコードの特定の箇所に対して行われた変更は当該ソースコード中の他の箇所に影響を与える可能性がある。具体的には、ソースコードにおいて記述されている変数に対する値が変更された場合、当該変数が読み取られる箇所(リード箇所)に影響を与えることがある。ソースコードの編集時に、このような変数に対する値の変更が当該リード箇所に与える影響を見落としていると、不具合の原因となる。 In the development of the above-mentioned software products, the source code may be edited (modified) as necessary, but changes made to a specific part of the source code may affect other parts of the source code. Specifically, if the value of a variable written in the source code is changed, this may affect the part where the variable is read (the read part). If the impact of such a change in the value of a variable on the read part is overlooked when editing the source code, it may cause a malfunction.

このため、上記したソースコードを編集する作業(ソースコードに対する編集作業)を支援する仕組みが望まれている。 For this reason, there is a need for a mechanism to assist with the source code editing task described above (editing source code).

特開2013-125466号公報JP 2013-125466 A

そこで、本発明が解決しようとする課題は、ソースコードに対する編集作業を支援することが可能なソフトウェア開発支援装置、方法及びプログラムを提供することにある。 The problem that this invention aims to solve is to provide a software development support device, method, and program that can support editing work on source code.

実施形態に係るソフトウェア開発支援装置は、取得手段と、入力手段と、特定手段と、計測手段と、表示手段とを具備する。前記取得手段は、プログラム言語を用いて記述された変数及び条件分岐を含む複数の行から構成されるソースコードを取得する。前記入力手段は、前記取得されたソースコードにおいて値が変更された変数及び当該変数に対する値が変更された行を示す第1行番号を入力する。前記特定手段は、前記取得されたソースコードを構成する複数の行のうち、前記入力された変数が読み取られる行を示す第2行番号を特定する。前記計測手段は、前記入力された第1行番号によって示される行から前記特定された第2行番号によって示される行までの実行経路中に記述されている条件分岐の数を計測する。前記表示手段は、前記計測された条件分岐の数に基づいて前記特定された第2行番号を表示する。 The software development support device according to the embodiment includes an acquisition means, an input means, a specification means, a measurement means, and a display means. The acquisition means acquires source code consisting of a plurality of lines including variables and conditional branches written in a programming language. The input means inputs a first line number indicating a variable whose value has been changed in the acquired source code and a line in which the value for the variable has been changed. The specification means specifies a second line number indicating a line from which the input variable is read, among the plurality of lines constituting the acquired source code. The measurement means measures the number of conditional branches described in the execution path from the line indicated by the input first line number to the line indicated by the specified second line number. The display means displays the specified second line number based on the measured number of conditional branches.

実施形態に係るソフトウェア開発支援装置の機能構成の一例を示すブロック図。FIG. 2 is a block diagram showing an example of a functional configuration of the software development support device according to the embodiment. ソフトウェア開発支援装置のシステム構成の一例を示す図。FIG. 1 is a diagram showing an example of a system configuration of a software development support device. ソフトウェア開発支援装置の処理手順の一例を示すフローチャート。1 is a flowchart showing an example of a processing procedure of a software development support device. ソースコードの一例を示す図。FIG. 13 is a diagram showing an example of source code. リード箇所及びライト箇所の一例を示す図。FIG. 13 is a diagram showing an example of a read location and a write location. 分岐数計測処理の処理内容の一例を示す図。11 is a diagram showing an example of the process contents of a branch number measurement process. FIG. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「7」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “7”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「10」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining a branch number measurement process executed for a lead point “10”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. リード箇所「13」について実行される分岐数計測処理について説明するための図。FIG. 13 is a diagram for explaining the branch number measurement process executed for the lead point “13”. 分岐数計測処理の概略を示す図。FIG. 13 is a diagram showing an outline of a branch number measurement process. 表示されるリード箇所の一例について説明するための図。FIG. 13 is a diagram for explaining an example of a displayed lead location.

以下、図面を参照して、実施形態について説明する。
本実施形態に係るソフトウェア開発支援装置は、ソフトウェア開発におけるソースコードに対する編集作業(改修作業)を支援するために用いられる。
Hereinafter, an embodiment will be described with reference to the drawings.
The software development support device according to this embodiment is used to support editing (modification) of source code in software development.

なお、ソフトウェア開発支援装置10は、ソフトウェア製品の開発作業(ソフトウェア製品を実現するためのソースコードの編集作業等)の際にユーザによって使用されるパーソナルコンピュータ等の情報処理装置であり、統合開発環境(以下、IDEと表記)を当該ユーザに提供する。IDEは様々なツールの集合から構成されており、ユーザは、当該IDEを構成する様々なツールを用いて効率的なソフトウェア製品の開発を行うことができる。 The software development support device 10 is an information processing device such as a personal computer that is used by a user when developing a software product (such as editing source code to realize the software product), and provides the user with an integrated development environment (hereinafter referred to as IDE). The IDE is made up of a collection of various tools, and the user can efficiently develop a software product using the various tools that make up the IDE.

図1は、本実施形態に係るソフトウェア開発支援装置の機能構成の一例を示すブロック図である。図1に示すように、ソフトウェア開発支援装置10は、格納部11、入力部12、計測部13及び表示部14を含む。 Figure 1 is a block diagram showing an example of the functional configuration of a software development support device according to this embodiment. As shown in Figure 1, the software development support device 10 includes a storage unit 11, an input unit 12, a measurement unit 13, and a display unit 14.

格納部11には、ソフトウェア製品を実現するためのソースコードが格納されている。格納部11に格納されているソースコードは例えば複数の行から構成されており、当該ソースコードを構成する複数の行の各々には、所定のプログラミング言語を用いて記述された変数や条件分岐等が記述されている。 The storage unit 11 stores source code for realizing a software product. The source code stored in the storage unit 11 is composed of, for example, multiple lines, and each of the multiple lines constituting the source code describes variables, conditional branches, etc., written in a specific programming language.

ここで、上記したIDEを構成するツールを用いることによってユーザ(ソフトウェア製品の開発者)は上記したソースコードを編集することができるが、当該ソースコードの編集において、当該ソースコードに記述されている変数に対する値が変更された場合を想定する。このような変数に対する値の変更は、ソースコード中に記述されている当該変数(に対する値)が読み取られる箇所に影響を与え、結果として不具合の発生につながることがある。 Now, let us consider a case where a user (software product developer) can edit the above-mentioned source code by using the tools that make up the above-mentioned IDE, but when editing the source code, the value of a variable written in the source code is changed. Such a change in the value of a variable affects the location where the variable (or its value) written in the source code is read, which can result in the occurrence of a malfunction.

このため、ソースコード中の変数に対する値を変更するような場合には当該変更が及ぼす影響等を十分に検討しておく必要があるが、当該変数に対する値が変更された箇所(行)から当該変数が読み取られる箇所(行)までの実行経路が複雑である場合、ユーザは当該実行経路(シナリオ)を確認することが困難であり、上記した変数に対する値の変更が与える影響を見落とす可能性がある。なお、本実施形態における変数としてはソースコード中に記述(設定)されている様々な変数が含まれるが、グローバル変数(に対する値)が変更された場合には、当該変更による影響が大きく、不具合が発生しやすい。 For this reason, when changing the value of a variable in the source code, it is necessary to thoroughly consider the impact of the change, but if the execution path from the point (line) where the value of the variable was changed to the point (line) where the variable is read is complex, it is difficult for the user to check the execution path (scenario), and there is a possibility that the impact of the change to the value of the variable mentioned above will be overlooked. Note that, although the variables in this embodiment include various variables written (set) in the source code, when a global variable (its value) is changed, the impact of the change is large and malfunctions are likely to occur.

そこで、本実施形態においては、上記したように変数に対する値が変更された箇所から当該変数が読み取られる箇所までの実行経路中に条件分岐が多いほど当該変更が与える影響を見落とす可能性が高くなるという観点に基づき、当該影響の見落としを防止するための構成を有する。 Therefore, in this embodiment, based on the viewpoint that the more conditional branches there are in the execution path from the point where the value of a variable is changed to the point where the variable is read, the greater the possibility that the impact of the change will be overlooked, the more likely it is that the impact will be overlooked.

入力部12は、格納部11に格納されているソースコードにおいて値が変更された変数(以下、調査対象変数と表記)及び当該変数に対する値が変更された行を示す行番号(以下、調査起点箇所と表記)を入力する。 The input unit 12 inputs variables whose values have been changed in the source code stored in the storage unit 11 (hereinafter referred to as the variables to be investigated) and line numbers indicating the lines in which the values of the variables have been changed (hereinafter referred to as the investigation starting point).

計測部13は、格納部11に格納されているソースコードを取得する。計測部13は、取得されたソースコードを構成する複数の行のうち、調査対象変数が読み取られる行を示す行番号(以下、リード箇所と表記)を特定する。なお、計測部13によって特定されるリード箇所は、複数であっても構わない。 The measurement unit 13 acquires the source code stored in the storage unit 11. The measurement unit 13 identifies a line number (hereinafter, referred to as a read location) indicating a line from which a variable to be investigated is read, among multiple lines constituting the acquired source code. Note that the number of read locations identified by the measurement unit 13 may be multiple.

計測部13は、入力部12によって入力された調査起点箇所から当該計測部13によって特定されたリード箇所までの実行経路中に記述されている条件分岐の数(以下、分岐数と表記)を計測する。なお、本実施形態における分岐数とは、上記した実行経路中において条件分岐が記述されている行(を示す行番号)の数をいう。 The measurement unit 13 measures the number of conditional branches (hereinafter referred to as the number of branches) described in the execution path from the investigation starting point input by the input unit 12 to the lead point identified by the measurement unit 13. Note that the number of branches in this embodiment refers to the number of lines (line numbers indicating the lines) in which conditional branches are described in the execution path described above.

表示部14は、計測部13によって計測された分岐数に基づいてリード箇所を表示する。この場合、上記したように分岐数が多いほどリード箇所に与える影響を見落とす可能性が高くなるとの観点から、表示部14は、例えば計測部13によって計測された分岐数が多い(つまり、調査起点箇所からリード箇所までの条件分岐の数が大きい)リード箇所を表示する。 The display unit 14 displays the lead point based on the number of branches measured by the measurement unit 13. In this case, from the viewpoint that the greater the number of branches as described above, the greater the possibility of overlooking the influence on the lead point, the display unit 14 displays, for example, lead points with a greater number of branches measured by the measurement unit 13 (i.e., a greater number of conditional branches from the investigation starting point to the lead point).

なお、図1においては省略されているが、ソフトウェア開発支援装置10は、格納部11、入力部12、計測部13及び表示部14以外に、上記したIDEを構成する様々なツールによって実現される機能部を有しているものとする。 Although omitted in FIG. 1, the software development support device 10 has functional units realized by various tools that constitute the IDE described above, in addition to the storage unit 11, input unit 12, measurement unit 13, and display unit 14.

図2は、図1に示すソフトウェア開発支援装置10のシステム構成の一例を示す。図2に示すように、ソフトウェア開発支援装置10は、CPU101、不揮発性メモリ102、主メモリ103、BIOS-ROM104、システムコントローラ105、入力デバイス106、表示デバイス107及びエンベデッドコントローラ(EC)108等を備える。 Figure 2 shows an example of the system configuration of the software development support device 10 shown in Figure 1. As shown in Figure 2, the software development support device 10 includes a CPU 101, a non-volatile memory 102, a main memory 103, a BIOS-ROM 104, a system controller 105, an input device 106, a display device 107, and an embedded controller (EC) 108.

CPU101は、ソフトウェア開発支援装置10内の各コンポーネントの動作を制御するプロセッサである。CPU101は、ストレージデバイスである不揮発性メモリ102から主メモリ103にロードされる様々なプログラムを実行する。このプログラムには、オペレーティングシステム(OS)、ユーザに対してIDEを提供するためのアプリケーションプログラム及び当該アプリケーションプログラム(ツール)に組み込まれるプラグイン等が含まれる。 The CPU 101 is a processor that controls the operation of each component in the software development support device 10. The CPU 101 executes various programs that are loaded from the non-volatile memory 102, which is a storage device, to the main memory 103. These programs include an operating system (OS), application programs for providing an IDE to the user, and plug-ins that are incorporated into the application programs (tools), etc.

なお、CPU101は、BIOS-ROM104に格納された基本入出力システム(BIOS)も実行する。BIOSは、ハードウェア制御のためのプログラムである。 The CPU 101 also executes the basic input/output system (BIOS) stored in the BIOS-ROM 104. The BIOS is a program for controlling hardware.

システムコントローラ105は、CPU101のローカルバスと各種コンポーネントとの間を接続するデバイスである。 The system controller 105 is a device that connects the local bus of the CPU 101 to various components.

入力デバイス106は、例えばキーボード及びマウス等を含む。表示デバイス107は、例えば液晶表示装置のようなディスプレイ等を含む。EC108は、電力管理のためのワンチップマイクロコンピュータである。 The input device 106 includes, for example, a keyboard and a mouse. The display device 107 includes, for example, a display such as a liquid crystal display device. The EC 108 is a one-chip microcomputer for power management.

図2においては、CPU101、不揮発性メモリ102、主メモリ103、BIOS-ROM104、システムコントローラ105、入力デバイス106、表示デバイス107及びEC108のみが示されているが、ソフトウェア開発支援装置10は、例えばHDD(Hard Disk Drive)及びSSD(Solid State Drive)のような他の記憶装置を備えていてもよいし、外部装置との通信を実行するように構成された通信デバイス等を備えていてもよい。 In FIG. 2, only the CPU 101, non-volatile memory 102, main memory 103, BIOS-ROM 104, system controller 105, input device 106, display device 107, and EC 108 are shown, but the software development support device 10 may also include other storage devices such as a hard disk drive (HDD) and a solid state drive (SSD), or may also include a communication device configured to communicate with an external device.

なお、本実施形態において、上記した図1に示す格納部11は、例えば図2に示す不揮発性メモリ102または他の記憶装置等によって実現される。 In this embodiment, the storage unit 11 shown in FIG. 1 is realized, for example, by the non-volatile memory 102 shown in FIG. 2 or another storage device.

また、図1に示す各部12~14の一部または全ては、例えば図2に示すCPU101(つまり、ソフトウェア開発支援装置10のコンピュータ)にIDEを提供するためのアプリケーションプログラム及び当該アプリケーションプログラムに組み込まれるプラグインを実行させること、すなわちソフトウェアによって実現されるものとする。 In addition, some or all of the units 12 to 14 shown in FIG. 1 are realized by software, for example, by executing an application program for providing an IDE to the CPU 101 (i.e., the computer of the software development support device 10) shown in FIG. 2 and a plug-in incorporated in the application program.

ここでは、各部12~14の一部または全てがソフトウェアによって実現されるものとして説明したが、当該各部12~14の一部または全ては、例えばハードウェアによって実現されてもよいし、ソフトウェア及びハードウェアの組み合わせによって実現されてもよい。 Here, some or all of the units 12 to 14 have been described as being realized by software, but some or all of the units 12 to 14 may also be realized by hardware, for example, or a combination of software and hardware.

次に、図3のフローチャートを参照して、本実施形態に係るソフトウェア開発支援装置10の処理手順の一例について説明する。 Next, an example of the processing procedure of the software development support device 10 according to this embodiment will be described with reference to the flowchart in FIG.

まず、ソフトウェア開発支援装置10を使用するユーザは、上記したIDEを構成するツールを用いて例えば格納部11に格納されているソースコードに対する編集作業を行うことができる。 First, a user of the software development support device 10 can use the tools that make up the IDE described above to perform editing work on source code stored in the storage unit 11, for example.

このような編集作業においてソースコードに記述されている変数に対する値が変更された場合、入力部12は、上記した調査対象変数及び調査起点箇所を入力する(ステップS1)。 When the value of a variable written in the source code is changed during such editing work, the input unit 12 inputs the above-mentioned variables to be investigated and the investigation starting point (step S1).

なお、入力部12によって入力される調査対象変数及び調査起点箇所は、ソフトウェア開発支援装置10(入力デバイス106)を操作するユーザによって指定される。この場合、調査対象変数及び調査起点箇所を例えばソースコード(が表示された領域)上で指定することができるようなユーザインタフェース(UI)が提供されてもよい。 The variables to be investigated and the investigation starting point input by the input unit 12 are specified by a user who operates the software development support device 10 (input device 106). In this case, a user interface (UI) may be provided that allows the variables to be investigated and the investigation starting point to be specified, for example, on the source code (the area in which the source code is displayed).

ステップS1の処理が実行されると、計測部13は、格納部11に格納されているソースコードを、当該格納部11から取得する(ステップS2)。 When the processing of step S1 is executed, the measurement unit 13 retrieves the source code stored in the storage unit 11 from the storage unit 11 (step S2).

ステップS2の処理が実行されると、計測部13は、空のリード箇所リスト、計測終了箇所リスト及び分岐数表を生成(用意)する(ステップS3)。 When the processing of step S2 is executed, the measurement unit 13 generates (prepares) an empty read location list, a measurement end location list, and a branch number table (step S3).

次に、計測部13は、ステップS2において取得されたソースコードを解析し、当該ソースコードを構成する複数の行のうち、ステップS1において入力された調査対象変数(に対する値)が読み取られる行を示す行番号をリード箇所として特定し、当該リード箇所をステップS3において生成された空のリード箇所リストに追加する(ステップS4)。なお、ステップS4においてリード箇所リストに追加されるリード箇所は、複数であってもよい。 Next, the measurement unit 13 analyzes the source code acquired in step S2, and identifies, among the multiple lines constituting the source code, the line number indicating the line from which the (value for) the variable to be investigated input in step S1 is read as a lead point, and adds the lead point to the empty lead point list generated in step S3 (step S4). Note that there may be multiple lead points added to the lead point list in step S4.

また、計測部13は、ステップS2において取得されたソースコードを解析し、当該ソースコードを構成する複数の行のうち、ステップS1において入力された調査対象変数に対する値が上書きされている行を示す行番号(以下、ライト箇所と表記)特定し、当該ライト箇所を計測終了箇所としてステップS3において生成された空の計測終了箇所リストに追加する(ステップS5)。 The measurement unit 13 also analyzes the source code acquired in step S2, identifies the line number (hereinafter referred to as the write location) indicating the line in which the value of the variable to be investigated input in step S1 has been overwritten among the multiple lines constituting the source code, and adds the write location as the measurement end location to the empty measurement end location list generated in step S3 (step S5).

計測終了箇所リストに追加される計測終了箇所は、後述する分岐数の計測を終了するか否かを判定するために用いられる。具体的には、例えば調査起点箇所(調査対象変数に対する値が変更された箇所)以降の実行経路中で当該調査対象変数に対する値が上書きされた場合、当該当該調査起点箇所における調査対象変数に対する値の変更は、当該上書きされた箇所(つまり、ライト箇所)以降には影響を及ぼさない。このため、ライト箇所を計測終了箇所として計測終了箇所リストに追加しておくことにより、例えば実行経路が当該ライト箇所(計測終了箇所)を通る場合には、分岐数の計測を終了することができる。 The measurement end point added to the measurement end point list is used to determine whether or not to end the measurement of the number of branches, which will be described later. Specifically, for example, if the value of the variable being investigated is overwritten in the execution path after the investigation start point (the point where the value of the variable being investigated was changed), the change in the value of the variable being investigated at the investigation start point does not affect the point where it was overwritten (i.e., the write point) and beyond. For this reason, by adding the write point to the measurement end point list as a measurement end point, it is possible to end the measurement of the number of branches, for example, if the execution path passes through the write point (measurement end point).

なお、ステップS5において計測終了箇所リストに追加されるライト箇所は、複数であってもよい。ただし、上記した調査起点箇所(つまり、変更された値が書き込まれている箇所)は、ライト箇所には含まれない。 Note that there may be multiple write locations added to the measurement end location list in step S5. However, the above-mentioned investigation start location (i.e., the location where the changed value is written) is not included in the write locations.

上記したステップS4及びS5において実行されるソースコードの解析は、例えばIDEを構成するツールを用いて実行することができる。なお、このようなIDEを構成するツールを用いたソースコードの解析によれば、例えば所定の変数(例えば、調査対象変数)に対して、当該変数がアクセスされている行を示す行番号及び当該アクセスの種別(リードまたはライト等)を取得することが可能である。 The analysis of the source code performed in steps S4 and S5 described above can be performed using, for example, a tool that constitutes an IDE. By analyzing the source code using such a tool that constitutes an IDE, it is possible to obtain, for example, for a specific variable (e.g., a variable to be investigated), the line number indicating the line in which the variable is accessed and the type of access (read, write, etc.).

次に、計測部13は、ステップS1において入力された調査起点箇所、ステップS4においてリード箇所が追加されたリード箇所リスト及びステップS5において計測終了箇所(ライト箇所)が追加された計測終了箇所リストに基づいて、分岐数計測処理を実行する(ステップS6)。 Next, the measurement unit 13 executes a branch count measurement process (step S6) based on the investigation start point input in step S1, the read point list to which the read point was added in step S4, and the measurement end point list to which the measurement end point (write point) was added in step S5.

この分岐数計測処理はリード箇所リストに含まれるリード箇所毎に実行され、調査起点箇所から当該リード箇所までの実行経路中の分岐数が計測される。 This branch count measurement process is executed for each read point included in the read point list, and the number of branches in the execution path from the investigation start point to the read point is measured.

ステップS6の処理が実行されると、上記したリード箇所リストに追加されたリード箇所及び当該リード箇所について計測された分岐数がステップS3において生成された空の分岐数表に追加される。 When the process of step S6 is executed, the lead points added to the lead point list described above and the branch counts measured for those lead points are added to the empty branch count table generated in step S3.

表示部14は、上記した分岐数表(に追加された分岐数)に基づいてリード箇所を例えば表示デバイス107に表示する(ステップS7)。この場合、表示部14は、分岐数表を参照して、分岐数が最も多いリード箇所を表示してもよいし、分岐数が予め定められた値以上であるリード箇所を表示してもよい。なお、ステップS7においては、分岐数表(つまり、リード箇所に加えて更に分岐数)が表示されても構わない。 The display unit 14 displays the lead locations on, for example, the display device 107 based on the branch number table (the number of branches added to the branch number table) described above (step S7). In this case, the display unit 14 may refer to the branch number table to display the lead location with the largest number of branches, or may display the lead location with a number of branches equal to or greater than a predetermined value. Note that in step S7, the branch number table (i.e., the number of branches in addition to the lead locations) may also be displayed.

上記した図3に示す処理によれば、調査対象変数に対する値の変更が影響与える箇所(リード箇所)を分岐数という観点から評価し、当該評価結果(分岐数)に基づいて当該影響を見落とす可能性が高い箇所をユーザに対して提示することができる。 According to the process shown in Figure 3 above, the locations (lead locations) affected by a change in the value of the variable being investigated are evaluated from the perspective of the number of branches, and the locations where the impact is likely to be overlooked can be presented to the user based on the evaluation results (number of branches).

以下、本実施形態に係るソフトウェア開発支援装置10の動作について詳細に説明する。まず、図4は、格納部11に格納されているソースコードの一例を示す。 The operation of the software development support device 10 according to this embodiment will be described in detail below. First, FIG. 4 shows an example of source code stored in the storage unit 11.

図4に示す例では、ソースコードは1行目~14行目から構成されており、当該ソースコードの3行目には変数「gvar」が記述されている。 In the example shown in Figure 4, the source code is composed of lines 1 to 14, and the variable "gvar" is written in line 3 of the source code.

このようなソースコードの編集作業において3行目に記述されている変数「gvar」に対する値が図4に示すように0に変更されたものとすると、上記した入力部12は、調査対象変数として「gvar」及び調査起点箇所(調査起点行番号)として「3(行目)」を入力する。 If the value of the variable "gvar" written on line 3 during such source code editing work is changed to 0 as shown in FIG. 4, the input unit 12 described above inputs "gvar" as the variable to be investigated and "3 (line)" as the investigation starting point (investigation starting line number).

次に、図4に示すソースコードにおいて、調査対象変数「gvar」の値が読み取られる箇所(つまり、リード箇所)は、7行目、10行目及び13行目である。この場合、リード箇所リストには、リード箇所として「7(行目)」、「10(行目)」及び「13(行目)」が追加される。 Next, in the source code shown in Figure 4, the locations where the value of the investigated variable "gvar" is read (i.e., the read locations) are lines 7, 10, and 13. In this case, "line 7," "line 10," and "line 13" are added as read locations to the read location list.

一方、図4に示すソースコードにおいて、調査対象変数「gvar」に対する値が上書きされる箇所(つまり、ライト箇所)は、6行目である。この場合、計測終了箇所リストには、計測終了箇所として「6(行目)」が追加される。 On the other hand, in the source code shown in Figure 4, the location where the value of the target variable "gvar" is overwritten (i.e., the write location) is line 6. In this case, "line 6" is added to the measurement end location list as the measurement end location.

なお、図5は、上記したように調査対象変数が「gvar」である場合におけるリード箇所及びライト箇所を示している。 Note that Figure 5 shows the read and write locations when the variable being investigated is "gvar" as described above.

以下、上記した調査起点箇所、リード箇所リスト及び計測終了箇所リストに基づいて、分岐数計測処理が実行される。 Then, the branch number measurement process is executed based on the above-mentioned investigation start point, lead point list, and measurement end point list.

分岐数計測処理は、上記したようにリード箇所リストに追加されたリード箇所毎に実行される。この場合、分岐数計測処理における入力は調査起点箇所、リード箇所及び計測終了箇所リストであり、当該分岐数計測処理における出力は、分岐数である。 The branch count measurement process is executed for each read point added to the read point list as described above. In this case, the inputs to the branch count measurement process are the investigation start point, the read point, and the measurement end point list, and the output of the branch count measurement process is the number of branches.

具体的には、調査起点箇所をs、リード箇所をd、計測終了箇所リストをAとすると、分岐数計測処理における出力である分岐数は、s(行目)から辿ってAに含まれる計測終了箇所を通らずにd(行目)に到達する実行経路(つまり、調査起点箇所からリード箇所までの実行経路)中に記述されている条件分岐の数である。ただし、調査起点箇所からリード箇所までの実行経路が複数存在する場合は、当該複数の実行経路の中の最小の分岐数が計測される。 Specifically, if the investigation start point is s, the read point is d, and the measurement end point list is A, the branch count, which is the output of the branch count measurement process, is the number of conditional branches described in the execution path that can be traced from s (line) to d (line) without passing through the measurement end point included in A (i.e., the execution path from the investigation start point to the read point). However, if there are multiple execution paths from the investigation start point to the read point, the smallest number of branches among those multiple execution paths is measured.

なお、調査起点箇所sからリード箇所dまでの実行経路においてAに含まれる計測終了箇所を通らずにdに到達することができない場合、分岐数計測処理における出力は「∞」となる。 If it is not possible to reach d on the execution path from the investigation start point s to the lead point d without passing through the measurement end point included in A, the output of the branch count measurement process will be "∞".

ここで、図6は分岐数計測処理の処理内容(定義)を示しており、分岐数計測処理は、当該図6に示す処理内容に従って実行される。以下、図6に基づく分岐数計測処理について具体的に説明する。 Here, FIG. 6 shows the process contents (definition) of the branch number measurement process, and the branch number measurement process is executed according to the process contents shown in FIG. 6. Below, the branch number measurement process based on FIG. 6 will be specifically explained.

ここでは、図4に示すソースコードから特定されたリード箇所「7」、「10」及び「13」がリード箇所リストに追加されており、当該ソースコードから特定されたライト箇所「6」が計測終了箇所リストAに計測終了箇所として追加されているものとして説明する。この場合、リード箇所「7」、「10」及び「13」の各々について分岐数計測処理が実行される。 Here, we will assume that the read locations "7", "10", and "13" identified from the source code shown in Figure 4 have been added to the read location list, and the write location "6" identified from the source code has been added as a measurement end location to the measurement end location list A. In this case, the branch number measurement process is executed for each of the read locations "7", "10", and "13".

まず、リード箇所「7」について実行される分岐数計測処理について説明する。この場合、計測部13は、図7に示すように、調査起点箇所s「3(行目)」、リード箇所d「7(行目)」及び計測終了箇所リストA「6(行目)」を入力として分岐数計測処理を実行する。なお、図7に示すように、s「3」、d「7」、A「6」を入力として実行される分岐数計測処理は、分岐数計測(3,7,[6])と表すものとする。以下の説明についても同様である。 First, the branch count measurement process executed for lead location "7" will be described. In this case, as shown in FIG. 7, the measurement unit 13 executes the branch count measurement process using the investigation start location s "3 (line)", the lead location d "7 (line)", and the measurement end location list A "6 (line)" as inputs. Note that as shown in FIG. 7, the branch count measurement process executed using s "3", d "7", and A "6" as inputs will be represented as branch count measurement (3, 7, [6]). The same applies to the following explanation.

ここで、調査起点箇所sは「3」であり、ソースコードの3行目には、条件分岐は記述されていない。上記した図6によれば、sが条件分岐ではない場合には、当該sを計測終了箇所リストAに追加するとともに、当該sを次に実行される行番号(ここでは、「4」)とした上で、新たなs、d、Aを入力とした分岐数計測処理が再度実行される(つまり、再帰呼び出しされる)ことが示されている。この場合、図8に示すように、分岐数計測(4,7,[6,3])が実行される。このように計測終了箇所リストに分岐数計測処理が実行された行番号を追加することによって、実行経路においてリード箇所に到達する前に同一の箇所を通るような場合に分岐数の計測(分岐数計測処理)を終了することができる。 Here, the investigation starting point s is "3", and no conditional branch is written on the third line of the source code. According to FIG. 6, if s is not a conditional branch, the s is added to the measurement end point list A, and the s is set as the next line number to be executed (here, "4"), and the branch number measurement process is executed again with new s, d, and A as inputs (i.e., a recursive call is made). In this case, as shown in FIG. 8, the branch number measurement (4, 7, [6, 3]) is executed. By adding the line number where the branch number measurement process was executed to the measurement end point list in this way, it is possible to end the branch number measurement (branch number measurement process) when the execution path passes through the same point before reaching the lead point.

分岐数計測処理の入力が行番号s「4」、リード箇所d「7」及び計測終了箇所リストA「6,3」である場合、ソースコードの4行目には、while文(つまり、条件分岐)が記述されている。上記した図6によれば、sが条件分岐である場合には、当該sを計測終了箇所リストAに追加するとともに、当該sを当該条件がtrueであるときに次に実行される行番号(ここでは、「5」)とした上で、新たなs、d、Aを入力とした分岐数計測が再度実行されることが示されている。この場合、図9に示すように、分岐数計測(5,7,[6,3,4])が実行される。 If the input for the branch count measurement process is line number s "4", read location d "7", and measurement end location list A "6, 3", a while statement (i.e., a conditional branch) is written in the fourth line of the source code. According to FIG. 6 above, if s is a conditional branch, s is added to measurement end location list A, and s is set as the line number to be executed next when the condition is true (here, "5"), and branch count measurement is executed again with new s, d, and A as input. In this case, as shown in FIG. 9, branch count measurement (5, 7, [6, 3, 4]) is executed.

なお、図5によれば、sが条件分岐である場合にはr1及びr2のうちの値が小さい方に1を加算した値を返すこと示されているが、r1は条件がtrueであるときに新たなs、d、Aを入力として再度実行される分岐数計測処理における出力(return)を示し、r2は条件がfalseであるときに新たなs、d、Aを入力として再度実行される分岐数計測処理における出力(return)を示す。よって、この時点では上記した行番号s「4」、リード箇所d「7」、計測終了箇所リストA「6,3」を入力とした分岐数計測処理の出力を得ることはできない。 Note that according to FIG. 5, when s is a conditional branch, the smaller of the values of r1 and r2 is added and a value is returned. However, r1 indicates the output (return) of the branch number measurement process that is executed again with new s, d, and A as inputs when the condition is true, and r2 indicates the output (return) of the branch number measurement process that is executed again with new s, d, and A as inputs when the condition is false. Therefore, at this point, it is not possible to obtain the output of the branch number measurement process that uses the above-mentioned line number s "4", read location d "7", and measurement end location list A "6, 3" as inputs.

分岐数計測処理の入力が行番号s「5」、リード箇所d「7」及び計測終了箇所リストA「6,3,4」である場合、ソースコードの5行目には、if文(つまり、条件分岐)が記述されている。上記した図6によれば、sが条件分岐である場合には、当該sを計測終了箇所リストAに追加するとともに、当該sを当該条件がtrueであるときに次に実行される行番号(ここでは、「6」)とした上で、新たなs、d、Aを入力とした分岐数計測処理が再度実行されることが示されている。この場合、図10に示すように、分岐数計測(6,7,[6,3,4,5])が実行される。 If the input for the branch count measurement process is line number s "5", read location d "7", and measurement end location list A "6, 3, 4", then an if statement (i.e., a conditional branch) is written in line 5 of the source code. According to FIG. 6 above, if s is a conditional branch, then s is added to measurement end location list A, and s is set as the line number (here, "6") that will be executed next when the condition is true, and the branch count measurement process is executed again with new s, d, and A as inputs. In this case, as shown in FIG. 10, branch count measurement (6, 7, [6, 3, 4, 5]) is executed.

分岐数計測処理の入力が行番号s「6」、リード箇所d「7」及び計測終了箇所リストA「6,3,4,5」である場合、ソースコードの6行目は、計測終了箇所リストAに含まれている。上記した図6によれば、sがAに含まれる場合には「∞」返すことが示されている。よって、分岐数計測(6,7,[6,3,4,5])の出力は、図10に示すように「∞」となる。 If the input for the branch count measurement process is line number s "6", read location d "7", and measurement end location list A "6, 3, 4, 5", the sixth line of the source code is included in measurement end location list A. According to Figure 6 above, if s is included in A, "∞" is returned. Therefore, the output of branch count measurement (6, 7, [6, 3, 4, 5]) is "∞", as shown in Figure 10.

ここで、上記したようにソースコードの5行目には条件分岐が記述されているが、上記した図6によれば、sが条件分岐である場合には、当該sを計測終了箇所リストAに追加するとともに、当該sを当該条件がfalseであるときに次に実行される行番号(ここでは、「9」)とした上で、新たなs、d、Aを入力とした分岐数計測処理が再度実行されることが示されている。この場合、図11に示すように、分岐数計測(9,7,[6,3,4,5])が実行される。 As mentioned above, a conditional branch is written on line 5 of the source code, but according to FIG. 6, if s is a conditional branch, s is added to the measurement end point list A, and s is set to the line number (here, "9") that will be executed next when the condition is false, and the branch count measurement process is executed again with new s, d, and A as inputs. In this case, as shown in FIG. 11, branch count measurement (9, 7, [6, 3, 4, 5]) is executed.

分岐数計測処理の入力が行番号s「9」、リード箇所d「7」及び計測終了箇所リストA「6,3,4,5」である場合、ソースコードの9行目には、条件分岐は記述されていない。この場合、図12に示すように、分岐数計測(10,7,[6,3,4,5,9])が実行される。 When the input for the branch count measurement process is line number s "9", lead location d "7" and measurement end location list A "6, 3, 4, 5", no conditional branch is described on line 9 of the source code. In this case, as shown in Figure 12, branch count measurement (10, 7, [6, 3, 4, 5, 9]) is executed.

分岐数計測処理の入力が行番号s「10」、リード箇所d「7」及び計測終了箇所リストA「6,3,4,5,9」である場合、ソースコードの10行目には、条件分岐は記述されていない。なお、上記したソースコードの4行目に記述されているwhile文は処理を繰り返すため、行番号sが「10」である場合、次に実行される行番号は「4」である。この場合、図13に示すように、分岐数計測(4,7,[6,3,4,5,9,10])が実行される。 If the input for the branch count measurement process is line number s "10", lead location d "7", and measurement end location list A "6, 3, 4, 5, 9", then no conditional branch is described on line 10 of the source code. Note that since the while statement described on line 4 of the above source code repeats processing, when line number s is "10", the next line number to be executed is "4". In this case, as shown in Figure 13, branch count measurement (4, 7, [6, 3, 4, 5, 9, 10]) is executed.

分岐数計測処理の入力が行番号s「4」、リード箇所d「7」及び計測終了箇所リストA「6,3,4,5,9,10」である場合、ソースコードの4行目は、計測終了箇所リストAに含まれている。この場合、分岐数計測(4,7,[6,3,4,5,9,10])の出力は、図13に示すように「∞」となる。 If the input for the branch count measurement process is line number s "4", read location d "7", and measurement end location list A "6, 3, 4, 5, 9, 10", the fourth line of the source code is included in measurement end location list A. In this case, the output of branch count measurement (4, 7, [6, 3, 4, 5, 9, 10]) is "∞", as shown in Figure 13.

更に、上記した分岐数計測(4,7,[6,3,4,5,9,10])は、分岐数計測(10,7,[6,3,4,5,9])の出力を得るために再帰呼び出しによって実行される処理である。このため、分岐数計測(4,7,[6,3,4,5,9,10])の出力が「∞」である場合、図13に示すように分岐数計測(10,7,[6,3,4,5,9])の出力も「∞」となる。分岐数計測(10,7,[6,3,4,5,9])の前に実行される分岐数計測(9,7,[6,3,4,5])の出力も同様に「∞」となる。 Furthermore, the branch number measurement (4, 7, [6, 3, 4, 5, 9, 10]) described above is a process executed by recursive call to obtain the output of branch number measurement (10, 7, [6, 3, 4, 5, 9]). Therefore, if the output of branch number measurement (4, 7, [6, 3, 4, 5, 9, 10]) is "∞", the output of branch number measurement (10, 7, [6, 3, 4, 5, 9]) will also be "∞" as shown in Figure 13. The output of branch number measurement (9, 7, [6, 3, 4, 5]) executed before branch number measurement (10, 7, [6, 3, 4, 5, 9]) will also be "∞".

上記したようにsが条件分岐である場合にはr1及びr2のうちの値が小さい方に1を加算した値を返すが、条件分岐が記述されている5行目についての分岐数計測(5,7,[6,3,4])に着目すると、r1(つまり、分岐数計測(6,7,[6,3,4,5]の出力)及びr2(つまり、分岐数計測(9,7,[6,3,4,5]の出力)のうちの値が小さい方に1を加算した値は「∞+1」である。この場合、「∞+1」は「∞」と同値とみなすことができるため、分岐数計測(5,7,[6,3,4])の出力は、図14に示すように「∞」となる。 As described above, when s is a conditional branch, the smaller of r1 and r2 is added to the value returned. However, if we look at the branch count measurement (5, 7, [6, 3, 4]) for the 5th line where the conditional branch is described, the smaller of r1 (i.e., the output of branch count measurement (6, 7, [6, 3, 4, 5]) and r2 (i.e., the output of branch count measurement (9, 7, [6, 3, 4, 5])) is added to the value "∞ + 1". In this case, "∞ + 1" can be considered to be the same value as "∞", so the output of branch count measurement (5, 7, [6, 3, 4]) is "∞", as shown in Figure 14.

次に、上記したようにソースコードの4行目には条件分岐が記述されているが、上記した図6によれば、sが条件分岐である場合には、当該sを計測終了箇所リストAに追加するとともに、当該sを当該条件がfalseであるときに次に実行される行番号(ここでは、「12」)とした上で、新たなs、d、Aを入力とした分岐数計測処理が再度実行されることが示されている。この場合、図15に示すように、分岐数計測(12,7,[6,3,4])が実行される。 Next, as mentioned above, a conditional branch is written on line 4 of the source code, but according to FIG. 6, if s is a conditional branch, s is added to the measurement end point list A, and s is set as the line number (here, "12") that will be executed next when the condition is false, and the branch count measurement process is executed again with new s, d, and A as inputs. In this case, as shown in FIG. 15, branch count measurement (12, 7, [6, 3, 4]) is executed.

分岐数計測処理の入力が行番号s「12」、リード箇所d「7」及び計測終了箇所リストA「6,3,4」である場合、ソースコードの12行目には、条件分岐は記述されていない。この場合、図16に示すように、分岐数計測(13,7、[6,3,4,12])が実行される。 When the input for the branch count measurement process is line number s "12", read location d "7" and measurement end location list A "6, 3, 4", no conditional branch is described on line 12 of the source code. In this case, as shown in Figure 16, branch count measurement (13, 7, [6, 3, 4, 12]) is executed.

分岐数計測処理の入力が行番号s「13」、リード箇所d「7」及び計測終了箇所リストA「6,3,4,12」である場合、ソースコードの13行目は、当該ソースコードの最後の行であり、次に実行される行は存在しない。上記した図6によれば、sの次に実行される行が存在しない場合には「∞」を返すことが示されている。よって、分岐数計測(13,7,[6,3,4,12])の出力は、図16に示すように「∞」となる。分岐数計測(13,7,[6,3,4,12])の前に実行される分岐数計測(12,7,[6,3,4])の出力も同様に「∞」となる。 If the input for the branch count measurement process is line number s "13", read location d "7", and measurement end location list A "6, 3, 4, 12", then line 13 of the source code is the last line of the source code, and there is no line to be executed next. According to FIG. 6 above, if there is no line to be executed after s, "∞" is returned. Therefore, the output of branch count measurement (13, 7, [6, 3, 4, 12]) is "∞", as shown in FIG. 16. The output of branch count measurement (12, 7, [6, 3, 4]) executed before branch count measurement (13, 7, [6, 3, 4, 12]) is also "∞".

上記したようにsが条件分岐である場合にはr1及びr2のうちの値が小さい方に1を加算した値を返すが、条件分岐が記述されている4行目についての分岐数計測(4,7、[6,3])に着目すると、r1(つまり、分岐数計測(5,7、[6,3,4])の出力)及びr2(つまり、分岐数計測(12,7、[6,3,4])の出力)のうちの値が小さい方に1を加算した値は「∞+1」である。この場合、「∞+1」は「∞」と同値とみなすことができるため、分岐数計測(4,7,[6,3])の出力は、図17に示すように「∞」となる。分岐数計測(4,7,[6,3])の前に実行される分岐数計測(3,7,[6])の出力も同様に「∞」となる。 As described above, when s is a conditional branch, the smaller of r1 and r2 is added to the value returned. However, when we look at the branch count measurement (4, 7, [6, 3]) for the fourth line where the conditional branch is described, the smaller of r1 (i.e., the output of branch count measurement (5, 7, [6, 3, 4])) and r2 (i.e., the output of branch count measurement (12, 7, [6, 3, 4])) is added to the value "∞ + 1". In this case, since "∞ + 1" can be considered to be the same value as "∞", the output of branch count measurement (4, 7, [6, 3]) is "∞", as shown in Figure 17. The output of branch count measurement (3, 7, [6]) executed before branch count measurement (4, 7, [6, 3]) is also "∞".

上記したようにリード箇所「7」について分岐数計測処理が実行された場合、図7~図17において説明したように処理を繰り返すことにより、当該分岐数計測処理の出力として「∞」が得られる。この分岐数計測処理の出力「∞」は、調査起点箇所である3行目から計測終了箇所リストに含まれる計測終了箇所(例えば、6行目)を通らずにリード箇所である7行目に到達することができないことを示している。 When the branch count measurement process is executed for the lead point "7" as described above, "∞" is obtained as the output of the branch count measurement process by repeating the process as described in Figures 7 to 17. The output of this branch count measurement process, "∞", indicates that it is not possible to reach the lead point, line 7, from the investigation start point, line 3, without passing through a measurement end point (e.g. line 6) included in the measurement end point list.

次に、リード箇所「10」について実行される分岐数計測処理について説明する。この場合、計測部13は、図18に示すように、調査起点箇所s「3」、リード箇所d「10」及び計測終了箇所リストA「6」を入力として分岐数計測処理(つまり、分岐数計測(3,10,[6]))を実行する。 Next, the branch count measurement process executed for the read location "10" will be described. In this case, as shown in FIG. 18, the measurement unit 13 executes the branch count measurement process (i.e., branch count measurement (3, 10, [6])) using the investigation start location s "3", the read location d "10", and the measurement end location list A "6" as input.

ここで、調査起点箇所sは「3」であり、ソースコードの3行目には、条件分岐は記述されていない。この場合、図19に示すように、分岐数計測(4,10,[6,3])が実行される。 Here, the investigation starting point s is "3", and no conditional branch is described on the third line of the source code. In this case, as shown in FIG. 19, the branch count measurement (4, 10, [6, 3]) is executed.

分岐数計測処理の入力が行番号s「4」、リード箇所d「10」及び計測終了箇所リストA「6,3」である場合、ソースコードの4行目には、条件分岐が記述されている。この場合、図20に示すように、分岐数計測(5,10,[6,3,4])が実行される。なお、この分岐数計測処理における行番号s「5」は、行番号s「4」に記述されている条件(分岐)がtrueであるときに次に実行される行番号である。 When the input for the branch count measurement process is line number s "4", lead location d "10", and measurement end location list A "6, 3", a conditional branch is described in the fourth line of the source code. In this case, as shown in FIG. 20, branch count measurement (5, 10, [6, 3, 4]) is executed. Note that line number s "5" in this branch count measurement process is the line number that will be executed next when the condition (branch) described in line number s "4" is true.

分岐数計測処理の入力が行番号s「5」、リード箇所d「10」及び計測終了箇所リストA「6,3,4」である場合、ソースコードの5行目には、条件分岐が記述されている。この場合、図21に示すように、分岐数計測(6,10,[6,3,4,5])が実行される。この分岐数計測処理における行番号s「6」は、行番号s「5」に記述されている条件(分岐)がtrueであるときに次に実行される行番号である。 If the input for the branch count measurement process is line number s "5", lead location d "10", and measurement end location list A "6, 3, 4", a conditional branch is described in the fifth line of the source code. In this case, as shown in FIG. 21, branch count measurement (6, 10, [6, 3, 4, 5]) is executed. Line number s "6" in this branch count measurement process is the line number that will be executed next when the condition (branch) described in line number s "5" is true.

分岐数計測処理の入力が行番号s「6」、リード箇所d「10」及び計測終了箇所リストA「6,3,4,5」である場合、ソースコードの6行目は、計測終了箇所リストAに含まれている。この場合、分岐数計測(6,10,[6,3,4,5])の出力は、図21に示すように「∞」となる。 When the input of the branch count measurement process is line number s "6", read location d "10", and measurement end location list A "6, 3, 4, 5", the 6th line of the source code is included in measurement end location list A. In this case, the output of branch count measurement (6, 10, [6, 3, 4, 5]) is "∞" as shown in Figure 21.

ここで、上記したようにソースコードの5行目には条件分岐が記述されているため、図22に示すように、分岐数計測(9,10,[6,3,4,5])が実行される。なお、この分岐数計測処理における行番号s「9」は、行番号s「5」に記述されている条件(分岐)がfalseであるときに次に実行される行番号である。 As described above, since a conditional branch is written on line 5 of the source code, branch count measurement (9, 10, [6, 3, 4, 5]) is executed as shown in FIG. 22. Note that line number s "9" in this branch count process is the line number that will be executed next when the condition (branch) written on line number s "5" is false.

分岐数計測処理の入力が行番号s「9」、リード箇所d「10」及び計測終了箇所リストA「6,3,4,5」である場合、ソースコードの9行目には、条件分岐は記述されていない。この場合、図23に示すように、分岐数計測(10,10,[6,3,4,5,9])が実行される。 When the input for the branch count measurement process is line number s "9", lead location d "10", and measurement end location list A "6, 3, 4, 5", no conditional branch is described on line 9 of the source code. In this case, as shown in Figure 23, branch count measurement (10, 10, [6, 3, 4, 5, 9]) is executed.

分岐数計測処理の入力が行番号s「10」、リード箇所d「10」及び計測終了箇所リストA「6,3,4,5,9」である場合、ソースコードの10行目は、リード箇所d「10」と一致する。上記した図6によれば、sがdと一致する場合には「0」を返すことが示されている。よって、分岐数計測(10,10,[6,3,4,5,9])の出力は、図23に示すように「0」となる。分岐数計測(10,10,[6,3,4,5,9])の前に実行される分岐数計測(9,10,[6,3,4,5])の出力も同様に「0」となる。 If the input for the branch count measurement process is line number s "10", read location d "10", and measurement end location list A "6, 3, 4, 5, 9", then the 10th line of the source code matches read location d "10". According to Figure 6 above, if s matches d, "0" is returned. Therefore, the output of branch count measurement (10, 10, [6, 3, 4, 5, 9]) is "0", as shown in Figure 23. The output of branch count measurement (9, 10, [6, 3, 4, 5]) executed before branch count measurement (10, 10, [6, 3, 4, 5, 9]) is also "0".

ここで、上記したようにsが条件分岐である場合にはr1及びr2のうちの値が小さい方に1を加算した値を返すが、条件分岐が記述されている5行目についての分岐数計測(5,10、[6,3,4])に着目すると、r1(つまり、分岐数計測(6,10、[6,3,4,5])の出力)及びr2(つまり、分岐数計測(9,10、[6,3,4,5])の出力)のうちの値が小さい方は「0」であり、当該値に1を加算した値は「1」である。この場合、分岐数計測(5,10,[6,3,4])の出力は、図24に示すように「1」となる。本実施形態においては、このようにr1及びr2のうちの値が小さい方に1を加算した値を返すことにより、同一のリード箇所に到達するまでに複数の実行経路が存在する場合には、当該複数の実行経路の中から最小の分岐数を選択することができる。 Here, as described above, when s is a conditional branch, the smaller of r1 and r2 is added to the value returned. However, when we look at the branch count measurement (5, 10, [6, 3, 4]) for the fifth line in which the conditional branch is described, the smaller of r1 (i.e., the output of branch count measurement (6, 10, [6, 3, 4, 5])) and r2 (i.e., the output of branch count measurement (9, 10, [6, 3, 4, 5])) is "0", and the value obtained by adding 1 to this value is "1". In this case, the output of branch count measurement (5, 10, [6, 3, 4]) is "1" as shown in FIG. 24. In this embodiment, by returning the smaller of r1 and r2 in this way, when there are multiple execution paths leading to the same lead point, the smallest number of branches can be selected from the multiple execution paths.

次に、上記したようにソースコードの4行目には条件分岐が記述されているため、図25に示すように、分岐数計測(12,10,[6,3,4])が実行される。なお、この分岐数計測処理における行番号s「12」は、行番号s「4」に記述されている条件(分岐)がfalseであるときに次に実行される行番号である。 Next, since a conditional branch is described on line 4 of the source code as described above, branch count measurement (12, 10, [6, 3, 4]) is executed as shown in FIG. 25. Note that line number s "12" in this branch count process is the line number that will be executed next when the condition (branch) described on line number s "4" is false.

分岐数計測処理の入力が行番号s「12」、リード箇所d「10」及び計測終了箇所リストA「6,3,4」である場合、ソースコードの12行目には、条件分岐は記述されていない。この場合、図26に示すように、分岐数計測(13,10,[6,3,4,12])が実行される。 When the input for the branch count measurement process is line number s "12", read location d "10", and measurement end location list A "6, 3, 4", no conditional branch is described on line 12 of the source code. In this case, as shown in Figure 26, branch count measurement (13, 10, [6, 3, 4, 12]) is executed.

分岐数計測処理の入力が行番号s「13」、リード箇所d「10」及び計測終了箇所リストA「6,3,4,12」である場合、ソースコードの13行目は、当該ソースコードの最後の行であり、次に実行される行は存在しない。この場合、分岐数計測(13,10,[6,3,4,12])の出力は、図26に示すように「∞」となる。分岐数計測(13,10,[6,3,4,12])の前に実行される分岐数計測(12,10,[6,3,4])の出力も同様に「∞」となる。 If the input for the branch count measurement process is line number s "13", read location d "10", and measurement end location list A "6, 3, 4, 12", then line 13 of the source code is the last line of the source code, and there is no line to be executed next. In this case, the output of branch count measurement (13, 10, [6, 3, 4, 12]) will be "∞" as shown in Figure 26. The output of branch count measurement (12, 10, [6, 3, 4]) executed before branch count measurement (13, 10, [6, 3, 4, 12]) will also be "∞".

ここで、上記したようにsが条件分岐である場合にはr1及びr2のうちの値が小さい方に1を加算した値を返すが、条件分岐が記述されている4行目についての分岐数計測(4,10,[6,3])に着目すると、r1(つまり、分岐数計測(5,10,[6,3,4])の出力)及びr2(つまり、分岐数計測(12,10,[6,3,4])の出力)のうちの値が小さい方は「1」であり、当該値に1を加算した値は「2」である。この場合、分岐数計測(4,10,[6,3])の出力は、図27に示すように「2」となる。分岐数計測(4,10,[6,3])の前に実行される分岐数計測(3,10,[6])の出力も同様に「2」となる。 As described above, when s is a conditional branch, the smaller of r1 and r2 is added to the value returned. However, when we look at the branch count measurement (4, 10, [6, 3]) for the fourth line where the conditional branch is described, the smaller of r1 (i.e., the output of branch count measurement (5, 10, [6, 3, 4])) and r2 (i.e., the output of branch count measurement (12, 10, [6, 3, 4])) is "1", and the value obtained by adding 1 to this value is "2". In this case, the output of branch count measurement (4, 10, [6, 3]) is "2" as shown in FIG. 27. The output of branch count measurement (3, 10, [6]) executed before branch count measurement (4, 10, [6, 3]) is also "2".

上記したようにリード箇所「10」について分岐数計測処理が実行された場合、図18~図27において説明したように処理を繰り返すことにより、当該分岐数計測処理の出力として「2」が得られる。この分岐数計測処理の出力「2」は、調査起点箇所である3行目から計測終了箇所リストに含まれる計測終了箇所(例えば、6行目)を通らずにリード箇所である10行目に到達するまでに条件分岐が2つ存在することを示している。 When the branch count measurement process is executed for the read point "10" as described above, the output of the branch count measurement process is "2" by repeating the process as described in Figures 18 to 27. This output of the branch count measurement process, "2", indicates that there are two conditional branches from the investigation start point, line 3, to the read point, line 10, without passing through a measurement end point (e.g. line 6) included in the measurement end point list.

次に、リード箇所「13」について実行される分岐数計測処理について説明する。この場合、計測部13は、図28に示すように、調査起点箇所s「3」、リード箇所d「13」及び計測終了箇所リストA「6」を入力として分岐数計測処理(つまり、分岐数計測(3,13,[6]))を実行する。 Next, the branch count measurement process executed for the read location "13" will be described. In this case, as shown in FIG. 28, the measurement unit 13 executes the branch count measurement process (i.e., branch count measurement (3, 13, [6])) using the investigation start point s "3", the read location d "13", and the measurement end location list A "6" as input.

ここで、調査起点箇所sは「3」であり、ソースコードの3行目には、条件分岐は記述されていない。この場合、図29に示すように、分岐数計測(4,13,[6,3])が実行される。 Here, the investigation starting point s is "3", and no conditional branch is described on the third line of the source code. In this case, as shown in FIG. 29, the branch count measurement (4, 13, [6, 3]) is executed.

分岐数計測処理の入力が行番号s「4」、リード箇所d「13」及び計測終了箇所リスト「6,3」である場合、ソースコードの4行目には、条件分岐が記述されている。この場合、図30に示すように、分岐数計測(5,13,[6,3,4])が実行される。なお、この分岐計測処理における行番号s「5」は、行番号s「4」に記述されている条件(分岐)がtrueであるときに次に実行される行番号である。 When the input for the branch count measurement process is line number s "4", lead location d "13", and measurement end location list "6, 3", a conditional branch is described in the fourth line of the source code. In this case, as shown in FIG. 30, branch count measurement (5, 13, [6, 3, 4]) is executed. Note that line number s "5" in this branch measurement process is the line number that is executed next when the condition (branch) described in line number s "4" is true.

分岐数計測処理の入力が行番号s「5」、リード箇所d「13」及び計測終了箇所リストA「6,3,4」である場合、ソースコードの5行目には、条件分岐が記述されている。この場合、図31に示すように、分岐数計測(6,13,[6,3,4,5])が実行される。この分岐数計測処理における行番号s「6」は、行番号s「5」に記述されている条件(分岐)がtrueであるときに次に実行される行番号である。 If the input for the branch count measurement process is line number s "5", lead location d "13", and measurement end location list A "6, 3, 4", a conditional branch is described in the fifth line of the source code. In this case, as shown in FIG. 31, branch count measurement (6, 13, [6, 3, 4, 5]) is executed. Line number s "6" in this branch count measurement process is the line number that will be executed next when the condition (branch) described in line number s "5" is true.

分岐数計測処理の入力が行番号s「6」、リード箇所d「13」及び計測終了箇所リストA「6,3,4,5」である場合、ソースコードの6行目は、計測終了箇所リストAに含まれている。この場合、分岐数計測(6,13,[6,3,4,5])の出力は、図31に示すように「∞」となる。 If the input for the branch count measurement process is line number s "6", read location d "13", and measurement end location list A "6, 3, 4, 5", the sixth line of the source code is included in measurement end location list A. In this case, the output of branch count measurement (6, 13, [6, 3, 4, 5]) is "∞", as shown in Figure 31.

ここで、上記したようにソースコードの5行目には条件分岐が記述されているため、図32に示すように、分岐数計測(9,13,[6,3,4,5])が実行される。なお、この分岐数計測処理における行番号s「9」は、行番号s「5」に記述されている条件(分岐)がfalseであるときに次に実行される行番号である。 As described above, since a conditional branch is written on line 5 of the source code, the branch count measurement (9, 13, [6, 3, 4, 5]) is executed as shown in FIG. 32. Note that line number s "9" in this branch count process is the line number that will be executed next when the condition (branch) written on line number s "5" is false.

分岐数計測処理の入力が行番号s「9」、リード箇所d「13」及び計測終了箇所リストA「6,3,4,5」である場合、ソースコードの9行目には、条件分岐は記述されていない。この場合、図33に示すように、分岐数計測(10,13,[6,3,4,5,9])が実行される。 When the input for the branch count measurement process is line number s "9", lead location d "13", and measurement end location list A "6, 3, 4, 5", no conditional branch is described on line 9 of the source code. In this case, as shown in Figure 33, branch count measurement (10, 13, [6, 3, 4, 5, 9]) is executed.

分岐数計測処理の入力が行番号s「10」、リード箇所d「13」及び計測終了箇所リストA「6,3,4,5,9」である場合、ソースコードの10行目には、条件分岐は記述されていない。なお、上記したソースコードの4行目に記述されているwhile文は処理を繰り返すため、行番号s「10」である場合、次に実行される行番号は「4」である。この場合、図34に示すように、分岐数計測(4,13,[6,3,4,5,9,10])が実行される。 If the input for the branch count measurement process is line number s "10", lead location d "13", and measurement end location list A "6, 3, 4, 5, 9", then no conditional branch is described on line 10 of the source code. Note that since the while statement described on line 4 of the above source code repeats processing, when line number s is "10", the next line number to be executed is "4". In this case, as shown in Figure 34, branch count measurement (4, 13, [6, 3, 4, 5, 9, 10]) is executed.

分岐数計測処理の入力が行番号s「4」、リード箇所d「13」及び計測終了箇所リストA「6,3,4,5,9,10」である場合、ソースコードの4行目は、計測終了箇所リストAに含まれている。この場合、分岐数計測(4,13,[6,3,4,5,9,10])の出力は、図34に示すように「∞」となる。同様に、上記した分岐数計測(4,13,[6,3,4,5,9,10])の前に実行される分岐数計測(10,13,[6,3,4,5,9])の出力も同様に「∞」となり、当該分岐数計測(10,13,[6,3,4,5,9])の前に実行される分岐数計測(9,13,[6,3,4,5])の出力も同様に「∞」となる。 If the input for the branch number measurement process is line number s "4", read location d "13", and measurement end location list A "6, 3, 4, 5, 9, 10", the fourth line of the source code is included in measurement end location list A. In this case, the output of branch number measurement (4, 13, [6, 3, 4, 5, 9, 10]) is "∞" as shown in FIG. 34. Similarly, the output of branch number measurement (10, 13, [6, 3, 4, 5, 9]) executed before the above branch number measurement (4, 13, [6, 3, 4, 5, 9, 10]) is also "∞", and the output of branch number measurement (9, 13, [6, 3, 4, 5]) executed before the branch number measurement (10, 13, [6, 3, 4, 5, 9]) is also "∞".

ここで、上記したようにsが条件分岐である場合にはr1及びr2のうちの値が小さい方に1を加算した値を返すが、条件分岐が記述されている5行目についての分岐数計測(5,13,[6,3,4])に着目すると、r1(つまり、分岐数計測(6,13,[6,3,4,5])の出力)及びr2(つまり、分岐数計測(9,13,[6,3,4,5]の出力)のうちの値が小さい方に1を加算した値は「∞+1」である。上記したように「∞+1」は「∞」と同値とみなすことができるため、分岐数計測(5,13,[6,3,4])の出力は、図35に示すように「∞」となる。 As described above, when s is a conditional branch, the smaller of r1 and r2 is added to the value returned. However, if we look at the branch count measurement (5, 13, [6, 3, 4]) for line 5, where the conditional branch is described, the smaller of r1 (i.e., the output of branch count measurement (6, 13, [6, 3, 4, 5])) and r2 (i.e., the output of branch count measurement (9, 13, [6, 3, 4, 5])) is added to the value "∞ + 1". As described above, "∞ + 1" can be considered to be the same value as "∞", so the output of branch count measurement (5, 13, [6, 3, 4]) is "∞", as shown in Figure 35.

次に、上記したようにソースコードの4行目には条件分岐が記述されているため、図36に示すように、分岐数計測(12,13,[6,3,4])が実行される。なお、この分岐数計測処理における行番号s「12」は、行番号s「4」に記述されている条件(分岐)がfalseであるときに次に実行される行番号である。 Next, since a conditional branch is described on line 4 of the source code as described above, branch count measurement (12, 13, [6, 3, 4]) is executed as shown in FIG. 36. Note that line number s "12" in this branch count process is the line number that will be executed next when the condition (branch) described on line number s "4" is false.

分岐数計測処理の入力が行番号s「12」、リード箇所d「13」及び計測終了箇所リストA「6,3,4」である場合、ソースコードの12行目には、条件分岐は記述されていない。この場合、図37に示すように、分岐数計測(13,13,[6,3,4,12])が実行される。 When the input for the branch count measurement process is line number s "12", read location d "13", and measurement end location list A "6, 3, 4", no conditional branch is described on line 12 of the source code. In this case, as shown in Figure 37, branch count measurement (13, 13, [6, 3, 4, 12]) is executed.

分岐数計測処理の入力が行番号s「13」、リード箇所d「13」及び計測終了箇所リストA「6,3,4,12」である場合、ソースコードの13行目は、リード箇所d「13」と一致する。この場合、分岐数計測(13,13,[6,3,4,12])の出力は、図37に示すように「0」となる。分岐数計測(13,13,[6,3,4,12])の前に実行される分岐数計測(12,13,[6,3,4])の出力も同様に「0」となる。 If the input for the branch count measurement process is line number s "13", read location d "13", and measurement end location list A "6, 3, 4, 12", the 13th line of the source code matches read location d "13". In this case, the output of branch count measurement (13, 13, [6, 3, 4, 12]) is "0" as shown in Figure 37. The output of branch count measurement (12, 13, [6, 3, 4]) executed before branch count measurement (13, 13, [6, 3, 4, 12]) is also "0".

ここで、上記したようにsが条件分岐である場合にはr1及びr2のうちの値が小さい方に1を加算した値を返すが、条件分岐が記述されている4行目についての分岐数計測(4,13,[6,3])に着目すると、r1(つまり、分岐数計測(5,13,[6,3,4]の出力)及びr2(つまり、分岐数計測(12,13,[6,3,4])の出力)のうちの値が小さい方は「0」であり、当該値に1を加算した値は「1」である。この場合、分岐数計測(4,13,[6,3])の出力は、図38に示すように「1」となる。分岐数計測(4,13,[6,3])の前に実行される分岐数計測(3,13,[6])の出力も同様に「1」となる。 As described above, when s is a conditional branch, the smaller of r1 and r2 is added to the returned value. However, when we look at the branch count measurement (4, 13, [6, 3]) for the fourth line where the conditional branch is described, the smaller of r1 (i.e., the output of branch count measurement (5, 13, [6, 3, 4]) and r2 (i.e., the output of branch count measurement (12, 13, [6, 3, 4])) is "0", and the value obtained by adding 1 to this value is "1". In this case, the output of branch count measurement (4, 13, [6, 3]) is "1" as shown in FIG. 38. The output of branch count measurement (3, 13, [6]) executed before branch count measurement (4, 13, [6, 3]) is also "1".

上記したようにリード箇所「13」について分岐数計測処理が実行された場合、図28~図38において説明したように処理を繰り返すことにより、当該分岐数計測処理の出力として「1」が得られる。この分岐数計測処理の出力「1」は、調査起点箇所である3行目から計測終了箇所リストに含まれる計測終了箇所を通らずにリード箇所である13行目に到達するまでに条件分岐が1つ存在することを示している。 When the branch count measurement process is executed for the read point "13" as described above, the process is repeated as described in Figures 28 to 38, and the output of the branch count measurement process is obtained as "1". The output of this branch count measurement process, "1", indicates that there is one conditional branch from the investigation start point, line 3, to the read point, line 13, without passing through the measurement end point included in the measurement end point list.

上記したリード箇所「7」、「10」及び「13」の各々について分岐数計測処理が実行された結果(つまり、分岐数計測処理の出力として得られる分岐数)は、当該リード箇所に対応づけて分岐数表に追加される。 The results of the branch count measurement process for each of the above-mentioned lead points "7", "10", and "13" (i.e., the branch count obtained as the output of the branch count measurement process) are added to the branch count table in association with the lead point.

図39は、上記した分岐数計測処理の概略を示している。上記したようにリード箇所「7」について実行された分岐数計測処理の出力は「∞」であるため、図39に示す分岐数表においては、リード箇所(行番号)「7」に対応づけて分岐数「∞」が追加されている。同様に、リード箇所「10」について実行された分岐数計測処理の出力は「2」であるため、図39に示す分岐数表においては、リード箇所(行番号)「10」に対応づけて分岐数「2」が追加されている。更に、リード箇所「13」について実行された分岐数計測処理の出力は「1」であるため、図39に示す分岐数表においては、リード箇所(行番号)「13」に対応づけて分岐数「1」が追加されている。 Figure 39 shows an overview of the branch number measurement process described above. As described above, the output of the branch number measurement process executed for read location "7" is "∞", so in the branch number table shown in Figure 39, the branch number "∞" is added in association with the read location (row number) "7". Similarly, the output of the branch number measurement process executed for read location "10" is "2", so in the branch number table shown in Figure 39, the branch number "2" is added in association with the read location (row number) "10". Furthermore, the output of the branch number measurement process executed for read location "13" is "1", so in the branch number table shown in Figure 39, the branch number "1" is added in association with the read location (row number) "13".

ここで、上記したように調査起点箇所からリード箇所までの実行経路中に条件分岐が多いほど当該リード箇所に与える影響を見落とす可能性が高くなるという観点によれば、図39に示す分岐数表に追加されたリード箇所のうちのリード箇所「10」(つまり、ソースコードの10行目)が、調査起点箇所において調査対象変数に対する値が変更されたことによる影響を見落としやすい箇所であるといえる。この場合には、図40に示すように、リード箇所「10」が表示(出力)される。 From the viewpoint that the more conditional branches there are in the execution path from the investigation start point to the read point, the greater the possibility of overlooking the impact on the read point, as mentioned above, it can be said that lead point "10" (i.e., the 10th line of the source code) among the lead points added to the branch count table shown in FIG. 39 is a point where the impact of a change in the value of the variable being investigated at the investigation start point is likely to be overlooked. In this case, lead point "10" is displayed (output) as shown in FIG. 40.

なお、本実施形態においては例えば実行経路中に分岐数が最も多いリード箇所を表示するが、分岐数「∞」は、上記したように調査起点箇所から計測終了箇所を通らずにリード箇所に到達できないことを示す。よって、本実施形態において、分岐数が「∞」であるリード箇所は表示の対象とはされない(つまり、分岐数が最も多いリード箇所としては扱われない)ものとする。この場合、分岐数表においては、分岐数「∞」の代わりに、リード箇所が表示の対象でないことを示す「-」等が追加されてもよい。 In this embodiment, for example, the lead point with the most branches in the execution path is displayed, but a branch number of "∞" indicates that the lead point cannot be reached from the investigation start point without passing through the measurement end point, as described above. Therefore, in this embodiment, a lead point with a branch number of "∞" is not subject to display (i.e., it is not treated as the lead point with the most branches). In this case, in the branch number table, instead of the branch number "∞", a "-" or the like may be added to indicate that the lead point is not subject to display.

上記したように本実施形態においては、ソースコードにおいて値が変更された調査対象変数及び当該調査対象変数に対する値が変更された行を示す調査起点箇所(第1行番号)を入力し、当該ソースコードを構成する複数の行のうち、調査対象変数が読み取られる行を示すリード箇所(第2行番号)を特定し、調査起点箇所(によって示される行)から特定されたリード箇所(によって示される行)までの実行経路中に記述されている条件分岐の数(分岐数)を計測し、当該計測された分岐数に基づいてリード箇所を表示する。 As described above, in this embodiment, the investigation start point (first line number) indicating the investigation target variable whose value has been changed in the source code and the line where the value of the investigation target variable was changed is input, a lead point (second line number) indicating the line from which the investigation target variable is read is identified among the multiple lines constituting the source code, the number of conditional branches (number of branches) described in the execution path from the investigation start point (the line indicated by) to the identified lead point (the line indicated by), and the lead point is displayed based on the measured number of branches.

本実施形態においては、このような構成により、調査対象変数に対する値が変更されたことによる影響を見落としやすいリード箇所をユーザに提示することができるため、ソースコードに対する編集作業を支援することが可能となる。具体的には、図40に示すようにリード箇所「10」が表示された場合には、ユーザは、調査対象変数に対する値の変更がソースコードの10行目(リード箇所)に対して与える影響等に関して検討漏れがなかったか(つまり、十分に検討されているか)を確認することができる。 In this embodiment, this configuration makes it possible to present to the user lead points where the impact of changing the value of the variable being investigated is easily overlooked, thereby supporting the editing work of the source code. Specifically, when lead point "10" is displayed as shown in FIG. 40, the user can check whether or not they have overlooked the impact of changing the value of the variable being investigated on the 10th line of the source code (lead point) (i.e., whether or not they have been sufficiently considered).

なお、本実施形態においてはリード箇所(行番号)のみを表示するものとして説明したが、当該リード箇所について実行される分岐数計測処理の結果(分岐数)を更に表示してもよい。 In this embodiment, only the lead location (line number) is displayed, but the result of the branch count measurement process executed for the lead location (branch count) may also be displayed.

また、本実施形態においては分岐数が最も大きいリード箇所を表示するものとして説明したが、分岐数表に追加されたリード箇所のうち、分岐数が予め定められた値以上であるリード箇所を表示してもよい。例えば図39に示す分岐数表の例の場合であれば、例えば分岐数が1以上であるリード箇所「10」及び「13」が表示されてもよい。 In addition, in this embodiment, the lead point with the largest number of branches is displayed, but among the lead points added to the branch number table, lead points with a number of branches equal to or greater than a predetermined value may be displayed. For example, in the case of the example branch number table shown in FIG. 39, lead points "10" and "13" with a number of branches equal to or greater than 1 may be displayed.

更に、上記したリード箇所は、例えば格納部11に格納されているソースコード上で表示されてもよい。上記したようにリード箇所「10」を表示する場合であれば、10行目に他の行と区別可能な色または加工を施したソースコードを表示するようにしてもよい。すなわち、本実施形態においては、分岐数が多いリード箇所(つまり、調査対象変数に対する値の変更による影響を見落としやすいリード箇所)をユーザが容易に把握することが可能な態様で当該リード箇所が表示(提示)されればよい。 Furthermore, the above-mentioned lead points may be displayed on the source code stored in the storage unit 11, for example. In the case of displaying lead point "10" as described above, the source code may be displayed with a color or processing applied to the 10th line that makes it distinguishable from the other lines. That is, in this embodiment, lead points with a large number of branches (i.e., lead points where the effect of changing the value of the variable being investigated is easily overlooked) may be displayed (presented) in a manner that allows the user to easily grasp the lead points.

また、リード箇所は、分岐数表の形式で表示されてもよい。この場合、例えば分岐数でリード箇所をソートした分岐数表が表示されるようにしてもよい。 The lead locations may also be displayed in the form of a branch number table. In this case, for example, a branch number table in which the lead locations are sorted by the number of branches may be displayed.

また、本実施形態においては、調査起点箇所からリード箇所までの複数の実行経路(例えば、第1及び第2実行経路)が存在する場合、当該第1実行経路中に記述されている条件分岐の数(第1数)よりも小さい第2実行経路中に記述されている条件分岐の数(第2数)が計測される。すなわち、本実施形態においては、複数の実行経路が存在する場合には最小となる分岐数が計測(選択)される。 In addition, in this embodiment, when there are multiple execution paths (e.g., first and second execution paths) from the investigation starting point to the lead point, the number of conditional branches (second number) described in the second execution path that is smaller than the number of conditional branches (first number) described in the first execution path is measured. That is, in this embodiment, when there are multiple execution paths, the smallest number of branches is measured (selected).

更に、本実施形態においては、調査起点箇所からリード箇所までの実行経路中に調査対象変数が上書きされる行(つまり、ライト箇所)が存在する場合、当該リード箇所についての分岐数は「∞(-)」となり、当該リード箇所は表示されない。 Furthermore, in this embodiment, if there is a line in the execution path from the investigation start point to the read point where the investigation target variable is overwritten (i.e., a write point), the number of branches for that read point will be "∞ (-)" and that read point will not be displayed.

このような構成によれば、不当に分岐数が多いリード箇所や分岐数を計測することができないリード箇所が表示されることを抑制し、適切なリード箇所を表示することができる。 This configuration makes it possible to prevent lead points with an unreasonably large number of branches or lead points where the number of branches cannot be measured from being displayed, and to display appropriate lead points.

なお、本実施形態においては、例えばコンパイルする(つまり、プログラムの実行のための環境を構築する)といった手間をかけることなく、変数に対する値の変更が影響を与える箇所(リード箇所)を静的解析により評価することが可能であるため、ユーザの利便性を向上させることができる。 In addition, in this embodiment, it is possible to evaluate the parts (read parts) that are affected by changes to the values of variables through static analysis without the trouble of, for example, compiling (i.e., building an environment for executing the program), thereby improving user convenience.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれると同様に、特許請求の範囲に記載された発明とその均等の範囲に含まれるものである。 Although several embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These embodiments can be implemented in various other forms, and various omissions, substitutions, and modifications can be made without departing from the gist of the invention. These embodiments and their modifications are within the scope of the invention and its equivalents as set forth in the claims, as well as the scope and gist of the invention.

10…ソフトウェア開発支援装置、11…格納部、12…入力部、13…計測部、14…表示部、101…CPU、102…不揮発性メモリ、103…主メモリ、104…BIOS-ROM、105…システムコントローラ、106…入力デバイス、107…表示デバイス、108…EC。 10... software development support device, 11... storage unit, 12... input unit, 13... measurement unit, 14... display unit, 101... CPU, 102... non-volatile memory, 103... main memory, 104... BIOS-ROM, 105... system controller, 106... input device, 107... display device, 108... EC.

Claims (8)

プログラム言語を用いて記述された変数及び条件分岐を含む複数の行から構成されるソースコードを取得する取得手段と、
前記取得されたソースコードにおいて値が変更された変数及び当該変数に対する値が変更された行を示す第1行番号を入力する入力手段と、
前記取得されたソースコードを構成する複数の行のうち、前記入力された変数が読み取られる行を示す第2行番号を特定する特定手段と、
前記入力された第1行番号によって示される行から前記特定された第2行番号によって示される行までの実行経路中に記述されている条件分岐の数を計測する計測手段と、
前記計測された条件分岐の数に基づいて前記特定された第2行番号を表示する表示手段と
を具備するソフトウェア開発支援装置。
An acquisition means for acquiring a source code composed of a plurality of lines including variables and conditional branches written in a programming language;
an input means for inputting a variable whose value has been changed in the acquired source code and a first line number indicating a line in which the value of the variable has been changed;
an identifying means for identifying a second line number indicating a line from which the input variable is to be read, among a plurality of lines constituting the acquired source code;
a counting means for counting the number of conditional branches described in an execution path from the line indicated by the input first line number to the line indicated by the specified second line number;
and a display means for displaying the specified second line number based on the number of the counted conditional branches.
前記表示手段は、前記計測された条件分岐の数を更に表示する請求項1記載のソフトウェア開発支援装置。 The software development support device according to claim 1, wherein the display means further displays the number of conditional branches measured. 前記計測手段は、前記入力された変数が読み取られる行を示す複数の第2行番号が特定された場合、当該第2行番号毎に前記条件分岐の数を計測し、
前記表示手段は、前記複数の第2行番号のうち、前記計測された条件分岐の数が最も大きい第2行番号を表示する
請求項1または2記載のソフトウェア開発支援装置。
the measuring means, when a plurality of second line numbers indicating lines from which the input variables are read are identified, measures the number of the conditional branches for each of the second line numbers;
3. The software development support device according to claim 1, wherein the display means displays, among the plurality of second line numbers, the second line number having the largest number of the measured conditional branches.
前記計測手段は、前記入力された変数が読み取られる行を示す複数の第2行番号が特定された場合、当該第2行番号毎に前記条件分岐の数を計測し、
前記表示手段は、前記複数の第2行番号のうち、前記計測された条件分岐の数が予め定められた値以上である第2行番号を表示する
請求項1または2記載のソフトウェア開発支援装置。
the measuring means, when a plurality of second line numbers indicating lines from which the input variables are read are identified, measures the number of the conditional branches for each of the second line numbers;
3. The software development support device according to claim 1, wherein the display means displays, among the plurality of second line numbers, second line numbers in which the number of the measured conditional branches is equal to or greater than a predetermined value.
前記計測手段は、前記入力された第1行番号によって示される行から前記特定された第2行番号によって示される行までの第1及び第2実行経路が存在する場合、当該第1実行経路中に記述されている条件分岐の第1数よりも小さい第2実行経路中に記述されている条件分岐の第2数を計測する請求項1~4のいずれか一項に記載のソフトウェア開発支援装置。 The software development support device according to any one of claims 1 to 4, wherein the measurement means measures a second number of conditional branches described in a second execution path that is smaller than a first number of conditional branches described in the first execution path when a first and a second execution path exist from the line indicated by the input first line number to the line indicated by the specified second line number. 前記入力された第1行番号によって示される行から前記特定された第2行番号によって示される行までの実行経路中に前記入力された変数が上書きされる行が存在する場合、当該第2行番号は表示されない請求項1~5のいずれか一項に記載のソフトウェア開発支援装置。 The software development support device according to any one of claims 1 to 5, wherein if there is a line in which the input variable is overwritten in the execution path from the line indicated by the input first line number to the line indicated by the specified second line number, the second line number is not displayed. ソフトウェア開発支援装置が実行する方法であって、
プログラム言語を用いて記述された変数及び条件分岐を含む複数の行から構成されるソースコードを取得することと、
前記取得されたソースコードにおいて値が変更された変数及び当該変数に対する値が変更された行を示す第1行番号を入力することと、
前記取得されたソースコードを構成する複数の行のうち、前記入力された変数が読み取られる行を示す第2行番号を特定することと、
前記入力された第1行番号によって示される行から前記特定された第2行番号によって示される行までの実行経路中に記述されている条件分岐の数を計測することと、
前記計測された条件分岐の数に基づいて前記特定された第2行番号を表示することと
を具備する方法。
A method executed by a software development support device, comprising:
Obtaining source code consisting of a plurality of lines including variables and conditional branches written in a programming language;
inputting a variable whose value has been changed in the acquired source code and a first line number indicating a line in which the value of the variable has been changed;
Identifying a second line number indicating a line from which the input variable is to be read, among a plurality of lines constituting the acquired source code;
Counting the number of conditional branches described in an execution path from the line indicated by the input first line number to the line indicated by the specified second line number;
and displaying the identified second line number based on the counted number of conditional branches.
ソフトウェア開発支援装置のコンピュータによって実行されるプログラムであって、
前記コンピュータに、
プログラム言語を用いて記述された変数及び条件分岐を含む複数の行から構成されるソースコードを取得することと、
前記取得されたソースコードにおいて値が変更された変数及び当該変数に対する値が変更された行を示す第1行番号を入力することと、
前記取得されたソースコードを構成する複数の行のうち、前記入力された変数が読み取られる行を示す第2行番号を特定することと、
前記入力された第1行番号によって示される行から前記特定された第2行番号によって示される行までの実行経路中に記述されている条件分岐の数を計測することと、
前記計測された条件分岐の数に基づいて前記特定された第2行番号を表示することと
を実行させるためのプログラム。
A program executed by a computer of a software development support device,
The computer includes:
Obtaining source code consisting of a plurality of lines including variables and conditional branches written in a programming language;
inputting a variable whose value has been changed in the acquired source code and a first line number indicating a line in which the value of the variable has been changed;
Identifying a second line number indicating a line from which the input variable is to be read, among a plurality of lines constituting the acquired source code;
Counting the number of conditional branches described in an execution path from the line indicated by the input first line number to the line indicated by the specified second line number;
and displaying the identified second line number based on the counted number of conditional branches.
JP2021036370A 2021-03-08 2021-03-08 Software development support device, method and program Active JP7480082B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021036370A JP7480082B2 (en) 2021-03-08 2021-03-08 Software development support device, method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021036370A JP7480082B2 (en) 2021-03-08 2021-03-08 Software development support device, method and program

Publications (2)

Publication Number Publication Date
JP2022136658A JP2022136658A (en) 2022-09-21
JP7480082B2 true JP7480082B2 (en) 2024-05-09

Family

ID=83311755

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021036370A Active JP7480082B2 (en) 2021-03-08 2021-03-08 Software development support device, method and program

Country Status (1)

Country Link
JP (1) JP7480082B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011180814A (en) 2010-03-01 2011-09-15 Renesas Electronics Corp Compiler apparatus, compiling method and program
WO2014112317A1 (en) 2013-01-21 2014-07-24 日産自動車株式会社 Variable-access-consistency review device, variable-access-consistency review method, and variable-access-consistency review program
WO2016001982A1 (en) 2014-06-30 2016-01-07 株式会社 日立製作所 Test data generation assistance device and test data generation assistance method
JP2020067697A (en) 2018-10-22 2020-04-30 富士通株式会社 Dead code analysis program, dead code analysis method, and dead code analysis device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011180814A (en) 2010-03-01 2011-09-15 Renesas Electronics Corp Compiler apparatus, compiling method and program
WO2014112317A1 (en) 2013-01-21 2014-07-24 日産自動車株式会社 Variable-access-consistency review device, variable-access-consistency review method, and variable-access-consistency review program
WO2016001982A1 (en) 2014-06-30 2016-01-07 株式会社 日立製作所 Test data generation assistance device and test data generation assistance method
JP2020067697A (en) 2018-10-22 2020-04-30 富士通株式会社 Dead code analysis program, dead code analysis method, and dead code analysis device

Also Published As

Publication number Publication date
JP2022136658A (en) 2022-09-21

Similar Documents

Publication Publication Date Title
Panichella et al. Would static analysis tools help developers with code reviews?
US8627287B2 (en) Prioritizing quality improvements to source code
Kim et al. SPLat: Lightweight dynamic analysis for reducing combinatorics in testing configurable systems
US8762971B2 (en) Servicing a production program in an integrated development environment
US9898387B2 (en) Development tools for logging and analyzing software bugs
US8402317B1 (en) Viewing multi-dimensional metric data from multiple test cases
US7526758B2 (en) Execution failure investigation using static analysis
US8336032B2 (en) Implementing enhanced template debug
US20110271250A1 (en) Software Development Tool
US9239773B1 (en) Method and system for debugging a program that includes declarative code and procedural code
US20110271258A1 (en) Software Development Tool
US20080168428A1 (en) Identifying a Potential Breakpoint Location in a Code Path in a Computer Program Based Upon the Frequency of Execution of the Code Path as Identified in Collected Profile Data
US20170220455A1 (en) Test case generation using a constraint graph solver
US10229031B2 (en) Debugging inline functions in optimized code
US20130318504A1 (en) Execution Breakpoints in an Integrated Development Environment for Debugging Dataflow Progrrams
US20120324414A1 (en) Bdd-based functional modeling
US20150378724A1 (en) Identifying code that exhibits ideal logging behavior
Do et al. Debugging static analysis
US10877873B2 (en) Using historic execution data to visualize tracepoints
Fedorova et al. Performance comprehension at WiredTiger
Chatelain et al. VeriTracer: Context-enriched tracer for floating-point arithmetic analysis
JP7480082B2 (en) Software development support device, method and program
Arndt et al. Let this graph be your witness! an attestor for verifying Java pointer programs
Andrianov et al. Predicate abstraction based configurable method for data race detection in Linux kernel
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230313

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240226

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240326

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240424

R150 Certificate of patent or registration of utility model

Ref document number: 7480082

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150