JP7469999B2 - Search device, search method, and search program - Google Patents
Search device, search method, and search program Download PDFInfo
- Publication number
- JP7469999B2 JP7469999B2 JP2020151724A JP2020151724A JP7469999B2 JP 7469999 B2 JP7469999 B2 JP 7469999B2 JP 2020151724 A JP2020151724 A JP 2020151724A JP 2020151724 A JP2020151724 A JP 2020151724A JP 7469999 B2 JP7469999 B2 JP 7469999B2
- Authority
- JP
- Japan
- Prior art keywords
- candidate
- input
- sorting
- search
- correction
- 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
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明は、情報を検索する検索装置、検索方法、および検索プログラムに関する。 The present invention relates to a search device, a search method, and a search program for searching information.
あるシステムで不具合が発生した際に、当該システムの他の部分や他のシステムで類似の不具合が発生しないか確認するという「類似見直し」が行われることがある。類似見直しにより、類似の不具合が発生する可能性がある場合には当該類似の不具合箇所は修正され、システムの品質向上が実現す。しかしながら、見直し対象となる不具合は多様なため、機械的な支援が難しく、人手による類似見直しが行われている。人手による類似見直しには膨大な工数がかかり、問題となっている。類似見直しを機械化する先行技術として、特許文献1がある。
When a malfunction occurs in a system, a "similarity review" is sometimes performed to check whether a similar malfunction occurs in other parts of the system or in other systems. If a similar review finds that there is a possibility of a similar malfunction occurring, the similar malfunction is corrected, improving the quality of the system. However, because the types of malfunctions that are subject to review are diverse, mechanical support is difficult, and so a similarity review is performed manually. Manual similarity reviews require a huge amount of work, which is problematic.
特許文献1は、脆弱なライブラリが適切に用いられていない箇所のみを検出する脆弱性監査装置を開示する。この脆弱性監査装置は、脆弱性に関する判定ルールであって、関数名と、該関数の引数であって不正な値が設定され得る引数の位置とが対応付けて予め定義される判定ルールを格納した記憶部から、前記判定ルールを読み込み、被監査プログラムの構文解析等を行い、前記構文解析が行われた被監査プログラムにおいて、値が外部から入力される変数を抽出し、処理フローに沿って追跡し、前記判定ルールに定義された関数及び該関数の引数の位置に、前記追跡された変数が使用されている場合に、該変数が比較演算子を含む条件式に用いられているか否か等を判定し、前記判定が否である場合に、警告メッセージを生成し、画面又はファイルに出力する。
特許文献1では、機械化可能な類似見直しが限定的である。また、データ依存や制御依存がある部分を特定できないため、類似の不具合が発生するか否かの判断に必要な箇所は、個別に人手で探し出さなければならない。さらに、類似見直し箇所が複数ある場合、当該技術を複数回実施する必要があり、類似見直し箇所は数百件に上ることもある。また、類似見直し箇所に限らず、任意の箇所を検索する場合についても同様である。
In
本発明は、検索効率の向上を図ることを目的とする。 The present invention aims to improve search efficiency.
本願において開示される発明の一側面となる検索装置は、プロセッサと、前記プロセッサがアクセス可能な記憶デバイスと、を有する検索装置であって、前記プロセッサは、ソースコード内の修正候補箇所を検索するための候補条件に基づいて、前記ソースコードから前記修正候補箇所を検索する検索処理と、前記候補条件とのプログラム上の依存関係と、前記候補条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理と、前記入力処理によって入力された依存関係に関する仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記入力処理によって入力された依存関係に関する仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する仕分処理と、前記仕分処理による仕分結果を出力する出力処理と、を実行することを特徴とする。 A search device according to one aspect of the invention disclosed in this application is a search device having a processor and a storage device accessible to the processor, wherein the processor executes the following steps: a search process for searching for candidate locations for correction from source code based on candidate conditions for searching for candidate locations for correction within the source code; an input process for accepting input of programmatic dependencies with the candidate conditions and attributes to be assigned to candidate locations for correction that match the candidate conditions or candidate locations that do not match the candidate conditions; a sorting process for assigning an attribute to candidate locations for correction that match the sorting conditions input by the input process if the attribute has been input, and for candidate locations for correction that do not match the sorting conditions for dependency input by the input process if the attribute has been input to be assigned to candidate locations for correction that do not match the sorting conditions; and an output process for outputting the sorting results obtained by the sorting process.
本発明の代表的な実施の形態によれば、検索効率の向上を図ることができる。前述した以外の課題、構成及び効果は、以下の実施例の説明により明らかにされる。 According to a representative embodiment of the present invention, it is possible to improve search efficiency. Problems, configurations, and effects other than those described above will become clear from the explanation of the following examples.
<ソースコード類似不具合箇所>
図1は、ソースコード類似不具合箇所の一例を示す説明図である。ここでは、案件0のソースコードSC0を開発する開発者D0が、ソースコードSC0内の共通処理AAの不具合を発見し、類似見直し調査依頼100を作成した場合を例に挙げる。類似見直し調査依頼100は、たとえば、
「共通処理AAを第2引数が10で呼出すと不具合が発生します。
類似見直しのため、以下を確認してください。
1. 共通処理AAを使っていますか?(確認事項101)
2. 共通処理AAを第2引数が10で呼出すことがありますか?(確認事項102)」
といった内容であり、各開発者D1~Dnに展開される。このように各開発者D1~Dnが人手で類似不具合の見直し調査をすると、見直し工数が増大し、開発効率が低下する。したがって、ソースコード類似不具合箇所を効率的に検出する必要がある。
<Source code similar defects>
1 is an explanatory diagram showing an example of a similar defect location in source code. Here, a case is taken as an example in which a developer D0 developing source code SC0 of case 0 discovers a defect in common process AA in source code SC0 and creates a similarity
"When common process AA is called with a second argument of 10, a problem occurs.
For similar review, please check below.
1. Are you using common processing AA? (Check item 101)
2. Is there a case where common process AA is called with the second argument set to 10? (Confirmation item 102)
The content is distributed to each developer D1 to Dn. If each developer D1 to Dn were to manually review and investigate similar defects in this way, the review man-hours would increase and development efficiency would decrease. Therefore, it is necessary to efficiently detect similar source code defects.
<ソースコード類似不具合箇所検索支援例>
図2は、ソースコード類似不具合箇所検索支援例を示す説明図である。ソースコードSCiは、共通処理AAを含み、検索装置200によるソースコード類似不具合箇所検索支援の対象となるソースコードである。iは、1≦i≦nを満たす整数である。
<Example of support for searching for similar source code defects>
2 is an explanatory diagram showing an example of a source code similar defect location search support. A source code SCi includes a common process AA and is a source code that is a target of a source code similar defect location search support by the
検索装置200は、開発者Diから確認事項101,102のうち、確認事項101の共通処理AAを修正対象箇所の候補条件として受け付けて、ソースコードSCiから共通処理AAを含む行(以下、ヒット行と称す)を検索し(ステップS200)、検索結果R200を出力する。検索結果R200には、ヒット行の行番号#と、ヒット行の記述内容と、で特定される修正候補箇所が含まれる。
The
つぎに、検索装置200は、開発者Diから確認事項102の共通処理AAの第2引数が出現する行の直近の行を絞り込む第1仕分条件を受け付けて、候補箇所の検索結果R200の修正候補箇所を仕分けし(ステップS201)、第1仕分結果R201を出力する。第1仕分結果R201は、検索結果R200の修正候補箇所に当該直近の行を追加した仕分結果である。具体的には、たとえば、第1仕分結果R201の各ヒット行には、直近の行(下線を付した文字列)が含まれる。また、第1仕分結果R201には、検索結果R200に修正対象か否かを示す列「対象」が追加されたデータである。ここでは、いずれの行も「?」、すなわち、修正対象か修正対象外か区別がつかないため、さらに細分すべきであるということを意味する。
Next, the
つぎに、検索装置200は、第1仕分結果R201において確認事項102の一部を充足しないヒット行に関する第2仕分条件を受け付けて、第1仕分結果R201の修正候補箇所を仕分けし(ステップS202)、第2仕分結果R202を出力する。第2仕分条件とは、たとえば、『第2引数に「10」以外の定数が入る行は対象外にする』、という仕分条件である。
Next, the
第2仕分結果R202では、行番号#1のヒット行およびその直前行により、行番号#1において、第2引数に「10」以外の定数「11」が入る。したがって、行番号#1の修正候補箇所は第2仕分条件を充足するため、対象は「×」(修正対象外を意味する)に設定される。一方、行番号#2や行番号#YYの修正候補箇所は第2仕分条件を充足しないため、対象は「?」(細分を意味する)に設定される。
In the second sorting result R202, the hit line in
つぎに、検索装置200は、第2仕分結果R202において確認事項102の一部を充足しないヒット行に関する第3仕分条件を受け付けて、第2仕分結果R202の修正候補箇所を仕分けし(ステップS203)、第3仕分結果R203を出力する。第3仕分条件とは、たとえば、『第2引数が「10」でない場合のみ実行されるような制御処理がある行は対象外にする』、という仕分条件である。
Next, the
第3仕分結果R203は、行番号#YYのヒット行およびその直前行により、行番号#YYが、第2引数が「10」でない場合のみ実行されるような制御処理がある行となる。したがって、行番号#YYの修正候補箇所は第3仕分条件を充足するため、対象は「×」に設定される。一方、行番号#2の修正候補箇所は第2除外条件を充足しないため、対象は「?」のままである。
In the third sorting result R203, due to the hit line of line number #YY and the line immediately preceding it, line number #YY is a line with a control process that is executed only if the second argument is not "10". Therefore, the correction candidate part of line number #YY satisfies the third sorting condition, so the target is set to "X". On the other hand, the correction candidate part of
開発者Diは、第3仕分結果R203を参照して、行番号#2が、確認事項101,102に該当する行であるか否かを目視で判断する。行番号#2が、確認事項101,102に該当する行であると判断した場合、検索装置200は、開発者Diの操作により、第3仕分結果R203において行番号#2の対象を「?」から「〇」(修正対象を意味する)に変更する。
Developer Di refers to the third sorting result R203 and visually determines whether
このようにして、多様な不具合を対象にした、データ依存や制御依存も考慮した一括検索が可能な、類似見直しの機械的な検索が可能となる。これにより、類似見直しの工数を削減が可能となり、ソースコードSCiの類似不具合箇所を効率的に絞り込むことができる。以下、実施例1および実施例2で具体的に説明する。実施例1および実施例2では、類似見直し箇所に限らず、任意の箇所を検索する場合についても適用可能である。 In this way, a mechanical search for similar review is possible, which allows for a collective search for a variety of defects while also taking into account data dependency and control dependency. This makes it possible to reduce the man-hours required for similar review, and to efficiently narrow down similar defect locations in source code SCi. This will be described in detail below in Examples 1 and 2. Examples 1 and 2 are applicable to the case where any location is searched, not limited to similar review locations.
実施例1は、上述した候補条件と、候補条件から実行順に接続された1以上の仕分条件と、を含む検索条件があらかじめ設定されており、検索装置が当該検索条件を用いて検索する例である。 Example 1 is an example in which search conditions including the above-mentioned candidate conditions and one or more sorting conditions connected to the candidate conditions in the order of execution are set in advance, and the search device searches using the search conditions.
<検索装置200のハードウェア構成例>
図3は、検索装置200のハードウェア構成例を示すブロック図である。検索装置200300は、プロセッサ301と、記憶デバイス302と、入力デバイス303と、出力デバイス304と、通信インターフェース(通信IF)305と、を有する。プロセッサ301、記憶デバイス302、入力デバイス303、出力デバイス304、および通信IF305は、バス306により接続される。プロセッサ301は、検索装置200を制御する。記憶デバイス302は、プロセッサ301の作業エリアとなる。また、記憶デバイス302は、各種プログラムやデータを記憶する非一時的なまたは一時的な記録媒体である。記憶デバイス302としては、たとえば、ROM(Read Only Memory)、RAM(Random Access Memory)、HDD(Hard Disk Drive)、フラッシュメモリがある。入力デバイス303は、データを入力する。入力デバイス303としては、たとえば、キーボード、マウス、タッチパネル、テンキー、スキャナがある。出力デバイス304は、データを出力する。出力デバイス304としては、たとえば、ディスプレイ、プリンタ、スピーカがある。通信IF305は、ネットワークと接続し、データを送受信する。
<Example of Hardware Configuration of
3 is a block diagram showing an example of a hardware configuration of the
<ソースコード>
図4は、ソースコードの一例を示す説明図である。図4のソースコードSCiは、説明の便宜上、図1よび図2で示したソースコードSCiとは異なる内容としている。
<Source code>
Fig. 4 is an explanatory diagram showing an example of source code. For the sake of convenience, the source code SCi in Fig. 4 has different contents from the source code SCi shown in Figs.
<検索条件>
図5は、検索装置200に与えられる検索条件の一例を示す説明図である。検索条件500は、候補条件501から始まり、仕分条件510A,510B,…(これらを区別しない場合は単に仕分条件510を表記)が0個以上続く構造である。候補条件501は、ソースコードSCiから修正対象となる箇所の候補を検索するための条件で、たとえば、「文字列“XXX”を含む文」や「関数func1を呼出している文」など、ソースコードSCi中から機械的に文(命令ともいう)を抽出できるような条件である。候補条件501で抽出した文を修正対象箇所と称す。
<Search conditions>
5 is an explanatory diagram showing an example of search conditions given to the
一方、仕分条件510は、候補条件501に基づいて抽出した修正候補箇所を仕分けるための条件である。仕分条件510には、修正候補箇所の絞り込み、乃至は、その箇所の直前または/および直後の関連する部分を探す条件が含まれる。ここで、関連する箇所とは、データ依存関係や制御依存関係で関連する箇所である。 On the other hand, the sorting conditions 510 are conditions for sorting the correction candidate parts extracted based on the candidate conditions 501. The sorting conditions 510 include conditions for narrowing down the correction candidate parts, or for searching for related parts immediately before and/or after the part. Here, the related parts are parts related through data dependencies or control dependencies.
データ依存関係とは、ある文と、その文で値が更新される変数の値の算出に利用される他の変数の値が計算される文と、の関係である。すなわち、前の命令で用いられたデータを利用して後の命令を実行するような関係であり、それらの命令を入れ替えて実行すると結果が変わってしまう可能性がある。たとえば、「関数呼び出しにおける第1引数が“a”」は、データ依存関係を示す。 A data dependency is a relationship between a statement and a statement that calculates the value of another variable that is used to calculate the value of a variable whose value is updated in that statement. In other words, it is a relationship in which data used in a previous instruction is used to execute a later instruction, and there is a possibility that the results will change if those instructions are executed interchangeably. For example, "the first argument in a function call is "a"" shows a data dependency.
制御依存関係とは、ある文と、その文が実行されるか否かを左右する条件分岐文と、の関係である。すなわち、分岐命令の後続命令を実行するかどうかは分岐命令の実行が終了して分岐先アドレスが決まらないと確定しないというような分岐命令と後続命令との関係である。たとえば、「変数Yに関する条件分岐がある」は、データ依存関係を示す。 A control dependency is a relationship between a statement and a conditional branch statement that determines whether or not the statement is executed. In other words, it is a relationship between a branch instruction and a subsequent instruction, in which whether or not the instruction following the branch instruction is executed is not determined until execution of the branch instruction is completed and the branch destination address is determined. For example, "there is a conditional branch regarding variable Y" indicates a data dependency.
また、仕分条件510には、条件一致/条件不一致の場合それぞれに対する仕分結果502A~502D(これらを区別しない場合は単に仕分結果502)が関連付けられる。仕分結果502には、「修正対象」、「修正対象外」、「細分」の少なくとも3種類があり、仕分結果502が「細分」の場合は、さらに、別の仕分条件510が関連付けられる。
In addition, sorting
「修正対象」は、修正すべき修正候補箇所である。「修正対象外」は修正すべきでない修正候補箇所である。「細分」は、現時点では修正すべきか否かはかわからないため、さらに仕分条件を用いて細かく分析する必要があることをいう。 "To be corrected" refers to areas that should be corrected. "Not to be corrected" refers to areas that should not be corrected. "Subdivision" means that it is not known at this point whether or not something should be corrected, and further detailed analysis is required using classification criteria.
つまり、検索条件500は、候補条件501を唯一の根とし、仕分条件510が連なる木構造となる。たとえば、仕分条件510Aは、条件一致(実線矢印)の場合、仕分結果502が細分(仕分結果502A)であるため、さらに仕分条件510Bが関連付けられる。なお、仕分結果502に「個別調査」などの種類を設け、当該種類に分類された修正候補箇所については、検索装置200の使用後に、ユーザが手作業で修正対象または修正対象外に分類することを明確にするようにしてもよい。
In other words, the
なお、CIDは、仕分結果502が確定した候補条件501または仕分条件510を特定する識別情報である。
The CID is identification information that identifies the
<検索支援処理手順>
図6は、実施例1にかかる検索装置200による検索支援処理手順例を示すフローチャートである。なお、検索装置200には、ソースコードSCiおよび検索条件500が与えられている。検索装置200は、ソースコードSCiを解析する(ステップS601)。この解析により、構文要素、構文木、データ依存関係、制御依存関係、および関数呼出関係が得られる。本解析は、既存のコンパイラや静的解析ツールなどと同様の技術で実現できる。
<Search support processing procedure>
6 is a flowchart showing an example of a search support process procedure by the
つぎに、検索装置200は、検索条件500の候補条件501でソースコードSCiを検索し、修正候補箇所を抽出する(ステップS602)。そして、検索装置200は、未選択の仕分条件510がなくなるまで未選択の仕分条件510を繰り返し選択する(ステップS603)。ここでは、例として、仕分条件510は、検索条件500の木構造を根から順に末端に向かって選択されるものとする。
Next, the
検索装置200は、ステップS603で選択された仕分条件510に基づいて、修正候補箇所を検索する(ステップS604)。具体的には、たとえば、検索装置200は、仕分条件510の直近の親にあたる候補条件501、または、仕分条件510で得た修正候補箇所を検索する。たとえば、選択仕分け条件510が仕分条件510Aである場合、直近の親にあたる候補条件501が修正候補箇所として検索される。また、選択仕分条件510が仕分条件510Bである場合、仕分条件510Aで仕訳けた結果得られた仕分結果502A(細分)が修正候補箇所として検索される。
The
検索装置200は、未選択の仕分条件510がなくなった場合、ステップS604の検索を終了して(ステップS605)、検索結果を出力する(ステップS606)。ここで、検索結果の具体例を説明する。
When there are no unselected sorting conditions 510, the
<検索結果例>
図7は、検索結果の例1を示す説明図である。図8は、検索結果の例2を示す説明図である。図7の検索結果700Aおよび図8の検索結果700B(これらを区別しない場合は単に検索結果700と表記)においては、少なくとも、修正対象となった修正候補箇所と、修正候補箇所のソースコードSCi上での位置を示す行番号702と、を含む。
<Example of search results>
Fig. 7 is an explanatory diagram showing a search result example 1. Fig. 8 is an explanatory diagram showing a search result example 2. A
具体的には、たとえば、検索結果700は、項番701と、行番号702と、修正候補箇所703と、属性704と、を含む。図7の検索結果700Aにおいて、項番701が「1」のエントリでは、候補条件501の関数func1について、ソースコードSCi内の行番号702が「3」の「func1(“a”,“b”)」が修正候補箇所703となる。「func1(“a”,“b”)」は、仕分条件510Aおよび仕分条件510Bを充足しているため、その属性704は、仕分結果502Cが示す「修正対象」となる。
Specifically, for example, search result 700 includes
また、項番701が「2」のエントリでは、候補条件501の関数func1について、ソースコードSCi内の行番号702が「3」の「x=“c”」と、「14」の「func1(“x”,“b”)」とが、修正候補箇所703となる。「x=“c”」および「func1(“x”,“b”)」は、仕分条件510Bを充足しているが、仕分条件510Aを充足しない。したがって、属性704は、仕分結果502Dが示す「修正対象外」となる。
In addition, in the entry with
また、図8において、検索結果700Bでは、さらに、修正候補箇所703が、各仕分条件510において条件一致/条件不一致であることを示す一致条件705を有し、属性704に、仕分結果502が確定した候補条件501または仕分条件510を特定するCIDを有する。
In addition, in FIG. 8, in the
たとえば、項番701が「1」のエントリでは、候補条件501の関数func1について、ソースコードSCi内の行番号702が「3」の「func1(“a”,“b”)」が修正候補箇所703となる。「func1(“a”,“b”)」は、一致条件715のCID00で特定される候補条件501を充足し(〇で表記)、一致条件715のCID01で特定される仕分条件510Aを充足し(〇で表記)、一致条件715のCID02で特定される仕分条件510BAを充足する(〇で表記)。したがって、その属性704は、仕分結果502Cが示す「修正対象」となる。
For example, in an entry with
また、項番701が「2」のエントリでは、候補条件501の関数func1について、ソースコードSCi内の行番号702が「3」の「x=“c”」と、「14」の「func1(“x”,“b”)」とが、修正候補箇所703となる。「func1(“x”,“b”)」は一致条件715のCID00~CID01を充足する(〇で表記)が、「x=“c”」および「func1(“x”,“b”)」は一致条件715のCID02を充足していない。したがって、その属性704は、仕分結果502Dが示す「修正対象外」となる。
In the entry with
このように、仕分結果502が確定した候補条件501または仕分条件510を検索結果700Bに含めることで、ユーザは、たとえば、正しく類似見直しできていることを確認するレビューに利用することができる。なお、検索結果700に一致条件705を含めるか否かは、事前に検索装置200に設定される。
In this way, by including the
ここで、検索装置200が類似見直しを支援可能な理由を説明する。類似見直しでは、不具合の要因となった関数、データ型、変数、定数などはあらかじめ明らかになっており、また、不具合が発生する条件も明確になっている。そのため、類似見直しでは、類似見直しの対象とするシステムにおいて、検索装置200は、着目すべき関数、データ型、変数、定数などを利用している箇所すべてについて、不具合が発生する条件に合致するか確認する。
Here, we will explain why the
不具合の要因となった関数、データ型、変数、定数などの利用箇所において、不具合が発生する条件に合致しないためには、プログラムの実行時に、当該利用箇所の直前で、不具合が発生する状態になっていない必要がある。利用箇所における状態は、利用箇所直前で、データ依存や制御依存などの関係がある箇所(状態確定箇所と呼ぶ)で確定する。そのため、状態確定箇所において、不具合が発生する状態にならない工夫がなされていなければ不具合が発生する。言い換えると、類似見直しでは、利用箇所を特定し、状態確定箇所を特定し、状態確定箇所に妥当な工夫がなされているかの確認が行われる。 In order to ensure that the conditions for a bug to occur are not met at the point of use of the function, data type, variable, constant, etc. that caused the bug, the state in which the bug will occur must not have occurred immediately before the point of use when the program is executed. The state at the point of use is determined at a point (called the state determination point) immediately before the point of use where there is a relationship such as data dependency or control dependency. Therefore, a bug will occur if no effort is made to prevent the state at the state determination point from becoming a state in which the bug will occur. In other words, similarity review identifies the point of use, identifies the state determination point, and checks whether appropriate effort has been made at the state determination point.
検索装置200は、候補条件501により利用箇所を機械的に特定し、仕分条件510により状態確定箇所の特定と、状態確定箇所での妥当工夫の有無の機械的な判別と、を実行するため、類似見直しの検索が可能となる。
The
つぎに、実施例2について説明する。実施例2にかかる検索装置200は、候補条件501および仕分条件510の入力を逐次おこなって検索結果および仕分結果を出力する例である。ユーザは、検索結果および仕分結果を参照して、つぎの仕分結果を検索装置200に入力することになる。実施例2では、実施例1との相違点を中心に説明するため、実施例1と同一内容については説明を省略する。
Next, Example 2 will be described. The
一般に、不具合が発生する状態にならない工夫は多岐にわたるため、すべての類似見直しに対応した検索条件500を作ることは困難である。そこで、類似修正対象のシステムでの工夫の実態を考慮しながら検索条件500を作成可能とするため、検索条件の入力および表示や検索結果700の表示が必要となる。
In general, there are a wide variety of ways to prevent defects from occurring, so it is difficult to create
検索装置200は、ユーザ操作により候補条件501の入力を受け付けて、その検索結果700が表示されると、ユーザは新たな仕分け条件の入力を順次受け付ける都度、その検索結果700を表示する処理を、ユーザの仕分条件510の入力がなくなるまで継続する。
When the
<検索処理手順>
図9は、実施例2にかかる検索装置200による検索処理手順例を示すフローチャートである。検索装置200は、ステップS601と同様、ソースコードを解析し(ステップS901)、ユーザ操作により候補条件501の入力を受け付ける(ステップS902)。ここで、候補条件501の入力例について説明する。
<Search processing procedure>
9 is a flowchart showing an example of a search process procedure by the
図10は、候補条件501の入力画面の一例を示す説明図である。入力画面1000は、ソースコードSCi中から機械的に文を抽出する候補条件501の入力を受け付ける画面である。図10の例では、入力画面1000は、要素種別入力項目1001と、役割入力項目1002と、検索文字列入力欄1003と、を有する。
Figure 10 is an explanatory diagram showing an example of an input screen for
要素種別入力項目1001は、検索対象となる構文要素の種類の選択をプルダウンで受け付ける項目である。検索対象となる構文要素の種類とは、たとえば、定数、関数、変数、クラス、型など、検索対象となるプログラミング言語の識別子になりえる要素である。
The element
役割入力項目1002は、構文要素の役割の選択をプルダウンで受け付ける項目である。構文要素の役割とは、変数の宣言、定義、初期化、更新、参照や、関数の宣言、定義、呼出など、各種構文要素のソースコードSCi上で割り当てられた働きである。
The
検索文字列入力欄1003は、検索対象とする構文要素を絞り込む検索文字列の入力を受け付ける入力欄である。なお、検索文字列入力欄1003にだけ検索文字列を入力すると、ソースコードSCi内のコメント文もヒットしてしまう可能性があるため、要素種別や役割を選択することにより、コメント文からのヒット数の抑制が可能となる。
The search
なお、入力画面1000は、要素種別入力項目1001と、役割入力項目1002と、検索文字列入力欄1003と、のうち、少なくとも1つあればよい。また、入力画面1000は、要素種別入力項目1001、役割入力項目1002および検索文字列入力欄1003以外に、検索文字列のマッチング方法(完全一致、前方一致、後方一致、正規表現など)などを選択する入力項目があってもよい。
The
また、入力画面1000は、検索条件500の候補条件501や仕分条件510を区別できるように、任意の名称を付けられるような入力項目を有していてもよい。さらに、入力画面1000は、候補条件501のみで類似見直しが完了する場合を考慮したボタンなどを有してもよい。加えて、入力画面1000は、検索において型名などを利用可能な項目を有してもよいし、検索文字列をソースコードSCiに含まれる識別子名から選択可能な項目を有してもよい。
The
図9に戻り、検索装置200は、入力画面1000から入力された候補条件501でソースコードSCiを検索し、修正候補箇所703を抽出する(ステップS903)。そして、検索装置200は、ステップS903の検索結果700B1を出力する(ステップS904)。検索結果700B1は、たとえば、検索装置200の出力デバイス304の一例となるディスプレイまたは検索装置200と通信可能なコンピュータのディスプレイに表示される。図10の検索結果700B1では、ソースコードSCi内の「func1」がある行の行番号702および修正候補箇所703がヒット行として表示される。
Returning to FIG. 9, the
つぎに、検索装置200は、ユーザから仕分条件510の入力がなくなるまで仕分条件510の入力を受け付ける(ステップS905)。
Next, the
図11は、仕分条件510の入力画面の例1を示す説明図である。仕分条件510の入力画面1100は、修正候補箇所における特定の要素の有無を確認する場合に利用するための画面である。仕分条件510の入力画面1100は、上述した要素種別入力項目1001、役割入力項目1002および検索文字列入力欄1003のほか、着目対象選択項目1101と、検索方向選択項目1102と、範囲制限選択項目1103と、一致属性選択項目1104と、不一致属性選択項目1105と、を含む。
Figure 11 is an explanatory diagram showing Example 1 of the input screen for sorting conditions 510. The
着目対象選択項目1101は、着目対象の選択をプルダウンで受け付ける項目である。仕分条件510に基づく仕分では、修正候補箇所703に含まれる文の少なくとも1つに着目し、その文または、その文の前後の文について、条件を満たすか否かの機械的な調査が実行される。この着目文(着目対象)を選択するための入力項目が、着目対象選択項目1101である。
The focus
着目対象選択項目1101により、ユーザは、検索条件500の木構造の中でより親の方にあるいずれかの候補条件501か仕分条件510を選択することが可能である。ただし、選択可能な仕分条件510は、条件一致した仕分結果502のみとする。
The
検索方向選択項目1102は、検索方向の選択をプルダウンで受け付ける項目である。検索方向選択項目1102のプルダウンには、たとえば、「同一ステートメント/制御条件」、「前方」、「後方」がある。それぞれ、「同一ステートメント/制御条件」は、仕分条件510の検索先が着目対象であることを示す。「前方」は、仕分条件510の検索先が着目対象の前方の文であることを示す。
Search
なお、「前方」の文は、着目対象から1つ前の文に限らず、あらかじめ設定された2以上の所定数前の文でもよい。「後方」は、仕分条件510の検索先が着目対象の後方の文であることを示す。なお、「後方」の文は、着目対象から1つ後の文に限らず、あらかじめ設定された2以上の所定数後の文でもよい。 Note that the "forward" sentence is not limited to the sentence immediately preceding the target of interest, but may be a predetermined number of sentences, two or more, that are set in advance. "Backward" indicates that the sorting condition 510 searches for a sentence that is later than the target of interest. Note that the "backward" sentence is not limited to the sentence immediately following the target of interest, but may be a predetermined number of sentences, two or more, that are set in advance.
範囲制限選択項目1103は、着目対象選択項目で選択された着目文に加え、もう一つの文に着目し、両文の間にある文に対する条件を指定したい場合に利用する項目である。したがって、検索方向が「同一ステートメント/制御条件」である場合は、無効となる項目である。範囲制限選択項目1103で着目する文を選択する際は、着目対象と同様に、ユーザは、検索条件500の木構造の中でより親の方にあるいずれかの候補条件501か仕分条件510を選択することができる。
The range
一致属性選択項目1104は、一致属性を選択する項目である。一致属性とは、仕分条件で検索した場合に仕分条件に一致した仕分結果502に付与する属性である。不一致属性選択項目1105は、不一致属性を選択する項目である。不一致属性とは、仕分条件で検索した場合に仕分条件に一致しなかった仕分結果502に付与する属性である。
The match
一致属性選択項目1104および不一致属性選択項目1105において、「修正対象」は、修正候補箇所を修正すべきであることを検索結果に表示するための選択肢である。「修正対象外」は、修正候補箇所を修正候補箇所から外すべきであることを検索結果に表示するための選択肢である。「細分」は、現時点では修正候補箇所を修正すべきか否かわからないため、さらに仕分条件を用いて細かく分析する必要があるということを検索結果に表示するための選択肢である。「個別調査」は、検索結果を個別に目視で調査すべきであることを検索結果に表示するための選択肢である。
In the matching
図12は、仕分条件510の入力画面の例2を示す説明図である。図12の入力画面1200は、修正候補箇所の構文木をも考慮可能な画面である。入力画面1200では、たとえば、候補条件となる関数の第1引数名が何であるか検索している状態ではわからない場合に、当該関数の第1引数が、たとえば、前方に出現した場合に検索するための画面である。
Figure 12 is an explanatory diagram showing example 2 of an input screen for sorting conditions 510. The
入力画面1200は、要素種別入力項目1001、役割入力項目1002、着目対象選択項目1101、検索方向選択項目1102、範囲制限選択項目1103、一致属性選択項目1104、および不一致属性選択項目1105のほか、第1構造選択項目1201、第2構造選択項目1202、第3構造選択項目1203、第1指定項目1204、第1詳細指定項目1205、第2指定項目1206、および第2詳細指定項目1207を有する。
The
第1構造選択項目1201~第3構造選択項目1203はそれぞれ、着目対象選択項目1101で選択された文の構文木のバリエーションを、構文木の根元から順に詳細になるような選択をプルダウンで受け付ける項目である。たとえば、着目対象の文が「a=1」、「b=func1()」、「b=func2(1,2)」、及び、「func2(2,func1())」を含む場合、変数を「Vn」、関数を「Fn」、定数を「Cn」で表すと、第1構造選択項目1201の選択肢は「V1=V2」、「V1=F1()」、および「指定なし」となる。
The first
この時、ユーザが第1構造選択項目1201で「V1=V2」を選択すると、第2構造選択項目1202が追加され、その選択肢は「V1=C1」、「V1=F1()」、および、「指定なし」となる。
At this time, if the user selects "V1 = V2" in the first
ここで、ユーザが第2構造選択項目1202で「V1=F1()」を選択すると、第3構造選択項目1203が追加され、その選択肢は「V1=F1()」、「V1=F2(V2,V3)」、および、「指定なし」となる。
Here, if the user selects "V1=F1()" in the second
第1指定項目1204、第1詳細指定項目1205、第2指定項目1206、および第2詳細指定項目1207は、第1構造選択項目1201~第3構造選択項目1203で、「指定なし」以外の最後に選択された項目(図12の場合は、第2構造選択項目1202)に含まれる変数や関数に対応する。
The first specified
たとえば、第1指定項目1204および第1詳細指定項目1205は、第2構造選択項目1202の「F1」に対応しており、第2指定項目1206および第2詳細指定項目1207は、第2構造選択項目1202の「V1」に対応する。
For example, the first specified
第1指定項目1204および第2指定項目1206は、変数や関数などの条件として、検索文字列を直接指定するか、または、検索条件500の木構造の中でより親の方にあるいずれかの仕分条件510における構文要素を選択するか、の指定を受け付ける項目である。検索文字列を直接指定する場合は、ユーザは、第1詳細指定項目1205に、対象としたい任意の文字列を入力する。構文要素を選択する場合は、ユーザは、第1詳細指定項目1205に、第2指定項目1206で指定した仕分条件510に含まれる構文要素を指定する。
The
たとえば、第1指定項目1204では検索文字列として「func1」を指定しており、第2指定項目1206では『仕分条件510の名称が「CID01」の構造選択における、「V1」という変数と同じ変数』を指定している。
For example, the first specified
図9に戻り、検索装置200は、図11または図12のように入力画面1100,1200に入力された仕分条件510に基づいて、修正対象箇所を検索し(ステップS906)、検索結果を出力する(ステップS907)。ユーザは、検索結果を参照して、仕分をしたければ、再度仕分条件510を入力し(ステップS905)、仕分をしたくなければ、検索装置200は、一連の処理を終了する。
Returning to FIG. 9, the
このように、実施例2によれば、すべての類似見直しに対応した検索条件500を作るのではなく、修正対象での工夫の実態を考慮しながら検索条件500を逐次作成可能とする。したがって、このような段階的な検索の実行により、不具合が発生する可能性がある箇所を特定する検索条件を容易に作成することができる。
In this way, according to the second embodiment, instead of creating
また、上述した検索装置200は、下記(1)~(10)のように構成することもできる。
The above-mentioned
(1)上述した検索装置は、プロセッサと、前記プロセッサがアクセス可能な記憶デバイスと、を有し、前記プロセッサは、ソースコード内の修正候補箇所を検索するための候補条件に基づいて、前記ソースコードから前記修正候補箇所を検索する検索処理と、前記候補条件とのプログラム上の依存関係に関する仕分条件に基づいて、前記検索処理によって検索された前記修正候補箇所を、仕分けの種類を示す複数の属性のいずれかに仕分ける仕分処理と、前記仕分処理による仕分結果を出力する出力処理と、を実行する。 (1) The above-mentioned search device has a processor and a storage device accessible to the processor, and the processor executes a search process that searches for candidate correction locations from the source code based on candidate conditions for searching for candidate correction locations in the source code, a sorting process that sorts the candidate correction locations found by the search process into one of a number of attributes indicating a sorting type based on sorting conditions related to program dependencies with the candidate conditions, and an output process that outputs the sorting results of the sorting process.
これにより、修正候補箇所の各々をどのように仕分けすべきか確認することができ、修正候補箇所の検索効率の向上を図ることができる。 This allows you to check how each of the correction candidates should be sorted, improving the efficiency of searching for correction candidates.
(2)上記(1)の検索装置において、前記候補条件と、前記候補条件から順次適用される前記依存関係が異なる一連の仕分条件と、により構成される検索条件にアクセス可能であり、前記仕分処理では、前記プロセッサは、前記前段の仕分条件による仕分結果にしたがった後段の仕分条件に基づいて、前記修正候補箇所を前記複数の属性のいずれかに仕分ける。 (2) In the search device of (1) above, search conditions consisting of the candidate conditions and a series of sorting conditions with different dependencies that are applied sequentially from the candidate conditions are accessible, and in the sorting process, the processor sorts the correction candidate parts into one of the multiple attributes based on a subsequent sorting condition that is in accordance with the sorting result of the previous sorting condition.
これにより、候補条件および複数の仕分け条件により1回の検索で修正候補箇所を効率的に絞り込むことができる。 This allows you to efficiently narrow down correction candidates with a single search using candidate conditions and multiple sorting conditions.
(3)上記(2)の検索装置において、前記複数の属性は、前記修正候補箇所が修正対象であることを示す第1属性、修正対象外であることを示す第2属性、または、前記修正候補箇所について個別調査が必要であることを示す第3属性のうち少なくとも1つを含み、前記仕分処理では、前記プロセッサは、前記仕分結果が前記第1属性、前記第2属性または前記第3属性となった修正候補箇所を仕分けしない。 (3) In the search device of (2) above, the multiple attributes include at least one of a first attribute indicating that the correction candidate portion is to be corrected, a second attribute indicating that it is not to be corrected, or a third attribute indicating that the correction candidate portion requires individual investigation, and in the sorting process, the processor does not sort the correction candidate portion for which the sorting result is the first attribute, the second attribute, or the third attribute.
これにより、修正候補箇所が第1属性であれば、ユーザは、当該修正候補箇所を修正すればよいことがわかる。また、修正候補箇所が第2属性であれば、ユーザは、当該修正候補箇所を修正対象外すればよいことがわかる。また、修正候補箇所が第2属性であれば、ユーザは、当該修正候補箇所の個別調査が必要であることがわかる。 As a result, if the correction candidate portion has the first attribute, the user knows that the correction candidate portion should be corrected. If the correction candidate portion has the second attribute, the user knows that the correction candidate portion should be excluded from correction. If the correction candidate portion has the second attribute, the user knows that the correction candidate portion needs to be individually investigated.
(4)上記(2)の検索装置において、前記複数の属性は、前記修正候補箇所について詳細な仕分けが必要であることを示す第4属性を含み、前記仕分処理では、前記プロセッサは、前記前段の仕分条件により前記第4属性を前記仕分結果とした場合の前記後段の仕分条件に基づいて、前記仕分結果が前記第4属性となった修正候補箇所を前記複数の属性のいずれかに仕分ける。 (4) In the search device of (2) above, the multiple attributes include a fourth attribute indicating that the correction candidate portion requires detailed sorting, and in the sorting process, the processor sorts the correction candidate portion for which the sorting result is the fourth attribute into one of the multiple attributes based on the sorting condition in the latter stage when the sorting result is the fourth attribute based on the sorting condition in the former stage.
これにより、修正候補箇所が第4属性であれば、ユーザは、新たな仕分け条件を入力して、その仕分結果を得ることができる。 As a result, if the correction candidate part is the fourth attribute, the user can input new sorting conditions and obtain the sorting results.
(5)上記(1)の検索装置において、前記ソースコードは、前記ソースコード内の文の位置情報を含み、前記出力処理では、前記プロセッサは、前記修正候補箇所の位置情報を含む前記仕分結果を出力する。 (5) In the search device of (1) above, the source code includes position information of sentences within the source code, and in the output process, the processor outputs the classification result including position information of the candidate correction locations.
これにより、ユーザは、修正候補箇所の位置がソースコードのどこに存在するかを把握することができる。 This allows the user to see where in the source code the suggested corrections are located.
(6)上記(1)の検索装置において、前記プロセッサは、前記候補条件とのプログラム上の依存関係と、前記候補条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理を実行し、前記仕分処理では、前記プロセッサは、前記入力処理によって入力された依存関係に関する仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記入力処理によって入力された依存関係に関する仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する。 (6) In the search device of (1) above, the processor executes an input process to accept input of program dependencies with the candidate conditions and attributes to be assigned to candidate correction parts that match the candidate conditions or candidate correction parts that do not match the candidate conditions, and in the sorting process, the processor assigns an attribute to candidate correction parts that match the sorting conditions related to dependencies input by the input process if the attribute has been input, and assigns an attribute to candidate correction parts that do not match the sorting conditions related to dependencies input by the input process if the attribute has been input.
これにより、候補条件に基づいて仕分された修正候補箇所に、事前に入力された属性を自動的に付与することができる。したがって、ユーザは、仕分された修正候補箇所をその後どのように扱うべきか容易に把握することができる。 This allows the attributes entered in advance to be automatically assigned to the correction candidate parts sorted based on the candidate conditions. This allows the user to easily understand how to handle the sorted correction candidate parts in the future.
(7)上記(1)の検索装置において、前記プロセッサは、前記候補条件とのプログラム上の依存関係と、前記仕分条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理を実行し、前記仕分処理では、前記プロセッサは、前記入力処理によって入力された依存関係に関する仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記入力処理によって入力された依存関係に関する仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する。 (7) In the search device of (1) above, the processor executes an input process to accept input of program dependencies with the candidate conditions and attributes to be assigned to candidate correction parts that match the sorting conditions or candidate correction parts that do not match the sorting conditions, and in the sorting process, the processor assigns an attribute to candidate correction parts that match the sorting conditions related to the dependencies input by the input process if the attribute has been input, and assigns an attribute to candidate correction parts that do not match the sorting conditions related to the dependencies input by the input process if the attribute has been input.
これにより、前段の仕分け条件に基づいて仕分された修正候補箇所に、事前に入力された属性を自動的に付与することができる。したがって、ユーザは、仕分された修正候補箇所をその後どのように扱うべきか容易に把握することができる。 This allows the attributes entered in advance to be automatically assigned to the correction candidate parts that have been sorted based on the previous sorting conditions. This allows the user to easily understand how to handle the sorted correction candidate parts in the future.
(8)上記(6)の検索装置において、前記入力処理では、前記プロセッサは、前記依存関係として、着目対象となる前記修正候補箇所と、前記着目対象からの前記ソースコード上の検索方向と、構文要素の種別と、の入力を受け付ける。 (8) In the search device of (6) above, in the input process, the processor accepts input of the modification candidate location of interest, the search direction in the source code from the location of interest, and the type of syntax element as the dependency relationship.
これにより、検索装置は、着目対象から離れた位置にある構文要素の行を修正対象箇所に含めることができる。 This allows the search device to include lines of syntax elements that are located away from the focus point in the section to be corrected.
(9)上記(6)の検索装置において、前記入力処理では、前記プロセッサは、前記依存関係として、着目対象となる前記修正候補箇所と、前記着目対象からの前記ソースコード上の検索方向と、検索文字列と、の入力を受け付ける。 (9) In the search device of (6) above, in the input process, the processor accepts input of the modification candidate location of interest, the search direction in the source code from the location of interest, and a search string as the dependency.
これにより、検索装置は、着目対象から離れた位置にある検索文字列の行を修正対象箇所に含めることができる。 This allows the search device to include lines of the search string that are located away from the focus area in the area to be corrected.
(10)上記(6)の検索装置において、前記入力処理では、前記プロセッサは、前記ソースコードの構文木に関する仕分条件の入力を受け付け、前記仕分処理では、前記プロセッサは、前記入力処理によって入力された依存関係および構文木に関する仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記入力処理によって入力された依存関係および構文木に関する仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する。 (10) In the search device of (6) above, in the input process, the processor accepts input of sorting conditions related to the syntax tree of the source code, and in the sorting process, for candidate correction parts that match the sorting conditions related to the dependencies and syntax tree input by the input process, the processor assigns the attribute to the candidate correction parts that match the sorting conditions if the attribute has been input, and for candidate correction parts that do not match the sorting conditions related to the dependencies and syntax tree input by the input process, the processor assigns the attribute to the candidate correction parts that do not match the sorting conditions if the attribute has been input.
これにより、構文要素がどのような名称であるか具体的に特定できない場合であっても、構文木に該当する修正候補箇所を検索することができる。 This makes it possible to search for correction candidates that correspond to the syntax tree even if you cannot specifically identify the name of a syntax element.
なお、本発明は前述した実施例に限定されるものではなく、添付した特許請求の範囲の趣旨内における様々な変形例及び同等の構成が含まれる。たとえば、前述した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明したすべての構成を備えるものに本発明は限定されない。また、ある実施例の構成の一部を他の実施例の構成に置き換えてもよい。また、ある実施例の構成に他の実施例の構成を加えてもよい。また、各実施例の構成の一部について、他の構成の追加、削除、または置換をしてもよい。 The present invention is not limited to the above-described embodiments, but includes various modified examples and equivalent configurations within the spirit of the appended claims. For example, the above-described embodiments have been described in detail to clearly explain the present invention, and the present invention is not necessarily limited to having all of the configurations described. Furthermore, a portion of the configuration of one embodiment may be replaced with the configuration of another embodiment. Furthermore, the configuration of another embodiment may be added to the configuration of one embodiment. Furthermore, other configurations may be added, deleted, or replaced with part of the configuration of each embodiment.
また、前述した各構成、機能、処理部、処理手段等は、それらの一部又は全部を、たとえば集積回路で設計する等により、ハードウェアで実現してもよく、プロセッサがそれぞれの機能を実現するプログラムを解釈し実行することにより、ソフトウェアで実現してもよい。 Furthermore, each of the configurations, functions, processing units, processing means, etc. described above may be realized in part or in whole in hardware, for example by designing them as integrated circuits, or may be realized in software by a processor interpreting and executing a program that realizes each function.
各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリ、ハードディスク、SSD(Solid State Drive)等の記憶装置、又は、IC(Integrated Circuit)カード、SDカード、DVD(Digital Versatile Disc)の記録媒体に格納することができる。 Information such as programs, tables, and files that realize each function can be stored in a storage device such as a memory, hard disk, or SSD (Solid State Drive), or in a recording medium such as an IC (Integrated Circuit) card, SD card, or DVD (Digital Versatile Disc).
また、制御線や情報線は説明上必要と考えられるものを示しており、実装上必要なすべての制御線や情報線を示しているとは限らない。実際には、ほとんどすべての構成が相互に接続されていると考えてよい。 In addition, the control lines and information lines shown are those considered necessary for explanation, and do not necessarily represent all control lines and information lines necessary for implementation. In reality, it is safe to assume that almost all components are interconnected.
SCi ソースコード
100 調査依頼
101,102 確認事項
200 検索装置
301 プロセッサ
302 記憶デバイス
303 入力デバイス
304 出力デバイス
500 検索条件
501 候補条件
502 仕分結果
510 仕分条件
1000,1100,1200 入力画面
Claims (9)
前記プロセッサは、
ソースコード内の修正候補箇所を検索するための候補条件に基づいて、前記ソースコードから前記修正候補箇所を検索する検索処理と、
前記候補条件とのプログラム上の依存関係と、前記候補条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理と、
前記入力処理によって入力された依存関係に関する仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記入力処理によって入力された依存関係に関する仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する仕分処理と、
前記仕分処理による仕分結果を出力する出力処理と、
を実行することを特徴とする検索装置。 A search device having a processor and a storage device accessible to the processor,
The processor,
a search process for searching for candidate correction locations from the source code based on candidate conditions for searching for candidate correction locations in the source code;
an input process for receiving input of program dependencies with the candidate conditions and attributes to be assigned to candidate correction portions that match the candidate conditions or candidate correction portions that do not match the candidate conditions;
a sorting process for assigning an attribute to a correction candidate portion that matches a sorting condition related to a dependency relationship input by the input process if the attribute has been input, and for assigning an attribute to a correction candidate portion that does not match a sorting condition related to a dependency relationship input by the input process if the attribute has been input;
an output process for outputting a sorting result obtained by the sorting process;
A search device that executes the above.
前記入力処理では、前記プロセッサは、前記依存関係として、着目対象となる前記修正候補箇所と、前記着目対象からの前記ソースコード上の検索方向と、構文要素の種別と、の入力を受け付ける、
ことを特徴とする検索装置。 The search device according to claim 1,
In the input process, the processor receives, as the dependency relationship, an input of the correction candidate portion to be focused on, a search direction in the source code from the portion to be focused on, and a type of syntax element.
A search device comprising:
前記入力処理では、前記プロセッサは、前記依存関係として、着目対象となる前記修正候補箇所と、前記着目対象からの前記ソースコード上の検索方向と、検索文字列と、の入力を受け付ける、
ことを特徴とする検索装置。 The search device according to claim 1,
In the input process, the processor receives, as the dependency relationship, an input of the correction candidate portion to be focused on, a search direction in the source code from the portion to be focused on, and a search string.
A search device comprising:
前記入力処理では、前記プロセッサは、前記ソースコードの構文木に関する仕分条件の入力を受け付け、
前記仕分処理では、前記プロセッサは、前記入力処理によって入力された依存関係および構文木に関する仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記入力処理によって入力された依存関係および構文木に関する仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する、
ことを特徴とする検索装置。 The search device according to claim 1,
In the input process, the processor receives an input of a classification condition regarding a syntax tree of the source code;
In the sorting process, the processor assigns an attribute to a correction candidate portion that matches the sorting conditions related to the dependency relationships and syntax trees input by the input process if the attribute has been input and assigns an attribute to a correction candidate portion that does not match the sorting conditions related to the dependency relationships and syntax trees input by the input process if the attribute has been input.
A search device comprising:
前記プロセッサは、The processor,
ソースコード内の修正候補箇所を検索するための候補条件に基づいて、前記ソースコードから前記修正候補箇所を検索する検索処理と、a search process for searching for candidate correction locations from the source code based on candidate conditions for searching for candidate correction locations in the source code;
前記候補条件とのプログラム上の依存関係と、前記依存関係に関する仕分条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理と、an input process for receiving input of program dependencies with the candidate conditions and attributes to be assigned to correction candidate portions that match or do not match the sorting conditions related to the dependencies;
前記仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する仕分処理と、a sorting process for assigning an attribute to a correction candidate portion that matches the sorting condition if the attribute has been input, and for assigning an attribute to a correction candidate portion that does not match the sorting condition if the attribute has been input;
前記仕分処理による仕分結果を出力する出力処理と、an output process for outputting a sorting result obtained by the sorting process;
を実行することを特徴とする検索装置。A search device that executes the above.
前記検索方法は、The search method includes:
前記プロセッサが、The processor,
ソースコード内の修正候補箇所を検索するための候補条件に基づいて、前記ソースコードから前記修正候補箇所を検索する検索処理と、a search process for searching for candidate correction locations from the source code based on candidate conditions for searching for candidate correction locations in the source code;
前記候補条件とのプログラム上の依存関係と、前記候補条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理と、an input process for receiving input of program dependencies with the candidate conditions and attributes to be assigned to candidate correction portions that match the candidate conditions or candidate correction portions that do not match the candidate conditions;
前記入力処理によって入力された依存関係に関する仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記入力処理によって入力された依存関係に関する仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する仕分処理と、a sorting process for assigning an attribute to a correction candidate portion that matches a sorting condition related to a dependency relationship input by the input process if the attribute has been input, and for assigning an attribute to a correction candidate portion that does not match a sorting condition related to a dependency relationship input by the input process if the attribute has been input;
前記仕分処理による仕分結果を出力する出力処理と、an output process for outputting a sorting result obtained by the sorting process;
を実行することを特徴とする検索方法。A search method comprising:
前記検索方法は、The search method includes:
前記プロセッサが、The processor,
ソースコード内の修正候補箇所を検索するための候補条件に基づいて、前記ソースコードから前記修正候補箇所を検索する検索処理と、a search process for searching for candidate correction locations from the source code based on candidate conditions for searching for candidate correction locations in the source code;
前記候補条件とのプログラム上の依存関係と、前記依存関係に関する仕分条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理と、an input process for receiving input of program dependencies with the candidate conditions and attributes to be assigned to correction candidate portions that match or do not match the sorting conditions related to the dependencies;
前記仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する仕分処理と、a sorting process for assigning an attribute to a correction candidate portion that matches the sorting condition if the attribute has been input, and for assigning an attribute to a correction candidate portion that does not match the sorting condition if the attribute has been input;
前記仕分処理による仕分結果を出力する出力処理と、an output process for outputting a sorting result obtained by the sorting process;
を実行することを特徴とする検索方法。A search method comprising:
ソースコード内の修正候補箇所を検索するための候補条件に基づいて、前記ソースコードから前記修正候補箇所を検索する検索処理と、a search process for searching for candidate correction locations from the source code based on candidate conditions for searching for candidate correction locations in the source code;
前記候補条件とのプログラム上の依存関係と、前記候補条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理と、an input process for receiving input of program dependencies with the candidate conditions and attributes to be assigned to correction candidate portions that match the candidate conditions or correction candidate portions that do not match the candidate conditions;
前記入力処理によって入力された依存関係に関する仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記入力処理によって入力された依存関係に関する仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する仕分処理と、a sorting process for assigning an attribute to a correction candidate portion that matches a sorting condition related to a dependency relationship input by the input process if the attribute has been input, and for assigning an attribute to a correction candidate portion that does not match a sorting condition related to a dependency relationship input by the input process if the attribute has been input;
前記仕分処理による仕分結果を出力する出力処理と、an output process for outputting a sorting result obtained by the sorting process;
を実行させることを特徴とする検索プログラム。A search program characterized by executing the above.
ソースコード内の修正候補箇所を検索するための候補条件に基づいて、前記ソースコードから前記修正候補箇所を検索する検索処理と、a search process for searching for candidate correction locations from the source code based on candidate conditions for searching for candidate correction locations in the source code;
前記候補条件とのプログラム上の依存関係と、前記依存関係に関する仕分条件に一致した修正候補箇所または不一致な修正候補箇所に付与すべき属性と、の入力を受け付ける入力処理と、an input process for receiving input of program dependencies with the candidate conditions and attributes to be assigned to correction candidate portions that match or do not match the sorting conditions related to the dependencies;
前記仕分条件に一致した修正候補箇所については、前記仕分条件に一致した修正候補箇所に付与すべき属性が入力されていれば当該属性を付与し、前記仕分条件に不一致な修正候補箇所については、前記仕分条件に不一致な修正候補箇所に付与すべき属性が入力されていれば当該属性を付与する仕分処理と、a sorting process for assigning an attribute to a correction candidate portion that matches the sorting condition if the attribute has been input, and for assigning an attribute to a correction candidate portion that does not match the sorting condition if the attribute has been input;
前記仕分処理による仕分結果を出力する出力処理と、an output process for outputting a sorting result obtained by the sorting process;
を実行させることを特徴とする検索プログラム。A search program characterized by executing the above.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020151724A JP7469999B2 (en) | 2020-09-10 | 2020-09-10 | Search device, search method, and search program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020151724A JP7469999B2 (en) | 2020-09-10 | 2020-09-10 | Search device, search method, and search program |
Publications (3)
| Publication Number | Publication Date |
|---|---|
| JP2022045948A JP2022045948A (en) | 2022-03-23 |
| JP2022045948A5 JP2022045948A5 (en) | 2023-02-10 |
| JP7469999B2 true JP7469999B2 (en) | 2024-04-17 |
Family
ID=80779629
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2020151724A Active JP7469999B2 (en) | 2020-09-10 | 2020-09-10 | Search device, search method, and search program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7469999B2 (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002222099A (en) | 2000-11-27 | 2002-08-09 | Fujitsu Ltd | Program development support device, recording medium, and program |
| JP2015088191A (en) | 2013-10-31 | 2015-05-07 | タタ コンサルタンシー サービシズ リミテッドTATA Consultancy Services Limited | System and method for facilitating user interface enabled review of static analysis alerts |
| JP2019168753A (en) | 2018-03-22 | 2019-10-03 | 三菱電機株式会社 | Source code analysis device and source code analysis program |
-
2020
- 2020-09-10 JP JP2020151724A patent/JP7469999B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002222099A (en) | 2000-11-27 | 2002-08-09 | Fujitsu Ltd | Program development support device, recording medium, and program |
| JP2015088191A (en) | 2013-10-31 | 2015-05-07 | タタ コンサルタンシー サービシズ リミテッドTATA Consultancy Services Limited | System and method for facilitating user interface enabled review of static analysis alerts |
| JP2019168753A (en) | 2018-03-22 | 2019-10-03 | 三菱電機株式会社 | Source code analysis device and source code analysis program |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2022045948A (en) | 2022-03-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9898280B2 (en) | Automatic code review and code reviewer recommendation | |
| JP6911059B2 (en) | Query optimizer for CPU utilization and code refactoring | |
| US9286035B2 (en) | Code remediation | |
| JP4876511B2 (en) | Logic extraction support device | |
| JP5775829B2 (en) | Software structure visualization program and system | |
| US8364696B2 (en) | Efficient incremental parsing of context sensitive programming languages | |
| JP2000347894A (en) | Source program check device and program recording medium thereof | |
| US9311077B2 (en) | Identification of code changes using language syntax and changeset data | |
| JP2018156133A (en) | Compiler program, information processing apparatus and compilation method | |
| CN113051262B (en) | A data quality inspection method, device, equipment and storage medium | |
| JP7469999B2 (en) | Search device, search method, and search program | |
| US9495133B1 (en) | Template-based BIOS component creation | |
| CN114356783A (en) | Method and device for automatically generating unit test code, storage medium and equipment | |
| JP5962350B2 (en) | Program, information processing apparatus and test method | |
| JP6748357B2 (en) | Analysis device, analysis program, and analysis method | |
| JP6993573B2 (en) | Program analysis method, program analysis device and program analysis program | |
| WO2024082983A1 (en) | Code recommendation method and apparatus, and related device | |
| JP4953896B2 (en) | Program review support device | |
| JP2015133031A (en) | Program analyzer and program analysis method | |
| JP6419357B2 (en) | Source code comparison device and source code comparison program | |
| JP7812346B2 (en) | Program verification support system and program verification support method | |
| JP2006277282A (en) | Model evaluation analysis system and model evaluation analysis program | |
| CN114217850B (en) | Multi-level assembly code fragment analysis method, system and device | |
| US20060122822A1 (en) | Language grammar driven recognizer of similar code fragments and methods | |
| Zapiain | Univariable Analysis |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230202 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230202 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20240130 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20240130 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20240228 |
|
| 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: 20240402 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20240405 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7469999 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |