JP7295599B1 - A program, system, and method for comprehensively visualizing aspects of data processing executed by a computer according to source code - Google Patents
A program, system, and method for comprehensively visualizing aspects of data processing executed by a computer according to source code Download PDFInfo
- Publication number
- JP7295599B1 JP7295599B1 JP2023076347A JP2023076347A JP7295599B1 JP 7295599 B1 JP7295599 B1 JP 7295599B1 JP 2023076347 A JP2023076347 A JP 2023076347A JP 2023076347 A JP2023076347 A JP 2023076347A JP 7295599 B1 JP7295599 B1 JP 7295599B1
- Authority
- JP
- Japan
- Prior art keywords
- line
- line number
- syntax
- subject
- identifying
- 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
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000012545 processing Methods 0.000 title claims description 33
- 238000010586 diagram Methods 0.000 claims abstract description 36
- 238000012790 confirmation Methods 0.000 claims description 18
- 238000000605 extraction Methods 0.000 claims description 8
- 238000012800 visualization Methods 0.000 abstract description 28
- 238000012360 testing method Methods 0.000 description 22
- 238000004891 communication Methods 0.000 description 6
- 238000012986 modification Methods 0.000 description 6
- 230000004048 modification Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 235000000332 black box Nutrition 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 230000004397 blinking Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Abstract
【課題】プログラムのテストにおける検証者の負担を軽減する技術を提供する。【解決手段】可視化用データ生成部111は、コンパイル済みのプログラムのソースコードを取得し、そのソースコードに対し行番号を付与する。続いて、可視化用データ生成部111は、構文種別、次に実行される行の行番号、条件文が示す条件が真である場合に実行される行の行番号、条件文が示す条件が偽である場合に実行される行の行番号、条件文の行と対となる終了行の行番号、条件文の行と対となる終了行の次の行の行番号、命令文により生成される変数(主語)の領域を宣言している行の行番号、当該主語の生成を命じる行の行番号、実行順序を指定する命令文の行番号を特定する。可視化部112は、ソースコードと、可視化用データ生成部111が特定した行番号と、主語と変数主語の対応関係とを示すデータを用いて、ソースコードの実行経路とデータの参照関係とを表す図を生成する。【選択図】図2A technique for reducing the burden on a verifier in program testing is provided. A visualization data generation unit 111 acquires source code of a compiled program and assigns line numbers to the source code. Subsequently, the visualization data generation unit 111 determines the syntax type, the line number of the line to be executed next, the line number of the line to be executed when the condition indicated by the conditional statement is true, and the condition indicated by the conditional statement is false. The line number of the line to be executed if , the line number of the end line paired with the conditional line, the line number of the line next to the end line paired with the conditional line, and the statement generated by Identify the line number of the line that declares the area of the variable (subject), the line number of the line that commands the generation of the subject, and the line number of the statement that specifies the execution order. The visualization unit 112 uses the source code, the line number specified by the visualization data generation unit 111, and the data indicating the correspondence relationship between the subject and the variable subject to represent the execution path of the source code and the reference relationship of the data. Generate diagrams. [Selection drawing] Fig. 2
Description
本発明は、コンピュータプログラムのソースコードをテストするための技術に関する。 The present invention relates to techniques for testing source code of computer programs.
コンピュータプログラム(以下、単に「プログラム」という)に従いコンピュータが意図されたとおりにデータ処理を行うことを確認するためのテストには、大きく、ブラックボックステストとホワイトボックステストがある。 Generally, there are black-box tests and white-box tests in tests for confirming that a computer processes data as intended according to computer programs (hereinafter simply referred to as "programs").
ブラックボックステストは、プログラムの内容には注目せず、コンピュータにサンプル値を入力し、想定どおりの値が出力されるかを検証することにより、プログラムの合否を判定するテストである。一方、ホワイトボックステストは、プログラムの内容に注目し、プログラムの構造、ロジック、制御の流れ等が意図されたとおりに記述されているか否かを検証することにより、プログラムの合否を判定するテストである。 A black-box test is a test that judges whether a program passes or fails by inputting sample values into the computer and verifying whether the expected values are output without paying attention to the contents of the program. On the other hand, white-box testing focuses on the contents of the program and verifies whether the structure, logic, control flow, etc. of the program are written as intended. be.
例えば、ホワイトボックステストに関する技術を開示している特許文献として、特許文献1がある。特許文献1に開示されている試験方法は、本体コードからテスト対象部分と、その依存部分とを抽出し、これらに基づき差分コードを生成するため、ユーザは、差分コードのみでホワイトボックステストを行うことができる、とされている。また、特許文献1に開示されている試験方法は、テスト結果及びテスト対象部分のコピーのハッシュ値を記憶し、当該ハッシュ値に基づき本体コードとの同一性を担保するため、ユーザは、本体コードの内容でテストが行われたこと、及び本体コードのテストの検証網羅度を確認することができる、とされている。
For example, there is
ホワイトボックステストは、プログラムの内容を網羅的に確認するテストであるため、プログラムに記述誤りが残りにくいが、プログラムの構造が複雑になる程、検証者の負担が増大する。その結果、例えば、プログラムを構成するモジュール単位であればホワイトボックステストは可能であっても、多数のモジュールが用いられたシステム全体に関しホワイトボックステストを行うことは、その負担が検証者の能力を超え、実質的に不可能な場合が多い。また、ブラックボックステストは、入力データと出力データに至る処理に関して正常に稼働することを目的としているが、プログラムが生成するデータ項目自体の属性及び生成される過程の確認はプログラムの実行任せになっており、仕様通りにプログラウが作成されているか否かの確認を行うことは難しい場合が多い。 Since the white-box test is a test that exhaustively checks the contents of the program, description errors are less likely to remain in the program. As a result, for example, even if it is possible to perform a white-box test for each module that constitutes a program, performing a white-box test for the entire system that uses many modules will impose a burden on the verifier's ability. exceeding and often practically impossible. The purpose of black box testing is to ensure that the processes leading up to input data and output data operate normally. Therefore, it is often difficult to check whether the program has been created according to the specifications.
上記を鑑み、本発明は、プログラムのテストにおける検証者の負担を軽減する技術を提供する。 In view of the above, the present invention provides a technique for reducing the burden on the verifier in testing programs.
本発明は、コンピュータに、コンピュータに、コンパイル済みのプログラムのソースコードを構成する複数の行の各々に行番号である第1行番号を付与する処理と、前記ソースコードに含まれる複数の行の各々に関し、当該行が単一の構文である場合は当該構文の種別である構文種別を特定し、当該行が複数の構文である場合は当該複数の構文を複数の単一の構文に分解した後、当該複数の単一の構文の各々の種別である構文種別を特定する処理と、前記ソースコードに含まれる複数の行の各々に関し、当該行の次に実行される行の行番号である第2行番号を特定する処理と、前記ソースコードに含まれる複数の構文のうち前記構文種別を特定する処理において特定された構文種別が条件文である構文の各々に関し、当該条件文が示す条件が真である場合に実行される行の行番号である第3行番号と、当該条件文が示す条件が偽である場合に実行される行の行番号である第4行番号と、当該条件文の行と対となる終了行の行番号である第5行番号と、当該終了行の次の行の行番号である第6行番号とを特定する処理と、前記構文種別を特定する処理において特定された構文種別が変数の生成を伴う命令文である行を特定し、特定した行の各々に関し、当該行の命令文により生成される変数を主語として特定するとともに、当該主語の領域を宣言している行の行番号と、当該主語の生成を命じる行の行番号とを成分とする第1座標を特定する処理と、前記構文種別を特定する処理において特定された構文種別が実行順序を指定する命令文である行を特定し、特定した行の各々に関し、当該行の行番号を成分とする第2座標を特定する処理と、前記主語を特定する処理において特定された主語の各々に関し、当該主語の生成に用いられる主語である変数主語を特定する処理と、前記ソースコードと、前記第1行番号乃至前記第6行番号と、前記第1座標と、前記第2座標と、特定した主語と当該主語の生成に用いられる変数主語の対応関係とを示すデータとを、可視化プログラムに入力されるデータとして生成する処理とを実行させるためのプログラムを提供する。 The present invention provides a computer with a process of giving a first line number, which is a line number, to each of a plurality of lines constituting a source code of a compiled program, and For each, if the line is a single syntax, the syntax type, which is the type of the syntax, is specified, and if the line is multiple syntaxes, the multiple syntaxes are decomposed into multiple single syntaxes. Then, for each of the plurality of lines included in the source code, the line number of the line to be executed next to the line is specified. The condition indicated by the conditional statement for each of the syntaxes whose syntax type specified in the process of specifying the second line number and the process of specifying the syntax type among the plurality of syntaxes included in the source code is a conditional statement is true, the third line number is the line number of the line to be executed if the condition indicated by the conditional is true, the fourth line number is the line number of the line to be executed if the condition indicated by the conditional statement is false, and the conditional A process of identifying the fifth line number, which is the line number of the end line paired with the sentence line, and the sixth line number, which is the line number of the line next to the end line; and the process of identifying the syntax type. Identify the line whose syntax type is an imperative sentence with variable generation, and for each identified line, identify the variable generated by the imperative sentence of the line as the subject, and the area of the subject A process of identifying the first coordinate whose components are the line number of the line that declares and the line number of the line that commands the generation of the subject; A process of identifying a line that is an imperative statement specifying, for each of the identified lines, a process of identifying a second coordinate whose component is the line number of the line, and each of the subjects identified in the process of identifying the subject Regarding, a process of identifying a variable subject that is a subject used to generate the subject, the source code, the first line number to the sixth line number, the first coordinate, the second coordinate, Provided is a program for executing a process of generating, as data to be input to a visualization program, data indicating the correspondence between a specified subject and a variable subject used to generate the subject.
本発明に係るプログラムに従いコンピュータが生成するデータによれば、汎用的な可視化プログラムを実行中のコンピュータが当該データを用いて、ソースコードの実行経路とデータの参照関係とを表す図を描くことができる。そして、プログラムの検証者は、その図を見ることによって、ソースコードに含まれる記述ミスを容易に発見できる。また、本発明の一実施態様によれば、プログラムの検証者は、生成される属性を含むデータ項目を見ることによって、データ生成処理の正統性も確認ができる。その結果、本発明によれば、プログラムのテストにおける検証者の負担が軽減される。 According to the data generated by the computer according to the program according to the present invention, a computer executing a general-purpose visualization program can use the data to draw a diagram representing the execution path of the source code and the reference relationship of the data. can. A program verifier can easily find description errors in the source code by looking at the diagram. Further, according to one embodiment of the present invention, the program verifier can confirm the legitimacy of the data generation process by looking at the data items including the generated attributes. As a result, according to the present invention, the burden on the verifier in testing the program is reduced.
[実施形態]
以下に、本発明の一実施形態にかかるプログラムPと、プログラムPに従いコンピュータが行う処理を説明する。
[Embodiment]
A program P according to an embodiment of the present invention and processing performed by a computer according to the program P will be described below.
図1は、プログラムPを実行するコンピュータ10の構成を示した図である。コンピュータ10は、一般的な端末装置用のコンピュータである。コンピュータ10は、プログラムに従い各種データ処理を行うプロセッサ101と、プログラムを含む各種データを記憶するメモリ102と、外部の装置との間で通信ネットワークを介したデータ通信を行う通信インタフェース103と、外部の装置との間で通信ネットワークを介さないデータの入出力を行う入出力インタフェース104を備える。
FIG. 1 is a diagram showing the configuration of a
入出力インタフェース104には、液晶ディスプレイ等の表示装置20と、キーボード、マウス等の入力装置30が接続されている。なお、コンピュータ10が表示装置20と入力装置30の一方又は両方を内蔵していてもよい。また、コンピュータ10が、内蔵するメモリ102に加えて、通信インタフェース103又は入出力インタフェース104を介して接続された外部の記憶装置にデータの一部を記憶してもよい。また、タッチスクリーンのように、表示装置20と入力装置30が一つの装置として構成されてもよい。
A
メモリ102には、プログラムPに加えて、可視化プログラムQが記憶されている。可視化プログラムQは、いわゆるグラフ化ツールと呼ばれる汎用プログラムである。コンピュータ10は、可視化プログラムQに従うデータ処理を行うことにより、複数のオブジェクトの間の関係を示す図を生成し、表示装置20にその図を表示させる。
In addition to the program P, a visualization program Q is stored in the
図2は、コンピュータ10がプログラムP及び可視化プログラムQを実行する際に実現されるデータ処理装置11の機能構成を示した図である。すなわち、コンピュータ10のプロセッサ101が、メモリ102に持続的に記憶されているプログラムP及び可視化プログラムQに従うデータ処理を実行すると、図2に示される構成部を備えるデータ処理装置11が実現される。以下に、図2に示されるデータ処理装置11の機能構成を説明する。
FIG. 2 is a diagram showing the functional configuration of the
データ処理装置11は、大きく、可視化用データ生成部111と、可視化部112を備える。可視化用データ生成部111はコンピュータ10がプログラムPを実行することにより実現される。一方、可視化部112はコンピュータ10が可視化プログラムQを実行するにより実現される。
The
可視化用データ生成部111は、記憶部1110、取得部1111、行番号付与部1112、データ型特定部1113、構文種別特定部1114、行番号特定部1115、主語特定部1116、変数主語特定部1117、データ生成部1118、データ出力部1119を備える。
The visualization
記憶部1110は、各種データを記憶する。記憶部1110が記憶するデータには、取得部1111が取得するソースコード、行番号付与部1112乃至データ型特定部1113が生成する中間データ、データ生成部1118が生成する最終データ(可視化用データ)が含まれる。
取得部1111は、外部の装置から、コンパイル済みのプログラムRのソースコードSを取得する。
The
図3は、取得部1111が取得するソースコードSの一部を例示した図である。図3に例示のソースコードSは、COBOLにより記述されているが、ソースコードSの記述に用いられるプログラミング言語はCOBOLに限られない。
FIG. 3 is a diagram exemplifying part of the source code S acquired by the
行番号付与部1112は、取得部1111が取得したソースコードSを構成する複数の行の各々に、行番号である第1行番号(以下、「SX」という)を付与する。図4は、ソースコードSに対し、行番号付与部1112により付与されたSXの一部を例示した図である。
The line
構文種別特定部1114は、ソースコードSに含まれる複数の行の各々に関し、当該行が単一の構文である場合は当該構文の種別である構文種別を特定し、当該行が複数の構文である場合は当該複数の構文を複数の単一の構文に分解した後、当該複数の単一の構文の各々の種別である構文種別を特定する。
The syntax
なお、構文とは、コンピュータが備えるデータ処理の機能(加算、減算、乗算、除算、関数呼び出し等)の1単位に応じた文を意味する。 Note that the syntax means a statement corresponding to one unit of data processing functions (addition, subtraction, multiplication, division, function call, etc.) provided in a computer.
図5は、構文種別特定部1114により、複数の構文である行が複数の単一の構文に分解され、また、各構文の構文種別が特定されて、特定された構文種別が各行に対応付けられたソースコードSの一部を例示した図である。
In FIG. 5, the syntax
例えば、図5において、ソースコードSのうちSXが33の行「UNTIL EMPNO = 999.」は、構文種別が「呼出文」の構文と、構文種別が「条件文(真)」の構文と、構文種別が「条件文(偽)」の構文が1つとなった行であるため、それらが異なる行に分解されている。 For example, in FIG. 5, the line "UNTIL EMPNO = 999." in which SX is 33 in the source code S has a syntax with a syntax type of "call statement", a syntax with a syntax type of "conditional statement (true)", Since the line has one syntax with the syntax type "conditional statement (false)", it is decomposed into different lines.
なお、構文種別は、プログラム言語毎に異なる。例えば、COBOLの場合、構文種別は、定置文、定値文、代入文、疑似代入、入力文、疑似入力、出力文、疑似出力、領域文、領域引数、条件文(真)、条件文(偽)、繰返文開始、繰返文終了、関数呼出、ユーザー定義関数呼出、翻訳文、注釈文、制御文、endif、then、else、制御条件、呼出文、セクション終了、セクション開始、制御入力、制御出力、段落、条件入力、段落終了等である。 Note that the syntax type differs for each programming language. For example, in COBOL, the syntax types are fixed statement, fixed value statement, assignment statement, pseudo assignment, input statement, pseudo input, output statement, pseudo output, area statement, area argument, conditional statement (true), conditional statement (false ), repeat statement start, repeat statement end, function call, user-defined function call, translation statement, comment statement, control statement, endif, then, else, control condition, call statement, section end, section start, control input, Control output, paragraph, conditional input, paragraph end, and so on.
データ型特定部1113は、命令文により生成される変数である主語の各々のデータ型を特定する。
The data
図6は、データ型特定部1113により特定されたデータ型が、当該データ型の主語の行に対応付けられたソースコードSの一部を例示した図である。なお、図6の例では、データ型の欄にはCOBOLにおいてデータ型を表現する文字列であるPICTURE文字列(PIC)が記載されている。例えば、図6のリストのSX欄が21の行のデータ型「X(3)」は、英数字3桁のデータ型を意味する。従って、ソースコードSがCOBOL以外のプログラミング言語で記載されている場合、データ型にはそのプログラミング言語に応じた表現形式のデータ型が記載される。
FIG. 6 is a diagram exemplifying part of the source code S in which the data type specified by the data
行番号特定部1115は、取得部1111が取得したソースコードSに含まれる複数の行の各々に関し、当該行の次に実行される行の行番号である第2行番号(以下、「SY」という)を特定し、特定したそれらの行番号をソースコードSの各行に対応付ける。
For each of the plurality of lines included in the source code S acquired by the
また、行番号特定部1115は、SYの特定に加え、以下の第3行番号乃至第6行番号を特定し、特定したそれらの行番号をソースコードSの各行に対応付ける。
In addition to identifying SY, the line
第3行番号(以下、「SZ1」という):構文種別特定部1114により特定された構文種別が条件文である構文の各々に関し、当該条件文が示す条件が真である場合に実行される行の行番号。
Third line number (hereinafter referred to as "SZ1"): a line executed when the condition indicated by the conditional statement is true for each of the statements whose syntax type is conditional statement specified by the syntax
第4行番号(以下、「SZ2」という):構文種別特定部1114により特定された構文種別が条件文である構文の各々に関し、当該条件文が示す条件が偽である場合に実行される行の行番号。
Fourth line number (hereinafter referred to as "SZ2"): a line that is executed when the condition indicated by the conditional statement is false for each of the statements whose syntax type is a conditional statement specified by the syntax
第5行番号(以下、「SZ3」という):構文種別特定部1114により特定された構文種別が条件文である構文の各々に関し、当該条件文の行と対となる終了行の行番号。
Fifth line number (hereinafter referred to as "SZ3"): For each syntax whose syntax type specified by the syntax
第6行番号(以下、「SZ4」という):構文種別特定部1114により特定された構文種別が条件文である構文の各々に関し、当該条件文の行と対となる終了行の次の行の行番号。
Sixth line number (hereinafter referred to as "SZ4"): For each of the syntaxes whose syntax type is conditional statement specified by the syntax
図7は、行番号特定部1115により特定されたSYとSZ1~SZ4が各行に対応付けられたソースコードSの一部を例示した図である。
FIG. 7 is a diagram exemplifying part of the source code S in which SY and SZ1 to SZ4 specified by the line
主語特定部1116は、構文種別が変数の生成を伴う命令文である行を特定し、特定した行の各々に関し、当該行の命令文により生成される変数を主語として特定するとともに、当該主語の領域を宣言している行の行番号(以下、「SX1」という)と、当該主語の生成を命じる行の行番号(以下、「SX2」という)とを成分とする第1座標([SX1,SX2])を特定する。
The
また、主語特定部1116は、構文種別が実行順序を指定する命令文である行を特定し、特定した行の各々に関し、当該行の行番号である「SX2」を成分とする第2座標([ ,SX2]又は[SX2,SX2])を特定する。
In addition, the
図8は、主語特定部1116により特定された主語と、第1座標([SX1,SX2])と、第2座標([ ,SX2]又は[SX2,SX2])が各行に対応付けられたソースコードSの一部を例示した図である。なお、図8において、主語及び第1座標は「主語(変数)」欄に含まれ、第2座標は「実行順序を決定する命令文」欄に含まれた形で記載されている。
FIG. 8 shows a source in which the subject specified by the
変数主語特定部1117は、主語の各々に関し、当該主語の生成に用いられる主語である変数主語(複数ある場合、それらの各々)を特定する。
For each subject, the variable
図9は、変数主語特定部1117により特定された、主語に応じた変数主語が、当該主語の行に対応付けられたソースコードSの一部を例示した図である。
FIG. 9 is a diagram exemplifying a part of the source code S in which the variable subject corresponding to the subject specified by the variable
データ生成部1118は、ソースコードSと、第1行番号(SX)、第2行番号(SY)、第3行番号~第6行番号(SZ1~SZ4)、第1座標([SX1,SX2])、第2座標([ ,SX2]又は[SX2,SX2])、主語と当該主語の生成に用いられる変数主語の対応関係とを示すデータ、及び、主語のデータ型を示すデータを含むデータを、可視化プログラムに入力されるデータ(以下、「可視化用データ」という)として生成する。
The
データ出力部1119は、データ生成部1118が生成した可視化用データを、可視化部112に出力する。
The
可視化部112は、可視化用データ生成部111から出力される可視化用データを用いて、ソースコードSの実行経路とデータの参照関係とを表す図(以下、「実行様相図G」という)を生成し、生成した実行様相図Gを表示装置20に出力し、表示装置20に実行様相図Gを表示させる。
The
図10は、表示装置20により表示される実行様相図Gの一部を例示したものである。実行様相図Gは、ソースコードSに含まれる複数の構文の各々に応じた表示体(図10の例では長方形の表示体)と、それらの構文に応じた命令文の実行順序を示す矢印と、それらの構文の間でデータの参照が行われる場合、それらのデータの参照元の構文の表示体から参照先の構文の表示体へと向かう矢印を含む。なお、構文に応じた表示体には、その構文の行の内容が表示される。また、主語に応じた表示体には、当該主語のデータ型(図11においては、「PIC:○○」の○○部分)が表示される。なお、「PIC」とは、既述のように、COBOLにおけるデータ型を表現する文字列(PICTURE文字列)を意味する。従って、ソースコードSがCOBOL以外のプログラミング言語により記述されている場合、PICに代えて、そのプログラミング言語に応じたデータ型が実行様相図Gに表示される。
FIG. 10 illustrates a part of the execution mode diagram G displayed by the
プログラムRのテストを行う検証者は、実行様相図Gを見て、プログラムRのソースコードSの実行様相、すなわち、ソースコードSに従い、コンピュータが実行する命令文の順序と、それらの構文間で引き渡されるデータの参照関係を容易に把握することができる。従って、検証者は、実行様相図Gに示されるソースコードSの実行様相が、プログラムRの仕様に従っているか否かを容易に判定できる。また、実行様相図Gには、主語のデータ型も表示される。その結果、検証者によるプログラムRのテストの作業における負担が軽減される。 A verifier who tests the program R looks at the execution mode diagram G and sees the execution mode of the source code S of the program R, that is, the order of statements executed by the computer according to the source code S, and the syntax between them It is possible to easily grasp the reference relationship of the transferred data. Therefore, the verifier can easily determine whether or not the execution mode of the source code S shown in the execution mode diagram G complies with the program R specifications. The execution mode diagram G also displays the data type of the subject. As a result, the burden of testing program R on the verifier is reduced.
[変形例]
上述した実施形態は本発明の一実施形態であって、本発明の技術的思想の範囲内において様々に変形され得る。以下にそれらの変形の例を示す。なお、以下の変形例の2以上が適宜、組み合わされてもよい。
[Modification]
The embodiment described above is one embodiment of the present invention, and can be variously modified within the scope of the technical idea of the present invention. Examples of these modifications are shown below. Note that two or more of the following modifications may be combined as appropriate.
(1)データ処理装置11が、可視化用データに基づいて、ソースコードSに含まれる複数の構文の中から、確認を要する構文を抽出する機能を備えてもよい。
(1) The
図11は、この変形例(以下、「変形例(1)」という)にかかるデータ処理装置11の機能構成を示した図である。変形例(1)にかかるデータ処理装置11は、上述した実施形態にかかるデータ処理装置11が備える可視化用データ生成部111と、可視化部112に加え、要確認構文抽出部113を備える。
FIG. 11 is a diagram showing the functional configuration of a
要確認構文抽出部113は、正統性確認用情報特定部1131と、構文抽出部1132を備える。
The confirmation-required
正統性確認用情報特定部1131は、可視化用データ生成部111のデータ出力部1119から出力される可視化用データを取得し、当該可視化用データに基づき、ソースコードSに含まれる複数の構文の各々に関し、当該構文が、参照先及び参照元のいずれも存在しない構文(以下、「浮島構文」という)、参照元は存在するが参照先が存在しない構文(以下、「出力線なし構文」という)、参照先は存在するが参照元が存在しない構文(以下、「入力線なし構文」という)、参照元が実行命令順序に従う参照元のみである構文(以下、「再帰構文」という)、のいずれであるかを、正統性確認用情報として特定する。
The authenticity confirmation
図12は、ソースコードSに含まれる複数の構文の各々に関し、正統性確認用情報特定部1131により特定された正統性確認用情報を対応付けて示した図の例である。
FIG. 12 is an example of a diagram showing each of a plurality of syntaxes included in the source code S in association with the authenticity confirmation information identified by the
構文抽出部1132は、ソースコードSに含まれる複数の構文の中から、構文種別と、正統性確認用情報特定部1131により特定された正統性確認用情報との組み合わせに基づき、確認を要する構文を、要確認構文として抽出する。要確認構文としては、例えば、以下のような構文が挙げられる。
The
入力線がない領域文
入力線がない領域引数
入力線がない定置文
入力線がない定値文
入力線がない入力文
入力線がない擬似入力
入力線及び出力線の一方又は両方がない代入文
入力線及び出力線の一方又は両方がない擬似代入
出力線がない出力文
出力線がない擬似出力
Region statements without input lines Region arguments without input lines Fixed statements without input lines Constant statements without input lines Input statements without input lines Pseudo-inputs without input lines Assignment statements without input and/or output lines Input Pseudo assignment without line and/or output line Output statement without output line Pseudo output without output line
構文抽出部1132は、抽出した要確認構文を示す要確認構文データを可視化部112に出力する。
The
可視化部112は、要確認構文抽出部113から受け取った要確認構文データに基づき、実行様相図Gを、確認を要する構文に応じた部分を他の部分と異なる態様で表すように変更し、変更した実行様相図Gを表示装置20に表示させる。ここで、異なる態様とは、太字表示、点滅表示、異なる色による表示、枠で囲む表示、等のいずれであってもよい。検証者は、実行様相図Gに他の部分と異なる態様で表されている構文に問題がないかを確認することで、ソースコードSのテストを容易に行うことができる。
Based on the confirmation-required syntax data received from the confirmation-required
また、可視化部112が、例えば、要確認構文のリスト(又は、要確認構文を他の構文と異なる態様で表示する構文のリスト)を表示装置20に表示させ、実行様相図Gのうち、そのリストから検証者により選択された構文に応じた部分を他の部分と異なる態様で表すように変更し、変更した実行様相図Gを表示装置20に表示させてもよい。
In addition, the
(2)本発明は、上述したプログラムPに例示されるプログラム、上述したプログラムPに従い処理を行うデータ処理装置11に例示されるシステム、及び、上述したプログラムPに従いコンピュータが行う方法を提供する。
(2) The present invention provides a program exemplified by the program P described above, a system exemplified by the
10…コンピュータ、11…データ処理装置、20…表示装置、30…入力装置、101…プロセッサ、102…メモリ、103…通信インタフェース、104…入出力インタフェース、111…可視化用データ生成部、112…可視化部、113…要確認構文抽出部、1110…記憶部、1111…取得部、1112…行番号付与部、1113…データ型特定部、1114…構文種別特定部、1115…行番号特定部、1116…主語特定部、1117…変数主語特定部、1118…データ生成部、1119…データ出力部、1131…正統性確認用情報特定部、1132…構文抽出部。
DESCRIPTION OF
Claims (7)
コンパイル済みのプログラムのソースコードを構成する複数の行の各々に行番号である第1行番号を付与する処理と、
前記ソースコードに含まれる複数の行の各々に関し、当該行が単一の構文である場合は当該構文の種別である構文種別を特定し、当該行が複数の構文である場合は当該複数の構文を複数の単一の構文に分解した後、当該複数の単一の構文の各々の種別である構文種別を特定する処理と、
前記ソースコードに含まれる複数の行の各々に関し、当該行の次に実行される行の行番号である第2行番号を特定する処理と、
前記ソースコードに含まれる複数の構文のうち前記構文種別を特定する処理において特定された構文種別が条件文である構文の各々に関し、当該条件文が示す条件が真である場合に実行される行の行番号である第3行番号と、当該条件文が示す条件が偽である場合に実行される行の行番号である第4行番号と、当該条件文の行と対となる終了行の行番号である第5行番号と、当該終了行の次の行の行番号である第6行番号とを特定する処理と、
前記構文種別を特定する処理において特定された構文種別が変数の生成を伴う命令文である行を特定し、特定した行の各々に関し、当該行の命令文により生成される変数を主語として特定するとともに、当該主語の領域を宣言している行の行番号と、当該主語の生成を命じる行の行番号とを成分とする第1座標を特定する処理と、
前記構文種別を特定する処理において特定された構文種別が実行順序を指定する命令文である行を特定し、特定した行の各々に関し、当該行の行番号を成分とする第2座標を特定する処理と、
前記主語を特定する処理において特定された主語の各々に関し、当該主語の生成に用いられる主語である変数主語を特定する処理と、
前記ソースコードと、前記第1行番号乃至前記第6行番号と、前記第1座標と、前記第2座標と、特定した主語と当該主語の生成に用いられる変数主語の対応関係とを示すデータとを、可視化プログラムに入力されるデータとして生成する処理と
を実行させるためのプログラム。 to the computer,
a process of assigning a first line number, which is a line number, to each of a plurality of lines constituting source code of a compiled program;
For each of a plurality of lines included in the source code, if the line is a single syntax, specifying the syntax type, which is the type of the syntax, and if the line is a plurality of syntaxes, the multiple syntaxes is decomposed into a plurality of single syntaxes, and then identifying the syntax type that is the type of each of the plurality of single syntaxes;
A process of identifying a second line number, which is the line number of the line to be executed next to the line, for each of the plurality of lines included in the source code;
A line executed when the condition indicated by the conditional statement is true for each of the plurality of statements included in the source code, with respect to each of the statements whose syntax type is a conditional statement specified in the processing for specifying the syntax type. 3rd line number which is the line number of , 4th line number which is the line number of the line to be executed when the condition indicated by the conditional statement is false, and the end line number which is paired with the conditional statement line a process of identifying the fifth line number, which is the line number, and the sixth line number, which is the line number of the line next to the end line;
Identifying a line in which the syntax type identified in the process of identifying the syntax type is an imperative sentence with variable generation, and identifying a variable generated by the imperative sentence of the identified line as a subject for each of the identified lines. A process of specifying a first coordinate whose components are the line number of the line declaring the area of the subject and the line number of the line commanding the generation of the subject;
Identifying lines in which the syntax type identified in the processing for identifying the syntax type is an imperative statement specifying an execution order, and identifying, for each of the identified lines, a second coordinate whose component is the line number of the line. processing;
A process of identifying a variable subject, which is a subject used to generate the subject, for each of the subjects identified in the subject identifying process;
Data indicating the source code, the first line number to the sixth line number, the first coordinate, the second coordinate, and the correspondence relationship between the specified subject and the variable subject used to generate the subject. A program for executing a process of generating and as data to be input to a visualization program.
前記可視化プログラムに入力されるデータを用いて前記ソースコードの実行経路とデータの参照関係とを表す図を表示装置に表示させる処理
を実行させるための請求項1に記載のプログラム。 to the computer running the visualization program;
2. The program according to claim 1, for causing a display device to display a diagram showing the execution path of the source code and the reference relationship of data using data input to the visualization program.
前記可視化プログラムに入力されるデータに基づき、前記ソースコードに含まれる複数の構文の各々に関し、当該構文が、参照先及び参照元のいずれも存在しない構文、参照元は存在するが参照先が存在しない構文、参照先は存在するが参照元が存在しない構文、及び、自らの構文を参照する構文、参照元が実行命令順序に従う参照元のみである構文、のいずれであるかを正統性確認用情報として特定する処理と、
前記ソースコードに含まれる複数の構文の中から、前記構文種別と前記正統性確認用情報との組み合わせに基づき、確認を要する構文を抽出する処理と
を実行させるための請求項1に記載のプログラム。 to said computer;
Based on the data input to the visualization program, for each of a plurality of syntaxes included in the source code, the syntax is a syntax in which neither the reference destination nor the referencing source exists, or the reference source exists but the reference destination exists. syntax that does not exist, a syntax that has a reference destination but no referencing entity, a syntax that refers to its own syntax, or a syntax that refers only to the referencing entity that follows the order of execution instructions. the process of identifying as information;
2. The program according to claim 1, for extracting a syntax requiring confirmation from among a plurality of syntaxes included in the source code, based on the combination of the syntax type and the authenticity confirmation information. .
前記可視化プログラムに入力されるデータを用いて前記ソースコードの実行経路を表す図であり、前記抽出する処理において抽出された確認を要する構文に応じた部分を他の部分と異なる態様で表す図を表示装置に表示させる処理
を実行させるための請求項3に記載のプログラム。 to the computer running the visualization program;
FIG. 4 is a diagram showing the execution path of the source code using the data input to the visualization program, wherein the part corresponding to the syntax requiring confirmation extracted in the extraction process is shown in a different manner from the other parts; 4. The program according to claim 3, for executing a process of displaying on a display device.
前記主語を特定する処理において特定された主語の各々に関し、当該主語のデータ型を特定する処理を実行させ、
前記可視化プログラムに入力されるデータを生成する処理において、前記データ型を示すデータを含む前記可視化プログラムに入力されるデータを生成させ、
前記可視化プログラムを実行中の前記コンピュータに、
前記可視化プログラムに入力されるデータを用いて前記ソースコードの実行経路とデータの参照関係と前記主語のデータ型とを表す図を表示装置に表示させる処理
を実行させるための請求項1に記載のプログラム。 to said computer;
for each subject identified in the subject identifying process, executing a process of identifying the data type of the subject;
generating data to be input to the visualization program including data indicating the data type in the process of generating data to be input to the visualization program;
to the computer running the visualization program;
2. The process of displaying, on a display device, a diagram representing the execution path of the source code, the reference relationship of the data, and the data type of the subject using the data input to the visualization program. program.
コンパイル済みのプログラムのソースコードを構成する複数の行の各々に行番号である第1行番号を付与する処理と、
前記ソースコードに含まれる複数の行の各々に関し、当該行が単一の構文である場合は当該構文の種別である構文種別を特定し、当該行が複数の構文である場合は当該複数の構文を複数の単一の構文に分解した後、当該複数の単一の構文の各々の種別である構文種別を特定する処理と、
前記ソースコードに含まれる複数の行の各々に関し、当該行の次に実行される行の行番号である第2行番号を特定する処理と、
前記ソースコードに含まれる複数の構文のうち前記構文種別を特定する処理において特定された構文種別が条件文である構文の各々に関し、当該条件文が示す条件が真である場合に実行される行の行番号である第3行番号と、当該条件文が示す条件が偽である場合に実行される行の行番号である第4行番号と、当該条件文の行と対となる終了行の行番号である第5行番号と、当該終了行の次の行の行番号である第6行番号とを特定する処理と、
前記構文種別を特定する処理において特定された構文種別が変数の生成を伴う命令文である行を特定し、特定した行の各々に関し、当該行の命令文により生成される変数を主語として特定するとともに、当該主語の領域を宣言している行の行番号と、当該主語の生成を命じる行の行番号とを成分とする第1座標を特定する処理と、
前記構文種別を特定する処理において特定された構文種別が実行順序を指定する命令文である行を特定し、特定した行の各々に関し、当該行の行番号を成分とする第2座標を特定する処理と、
前記主語を特定する処理において特定された主語の各々に関し、当該主語の生成に用いられる主語である変数主語を特定する処理と、
前記ソースコードと、前記第1行番号乃至前記第6行番号と、前記第1座標と、前記第2座標と、特定した主語と当該主語の生成に用いられる変数主語の対応関係とを示すデータとを、可視化プログラムに入力されるデータとして生成する処理と
を行うシステム。 By running the program
a process of assigning a first line number, which is a line number, to each of a plurality of lines constituting source code of a compiled program;
For each of a plurality of lines included in the source code, if the line is a single syntax, specifying the syntax type, which is the type of the syntax, and if the line is a plurality of syntaxes, the multiple syntaxes is decomposed into a plurality of single syntaxes, and then identifying the syntax type that is the type of each of the plurality of single syntaxes;
A process of identifying a second line number, which is the line number of the line to be executed next to the line, for each of the plurality of lines included in the source code;
A line executed when the condition indicated by the conditional statement is true for each of the plurality of statements included in the source code, with respect to each of the statements whose syntax type is a conditional statement specified in the processing for specifying the syntax type. 3rd line number which is the line number of , 4th line number which is the line number of the line to be executed when the condition indicated by the conditional statement is false, and the end line number which is paired with the conditional statement line a process of identifying the fifth line number, which is the line number, and the sixth line number, which is the line number of the line next to the end line;
Identifying a line in which the syntax type identified in the process of identifying the syntax type is an imperative sentence with variable generation, and identifying a variable generated by the imperative sentence of the identified line as a subject for each of the identified lines. A process of specifying a first coordinate whose components are the line number of the line declaring the area of the subject and the line number of the line commanding the generation of the subject;
Identifying lines in which the syntax type identified in the processing for identifying the syntax type is an imperative statement specifying an execution order, and identifying, for each of the identified lines, a second coordinate whose component is the line number of the line. processing;
A process of identifying a variable subject, which is a subject used to generate the subject, for each of the subjects identified in the subject identifying process;
Data indicating the source code, the first line number to the sixth line number, the first coordinate, the second coordinate, and the correspondence relationship between the specified subject and the variable subject used to generate the subject. and as data to be input to the visualization program.
コンパイル済みのプログラムのソースコードを構成する複数の行の各々に行番号である第1行番号を付与するステップと、
前記ソースコードに含まれる複数の行の各々に関し、当該行が単一の構文である場合は当該構文の種別である構文種別を特定し、当該行が複数の構文である場合は当該複数の構文を複数の単一の構文に分解した後、当該複数の単一の構文の各々の種別である構文種別を特定するステップと、
前記ソースコードに含まれる複数の行の各々に関し、当該行の次に実行される行の行番号である第2行番号を特定するステップと、
前記ソースコードに含まれる複数の構文のうち前記構文種別を特定するステップにおいて特定された構文種別が条件文である構文の各々に関し、当該条件文が示す条件が真である場合に実行される行の行番号である第3行番号と、当該条件文が示す条件が偽である場合に実行される行の行番号である第4行番号と、当該条件文の行と対となる終了行の行番号である第5行番号と、当該終了行の次の行の行番号である第6行番号とを特定するステップと、
前記構文種別を特定するステップにおいて特定された構文種別が変数の生成を伴う命令文である行を特定し、特定した行の各々に関し、当該行の命令文により生成される変数を主語として特定するとともに、当該主語の領域を宣言している行の行番号と、当該主語の生成を命じる行の行番号とを成分とする第1座標を特定するステップと、
前記構文種別を特定するステップにおいて特定された構文種別が実行順序を指定する命令文である行を特定し、特定した行の各々に関し、当該行の行番号を成分とする第2座標を特定するステップと、
前記主語を特定するステップにおいて特定された主語の各々に関し、当該主語の生成に用いられる主語である変数主語を特定するステップと、
前記ソースコードと、前記第1行番号乃至前記第6行番号と、前記第1座標と、前記第2座標と、特定した主語と当該主語の生成に用いられる変数主語の対応関係とを示すデータとを、可視化プログラムに入力されるデータとして生成するステップと
を備える方法。 the computer
assigning a first line number, which is a line number, to each of a plurality of lines constituting source code of a compiled program;
For each of a plurality of lines included in the source code, if the line is a single syntax, specifying the syntax type, which is the type of the syntax, and if the line is a plurality of syntaxes, the multiple syntaxes into a plurality of single syntaxes, and then identifying a syntax type that is the type of each of the plurality of single syntaxes;
identifying, for each of a plurality of lines included in the source code, a second line number that is the line number of the line to be executed next to the line;
a line executed when the condition indicated by the conditional statement is true for each of the plurality of statements included in the source code, with respect to each of the statements whose syntax type is the conditional statement specified in the step of specifying the syntax type; 3rd line number which is the line number of , 4th line number which is the line number of the line to be executed when the condition indicated by the conditional statement is false, and the end line number which is paired with the conditional statement line identifying the fifth line number, which is the line number, and the sixth line number, which is the line number of the line next to the end line;
Identifying lines in which the syntax type identified in the step of identifying the syntax type is an imperative sentence accompanied by the generation of a variable, and for each of the identified lines, identifying a variable generated by the imperative sentence of the line as a subject. and identifying a first coordinate whose components are the line number of the line declaring the domain of the subject and the line number of the line commanding the generation of the subject;
Identifying lines in which the syntax type identified in the step of identifying the syntax type is an imperative statement specifying an execution order, and identifying a second coordinate having a line number of the line as a component for each of the identified lines. a step;
for each subject identified in the step of identifying subjects, identifying a variable subject that is the subject used to generate the subject;
Data indicating the source code, the first line number to the sixth line number, the first coordinate, the second coordinate, and the correspondence relationship between the specified subject and the variable subject used to generate the subject. and generating as data input to a visualization program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2023076347A JP7295599B1 (en) | 2023-05-02 | 2023-05-02 | A program, system, and method for comprehensively visualizing aspects of data processing executed by a computer according to source code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2023076347A JP7295599B1 (en) | 2023-05-02 | 2023-05-02 | A program, system, and method for comprehensively visualizing aspects of data processing executed by a computer according to source code |
Publications (1)
Publication Number | Publication Date |
---|---|
JP7295599B1 true JP7295599B1 (en) | 2023-06-21 |
Family
ID=86772770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2023076347A Active JP7295599B1 (en) | 2023-05-02 | 2023-05-02 | A program, system, and method for comprehensively visualizing aspects of data processing executed by a computer according to source code |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7295599B1 (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11494295B1 (en) | 2019-02-07 | 2022-11-08 | Architecture Technology Corporation | Automated software bug discovery and assessment |
-
2023
- 2023-05-02 JP JP2023076347A patent/JP7295599B1/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11494295B1 (en) | 2019-02-07 | 2022-11-08 | Architecture Technology Corporation | Automated software bug discovery and assessment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8972954B2 (en) | Debugging method using program inspectors to debug programs developed using frameworks and libraries | |
US8434062B2 (en) | Enhancing source code debugging and readability using visual symbols | |
US9189462B2 (en) | Bidirectional text checker | |
JP4183192B2 (en) | Application program development support method, program, and information processing apparatus | |
US20080301553A1 (en) | Verifying compliance of user interfaces with desired guidelines | |
US9152537B2 (en) | Semantic stack trace | |
CN101751281A (en) | System and method for generating compiler | |
CN111797020A (en) | Mock data method and device based on dynamic bytecode | |
CN111475390A (en) | Log collection system deployment method, device, equipment and storage medium | |
CN112667230A (en) | Application program user interface development method, device, equipment and storage medium | |
US9557965B2 (en) | Method for programming language dependent merging of program codes | |
JP2013134573A (en) | Software correction device, software correction system, software correction method and software correction program | |
Hristov et al. | A model for designing accessible color and contrast for users with visual deficiency and color blindness | |
Kyaw et al. | A Code Completion Problem in Java Programming Learning Assistant System. | |
Lemos et al. | Integration testing of object-oriented and aspect-oriented programs: A structural pairwise approach for java | |
WO2017141893A1 (en) | Software analysis apparatus and software analysis method | |
US11726781B2 (en) | Code reading supporting device, code reading supporting method, and storage medium | |
JP7295599B1 (en) | A program, system, and method for comprehensively visualizing aspects of data processing executed by a computer according to source code | |
CN108763054B (en) | Test effect display method of test case, electronic device and storage medium | |
US10048951B2 (en) | Method for type checking and transformation of a computer program with first-class static functions | |
CN112579475A (en) | Code testing method, device, equipment and readable storage medium | |
US20230048792A1 (en) | Verification of control coupling and data coupling analysis in software code | |
CN114756183A (en) | Data printing method, device, equipment and storage medium | |
JP2016057715A (en) | Graphic type program analyzer | |
Alves et al. | Avoiding code pitfalls in aspect-oriented programming |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230510 |
|
A871 | Explanation of circumstances concerning accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A871 Effective date: 20230510 |
|
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: 20230523 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230602 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7295599 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |