JP2009026163A - Database verification method and device - Google Patents

Database verification method and device Download PDF

Info

Publication number
JP2009026163A
JP2009026163A JP2007190368A JP2007190368A JP2009026163A JP 2009026163 A JP2009026163 A JP 2009026163A JP 2007190368 A JP2007190368 A JP 2007190368A JP 2007190368 A JP2007190368 A JP 2007190368A JP 2009026163 A JP2009026163 A JP 2009026163A
Authority
JP
Japan
Prior art keywords
template
verification
constraint information
statement
sql
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2007190368A
Other languages
Japanese (ja)
Other versions
JP5076700B2 (en
Inventor
Asako Katayama
朝子 片山
Tadahiro Uehara
忠弘 上原
Toshihiro Odaka
敏裕 小高
Yuka Tanaka
ユカ 田中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2007190368A priority Critical patent/JP5076700B2/en
Publication of JP2009026163A publication Critical patent/JP2009026163A/en
Application granted granted Critical
Publication of JP5076700B2 publication Critical patent/JP5076700B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To automatically verify whether the contents of DB data ensure consistency in a business. <P>SOLUTION: Constraint information for a DB is collated with analytic templates to specify an analytic template corresponding to the constraint information, and values of variables in the analytic template are specified from the constraint information. Relevant variable values are combined with a parameter acquiring SQL template corresponding to the analytic template to generate an SQL statement, and the SQL statement is output to the DB to acquire search results as parameters. A verifying SQL statement in which relevant variable values and any of the parameters are combined with a verifying SQL template corresponding to the analytic template is output to the DB to acquire a search result as a verification result. Whether the verification result satisfies a verification statement generated from a verification statement template corresponding to the analytic template is determined, and if it is satisfied, a log containing the parameter combined in the verifying SQL statement is generated. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、データベースに格納されているデータの内容について業務上の整合がとれているか検証するための技術に関する。   The present invention relates to a technique for verifying whether the contents of data stored in a database are consistent in business.

従来、業務アプリケーションのテストや運用環境において、データベース(DB)に格納されているDBデータについて業務上の整合性がとれているかどうかを検証する場合、例えば以下のような2つの方法が存在していた。   Conventionally, in a business application test or operational environment, there are two methods for verifying whether business data consistency is achieved for DB data stored in a database (DB), for example, as follows. It was.

(a)例えば、SQL等を使ってDBデータが業務上の整合性を保っているかどうかを、カラム毎、又はテーブル間に渡ってユーザが1つ1つ検証する方法がある。しかし、この方法では検証のためのSQL文をいちいち記述しなければならず、工数がかかり、内容によっては記述自体が困難な場合がある。特に、規模が大きいDBにおいて、設計の制約条件事項毎に、ユーザがSQL文を記述して実行するのは非常に困難な作業である。   (A) For example, there is a method in which the user verifies whether DB data is consistent in business using SQL or the like for each column or between tables. However, in this method, the SQL sentence for verification must be described one by one, which takes man-hours and the description itself may be difficult depending on the contents. In particular, in a large scale DB, it is extremely difficult for a user to describe and execute an SQL statement for each design constraint condition item.

(b)これに対して、データベース間の関係情報を利用して項目間の関連するデータを取得する方法がある。このような方法に類似するものとしては、例えば特開2007−4447号公報記載の技術がある。具体的には、入力された1の項目名に基づいて、テーブル名と当該テーブルが有する1以上の項目名とを対応付けて記憶しているテーブル定義テーブルを参照して、上記1の項目名を有する第一のテーブル名を抽出する第一テーブル抽出ステップと、共通の項目を有することにより関係付けられている2つのテーブルを対応付けて記憶しているテーブルリンクテーブルを参照して、第一のテーブル名に基づいて、対応付けられている関連テーブルを抽出し、さらに当該関連テーブルに対応付けられている他の関連テーブルがある場合にはすべての当該関連テーブルを抽出する関連テーブル抽出ステップと、上記1の項目名に対応付けられて入力されたデータ値に、第一テーブルにおいて対応付けられているすべての項目のデータ値を取得し、関連テーブル抽出機能により抽出した1以上の関連テーブルから、共通の項目を介して上記入力されたデータ値に対応づけられているすべてのデータ値を取得するデータ取得ステップとが実行される。しかしながら、制約条件がないために業務上の整合性まで検証することはできない。
特開2007−4447号公報
(B) On the other hand, there is a method of acquiring related data between items using relation information between databases. As a method similar to such a method, for example, there is a technique described in Japanese Patent Application Laid-Open No. 2007-4447. Specifically, referring to the table definition table that stores the table name and one or more item names of the table in association with each other based on the input item name, the item name 1 The first table extraction step for extracting the first table name having the first table name and the table link table storing the two tables related by having a common item in association with each other, A related table extracting step of extracting a related table associated with the related table and extracting all the related tables when there is another related table associated with the related table; , Obtain data values of all items associated with the first table in the data values input in association with the item name of 1 above, From one or more related tables extracted by continuous table extractor, a data acquisition step of acquiring all the data values that are associated to the input data value via the common item is executed. However, since there are no constraints, business consistency cannot be verified.
JP 2007-4447 A

アプリケーション・プログラムをテストする場合、データベースを必要とする場合があるが、当該データベースに業務上の整合性のとれたデータを格納しておかないと、正しいテスト結果を得られない。しかし、上で述べたようにデータベースに業務上の整合性のとれたデータが格納されているか否かを検証することは、非常に手間が掛かる作業となる。   When testing an application program, a database may be required. However, correct data cannot be obtained unless business-consistent data is stored in the database. However, as described above, it is very time consuming to verify whether or not business-consistent data is stored in the database.

従って、本発明の目的は、データベースに格納されているデータの内容について業務上の整合がとれているか自動的に検証するための技術を提供することである。   Therefore, an object of the present invention is to provide a technique for automatically verifying whether the contents of data stored in a database are consistent in business.

本発明に係るデータベース検証方法は、検証対象データベースを含むデータベースに格納されるデータ項目についての制約条件についての制約情報を格納する制約情報格納部と、制約情報の解析用テンプレートと当該解析用テンプレートに対応する検証用SQLテンプレート、パラメータ取得用SQLテンプレート及び検証文テンプレートとを格納するテンプレート格納部とにアクセス可能であり、処理部を有するコンピュータに実行される。そして、本データベース検証方法は、制約情報格納部に格納されている制約情報と、テンプレート格納部に格納されている解析用テンプレートとをマッチングさせて、当該制約情報にマッチする解析用テンプレートを特定すると共に、当該制約情報から、特定された上記解析用テンプレートにおける変数の値を特定するステップと、特定された上記解析用テンプレートに対応するパラメータ取得用SQLテンプレートと、特定された上記変数の値のうち該当するものとを組み合わせることによってパラメータ取得用SQL文を生成し、当該パラメータ取得用SQL文をデータベースに対して実行して、当該検索結果をパラメータとして取得するステップと、特定された上記解析用テンプレートに対応する検証用SQLテンプレートと、特定された上記変数の値のうち該当するものと、取得された上記パラメータのいずれかとが組み合わせられた検証用SQL文をデータベースに対して実行して、検索結果を第2の検索結果として取得する検索結果取得ステップと、取得された上記第2の検索結果が、特定された上記解析用テンプレートに対応する検証文テンプレートと検証用SQL文とが組み合わされた検証文を充足するものであるか判断し、充足する場合に、第2の検索結果をもたらした検証用SQL文に組み合わされたパラメータを含むログを生成するログ生成ステップとを含む。   The database verification method according to the present invention includes a constraint information storage unit that stores constraint information about constraint conditions for data items stored in a database including a database to be verified, an analysis template for constraint information, and the analysis template. A template storage unit that stores the corresponding verification SQL template, parameter acquisition SQL template, and verification statement template is accessible and executed by a computer having a processing unit. The database verification method matches the constraint information stored in the constraint information storage unit with the analysis template stored in the template storage unit, and identifies an analysis template that matches the constraint information. And the step of identifying the value of the variable in the identified analysis template from the constraint information, the parameter acquisition SQL template corresponding to the identified analysis template, and the value of the identified variable Generating a parameter acquisition SQL statement by combining with the corresponding one, executing the parameter acquisition SQL statement on the database and acquiring the search result as a parameter, and the identified analysis template SQL template for verification corresponding to A search result obtained by executing, for the database, a verification SQL statement in which the corresponding one of the values of the variables and any of the acquired parameters is combined, and acquiring the search result as a second search result Determining whether the acquisition step and the acquired second search result satisfy a verification sentence in which a verification sentence template corresponding to the identified analysis template and a verification SQL sentence are combined; And a log generation step of generating a log including parameters combined with the verification SQL sentence that has resulted in the second search result.

このような構成によれば、機械読取り可能な設計情報における制約情報を有効活用して、自動的にデータベースに対する検証処理を実施することができるようになる。   According to such a configuration, it is possible to automatically perform verification processing on a database by effectively using constraint information in machine-readable design information.

また、上で述べたログ生成ステップにおいて、特定された上記解析用テンプレート及び特定された上記変数の値のうち特定の変数の値に対応する検証文テンプレートが用いられる場合もある。制約情報に応じた様々なテンプレートが用意されれば、自動的に検証を行うことができるデータベースを増やすことができる。   In addition, in the log generation step described above, a verification sentence template corresponding to a specific variable value among the specified analysis template and the specified variable value may be used. If various templates corresponding to the constraint information are prepared, the number of databases that can be automatically verified can be increased.

なお、本方法をコンピュータに実行させるためのプログラムを作成することができ、このプログラムは、例えばフレキシブルディスク、CD−ROM、光磁気ディスク、半導体メモリ、ハードディスク等の記憶媒体又は記憶装置に格納される。また、ネットワークなどを介してデジタル信号として配信される場合もある。尚、中間的な処理結果はメインメモリ等の記憶装置に一時保管される。   A program for causing a computer to execute this method can be created, and this program is stored in a storage medium or storage device such as a flexible disk, a CD-ROM, a magneto-optical disk, a semiconductor memory, or a hard disk. . Moreover, it may be distributed as a digital signal via a network or the like. The intermediate processing result is temporarily stored in a storage device such as a main memory.

本発明によれば、データベースに格納されているデータの内容について業務上の整合がとれているか自動的に検証することができるようになる。   According to the present invention, it is possible to automatically verify whether the contents of data stored in a database are consistent in business.

本発明の一実施の形態に係るデータベース検証装置の機能ブロック図を図1に示す。本実施の形態に係るデータベース検証装置100は、設計情報に含まれる制約情報を格納する制約情報格納部1と、以下で説明する各種テンプレートを格納するテンプレート格納部3と、制約情報格納部1及びテンプレート格納部3に格納されたデータを用いて処理を行う制約情報読み取り部5と、制約情報読み取り部5の処理結果である変数データを格納する変数データ格納部7と、変数データ格納部7及びテンプレート格納部3に格納されているデータを用い且つ制約情報読み取り部5の処理結果に応じて処理を実施する検証文生成部9と、検証文生成部9による処理結果を格納する検証文データ格納部13と、変数データ格納部7及びテンプレート格納部3に格納されているデータを用い且つ制約情報読み取り部5の処理結果に応じて処理を実施し、検証対象データベースを含むDB200に対して検索を実施するパラメータ検出部11と、パラメータ検出部11の検索結果であるパラメータを格納するパラメータ格納部15と、検証文データ格納部13及びパラメータ格納部15に格納されているデータを用いて処理を実施し、DB200に対して検索を実施する検証実行部17と、検証実行部17の処理結果である評価ログを格納する評価ログ格納部19と、評価ログ格納部19に格納されているデータを出力する出力部21とを有する。   A functional block diagram of a database verification apparatus according to an embodiment of the present invention is shown in FIG. The database verification apparatus 100 according to the present embodiment includes a constraint information storage unit 1 that stores constraint information included in design information, a template storage unit 3 that stores various templates described below, a constraint information storage unit 1, A constraint information reading unit 5 that performs processing using the data stored in the template storage unit 3, a variable data storage unit 7 that stores variable data that is a processing result of the constraint information reading unit 5, a variable data storage unit 7 and A verification statement generation unit 9 that uses the data stored in the template storage unit 3 and performs processing according to the processing result of the constraint information reading unit 5, and a verification statement data storage that stores the processing result of the verification statement generation unit 9 Section 13, using data stored in variable data storage section 7 and template storage section 3, and depending on the processing result of constraint information reading section 5 A parameter detection unit 11 that performs a search on the DB 200 including the database to be verified, a parameter storage unit 15 that stores a parameter that is a search result of the parameter detection unit 11, a verification sentence data storage unit 13, A verification execution unit 17 that performs processing using data stored in the parameter storage unit 15 and performs a search on the DB 200, and an evaluation log storage unit that stores an evaluation log that is a processing result of the verification execution unit 17 19 and an output unit 21 for outputting data stored in the evaluation log storage unit 19.

次に、図2に制約情報格納部1に格納されるデータの一例を示す。本実施の形態では、3つのカラムのうち、一番左のカラムには検証対象データベース名(テーブル名)、左から二番目のカラムには検証対象カラム名、一番右のカラムにはチェック内容が登録されるようになっている。図2の例では、検証対象データベースが「注文DB」であり、検証対象カラムが「商品コード」であり、チェック内容が「商品DB.商品コードに存在する」となっている。制約情報は、このようにテーブル間に渡る制約条件を記述する場合(関連チェックと呼ぶ)もあれば、1つのカラムについての制約条件を記述する場合(単項チェックと呼ぶ)もあれば、1つのテーブルにおけるカラム間の制約条件を記述する場合(単関連チェックと呼ぶ)もある。制約情報は、制約情報読み取り部5が処理できるような形式で記述される。なお、制約情報は、設計情報に含まれるものであり、設計情報を有効活用するものである。   Next, FIG. 2 shows an example of data stored in the constraint information storage unit 1. In this embodiment, among the three columns, the leftmost column is the database name to be verified (table name), the second column from the left is the name of the verification target column, and the rightmost column is the check contents Is to be registered. In the example of FIG. 2, the verification target database is “order DB”, the verification target column is “product code”, and the check content is “product DB. Exists in product code”. In some cases, the constraint information describes a constraint condition between tables (referred to as “relevant check”), and may describe a constraint condition for one column (referred to as “unary check”). In some cases, a constraint between columns in a table is described (referred to as single association check). The constraint information is described in a format that can be processed by the constraint information reading unit 5. Note that the constraint information is included in the design information and effectively utilizes the design information.

図3乃至図6にテンプレート格納部3に格納されるデータの一例を示す。図3は、制約情報とマッチングを行う文法パターン(制約情報の解析を行うためのテンプレートであり、解析用テンプレートとも呼ぶ)の一例を示す。本実施の形態では、(1)乃至(3)の3つの文法パターンを示しており、(1)は検証対象テーブルが「AA」で、検証対象カラムが「BB」で、チェック内容が「YY.ZZに存在する」というパターンであり、(2)は検証対象テーブルが「AA」で、検証対象カラムが「BB」で、チェック内容が「YY.ZZに存在しない」というパターンであり、(3)は検証対象テーブルが「EE」で、検証対象カラムが「II」で、チェック内容が「CC.DD=EE.FF&&CC.GG[H]EE.II」([H]は<、>、=、≦、≧、≠のいずれか)というパターンである。「AA」「BB」「CC」「DD」「EE」「FF」「GG」「II」は、変数であり、マッチングの際にはどのような値(データ)であってもよい。   An example of data stored in the template storage unit 3 is shown in FIGS. FIG. 3 shows an example of a grammar pattern (a template for analyzing constraint information, also referred to as an analysis template) for matching with constraint information. In this embodiment, three grammatical patterns (1) to (3) are shown. In (1), the verification target table is “AA”, the verification target column is “BB”, and the check content is “YY”. (2) is a pattern in which the verification target table is “AA”, the verification target column is “BB”, and the check content is “not present in YY.ZZ” ( 3) The verification target table is “EE”, the verification target column is “II”, and the check content is “CC.DD = EE.FF && CC.GG [H] EE.II” ([H] is <,>, =, ≦, ≧, ≠). “AA”, “BB”, “CC”, “DD”, “EE”, “FF”, “GG”, and “II” are variables, and any value (data) may be used for matching.

(1)は、例えば「注文DBの商品コードが商品DB.商品コードに存在する」というような制約に対してマッチングをとるためのパターンであり、(2)は、「新規お客さまDBのお客さまIDが得意先DB.利用者IDに存在しない」というような制約に対してマッチングをとるためのパターンであり、(3)は、「DB1.伝票番号=DB3.注文伝票番号である時、そのDB1.注文日はDB3.購入日以降である」や「広告DB.お客さまID=購入履歴DB.お客さまIDである時、その広告DB.お勧め商品は購入履歴DB.購入済み商品とは異なる」というような制約に対してマッチングをとるためのパターンである。   (1) is a pattern for matching against a restriction such as “Product code of order DB exists in product DB. Product code”, and (2) is “Customer of new customer DB”. Is a pattern for matching against a restriction such as “Customer DB does not exist in customer DB. User ID”, and (3) is “When DB1.slip number = DB3.order slip number, “DB1. Order date is after DB3. Purchase date” or “Advertisement DB. Customer ID = Purchase history DB. When customer ID”, the advertisement DB. Recommended product is purchase history DB. This is a pattern for matching against constraints such as “is different”.

図4は、テンプレート格納部3に格納される擬似SQL文テンプレートの一例を示す。図4の(1)乃至(3)は、図3における(1)乃至(3)との対応関係を示す。擬似SQL文テンプレートは、最終的にDB200に対して実行する検証のための検索におけるSQL文のテンプレートである。(1)は、Select YY.ZZ where AA.BB=[X]であり、[X]は後にパラメータとして抽出される値を代入する部分を示す。(2)も同様である。(3)は、Select EE.FF from EE where EE.FF=[X] and CC.GG[H]EE.IIであり、[X]は後にパラメータとして抽出される値を代入する部分を示す。[H]は上で述べたものと同様である。当然ながら、「AA」「BB」「CC」「DD」「EE」「FF」「GG」「II」は、変数であり、文法パターンによってマッチングを取る際に特定された変数値が代入される。   FIG. 4 shows an example of a pseudo SQL sentence template stored in the template storage unit 3. (1) to (3) in FIG. 4 show the correspondence with (1) to (3) in FIG. The pseudo SQL statement template is a template of an SQL statement in a search for verification that is finally executed on the DB 200. (1) is for Select YY. ZZ where AA. BB = [X], and [X] indicates a part for substituting a value to be extracted later as a parameter. The same applies to (2). (3) Select EE. FF from EE where EE. FF = [X] and CC. GG [H] EE. II, and [X] indicates a part for substituting a value to be extracted later as a parameter. [H] is the same as described above. Of course, “AA”, “BB”, “CC”, “DD”, “EE”, “FF”, “GG”, and “II” are variables, and the variable values specified when matching is performed according to the grammatical pattern are substituted. .

図5は、テンプレート格納部3に格納されるカラム値(パラメータ)取得テンプレートの一例を示す。図5の(1)乃至(3)は、図3における(1)乃至(3)との対応関係を示す。カラム値取得テンプレートは、パラメータ(擬似SQL文テンプレートの[X]に代入される値)をDB200から取得するためのSQL文テンプレートである。(1)は、Select AA.BBであり、(2)も同様である。(3)は、Select CC.DDである。当然ながら、「AA」「BB」「CC」「DD」は、変数であり、文法パターンによってマッチングを取る際に特定された変数値が代入される。   FIG. 5 shows an example of a column value (parameter) acquisition template stored in the template storage unit 3. (1) to (3) in FIG. 5 show the correspondence with (1) to (3) in FIG. The column value acquisition template is an SQL statement template for acquiring a parameter (a value assigned to [X] of the pseudo SQL statement template) from the DB 200. (1) is for Select AA. It is BB and (2) is the same. (3) is for Select CC. DD. Of course, “AA”, “BB”, “CC”, and “DD” are variables, and the variable values specified when matching is performed according to the grammatical pattern are substituted.

図6は、テンプレート格納部3に格納される検証文テンプレートの一例を示す。図6の(1)乃至(3)は、図3における(1)乃至(3)との対応関係を示す。また、[H]も上で述べたものと同様であり、文法パターンによってマッチングを取る際に特定された値が用いられる。(1)は、空(empty)である場合にログを出力することを意味するassert(empty)であり、(2)は、空でない(not empty)である場合にログを出力することを意味するassert(not empty)である。(3)は、[H]に依存しており、≠以外は、空である場合にログを出力することを意味するassert(empty)であり、≠であれば、空でない場合にログを出力することを意味するassert(not empty)である。   FIG. 6 shows an example of a verification sentence template stored in the template storage unit 3. (1) to (3) in FIG. 6 show the correspondence with (1) to (3) in FIG. Also, [H] is the same as described above, and the value specified when matching is performed according to the grammatical pattern. (1) is assert (empty) which means that a log is output when it is empty (empty), and (2) is that a log is output when it is not empty (not empty). Assert (not empty). (3) depends on [H], and except for ≠ is assert (empty) which means that a log is output when it is empty, and if it is ≠, a log is output when it is not empty This means assert (not empty).

以下の説明を分かりやすくするためにDB200には、図7及び図8のようなデータが格納されているものとする。すなわち、図7に示すように注文DBには、伝票番号と、商品コードと、数量と、注文日とが登録されるようになっている。また、図8に示すように商品DBには、商品コードと、商品名とが登録されるようになっている。   In order to make the following explanation easy to understand, it is assumed that data as shown in FIGS. 7 and 8 is stored in the DB 200. That is, as shown in FIG. 7, the order DB is registered with a slip number, a product code, a quantity, and an order date. Further, as shown in FIG. 8, a product code and a product name are registered in the product DB.

以下、図9乃至図12を用いてデータベース検証装置100の処理内容について説明する。制約情報読み取り部5は、処理対象の制約情報を制約情報格納部1から読み出す(ステップS1)。例えば図2の第1行目の制約情報を読み出す。そして、制約情報読み取り部5は、制約情報とテンプレート格納部3に格納されている各文法パターン(例えば図3の各行に示された文法パターン)とのパターンマッチングを実施し、当該制約情報が該当する文法パターンを特定する(ステップS3)。図2の第1行目の制約情報の場合、図3の第1行目(1)の文法パターンがマッチするので、(1)が特定される。   Hereinafter, processing contents of the database verification apparatus 100 will be described with reference to FIGS. 9 to 12. The constraint information reading unit 5 reads the constraint information to be processed from the constraint information storage unit 1 (step S1). For example, the constraint information on the first line in FIG. 2 is read. Then, the constraint information reading unit 5 performs pattern matching between the constraint information and each grammar pattern stored in the template storage unit 3 (for example, the grammar pattern shown in each row of FIG. 3). The grammatical pattern to be specified is specified (step S3). In the case of the constraint information on the first line in FIG. 2, the grammatical pattern on the first line (1) in FIG. 3 matches, so (1) is specified.

制約情報読み取り部5は、該当する文法パターンにおける各変数の値を抽出し、変数データ格納部7に格納する(ステップS5)。(1)の文法パターンにおいては、「AA」「BB」「YY」及び「ZZ」という変数があり、図2の第1行目の制約情報とマッチングさせると、図10(a)に示すように、「AA」=「注文DB」であり、「BB」=「商品コード」であり、「YY」=「商品DB」であり、「ZZ」=「商品コード」である。これらの変数及びその値を、変数データ格納部7に格納する。なお、制約情報読み取り部5は、検証文生成部9及びパラメータ検出部11に、該当する文法パターンのID(上の例では(1))を出力する。   The constraint information reading unit 5 extracts the value of each variable in the corresponding grammatical pattern and stores it in the variable data storage unit 7 (step S5). In the grammatical pattern of (1), there are variables “AA”, “BB”, “YY”, and “ZZ”. When matched with the constraint information on the first line in FIG. 2, as shown in FIG. Furthermore, “AA” = “order DB”, “BB” = “product code”, “YY” = “product DB”, and “ZZ” = “product code”. These variables and their values are stored in the variable data storage unit 7. The constraint information reading unit 5 outputs the ID of the corresponding grammar pattern ((1) in the above example) to the verification sentence generation unit 9 and the parameter detection unit 11.

そして、検証文生成部9は、制約情報読み取り部5から受信した文法パターンのIDを用いて、該当する文法パターンに対応する擬似SQL文テンプレートを、テンプレート格納部3から読み出す(ステップS7)。図4の例では、(1)の擬似SQL文テンプレート「Select YY.ZZ where AA.BB=[X]」が読み出される。そして、擬似SQL文テンプレートの変数に値を代入して、擬似SQL文を生成し、例えば検証文データ格納部13に格納する(ステップS9)。図10(b)に示すような擬似SQL文が生成される。すなわち、「Select 商品DB.商品コード where 注文DB.商品コード=[X]」が生成され、検証文データ格納部13に格納される。なお、現段階では[X]は確定しないので、「擬似」SQL文となっている。   Then, using the ID of the grammar pattern received from the constraint information reading unit 5, the verification statement generation unit 9 reads a pseudo SQL sentence template corresponding to the corresponding grammar pattern from the template storage unit 3 (step S7). In the example of FIG. 4, the pseudo SQL sentence template “Select YY.ZZ where AA.BB = [X]” in (1) is read. Then, a pseudo SQL statement is generated by assigning a value to the variable of the pseudo SQL statement template, and stored in, for example, the verification statement data storage unit 13 (step S9). A pseudo SQL sentence as shown in FIG. 10B is generated. That is, “Select product DB. Product code where order DB. Product code = [X]” is generated and stored in the verification statement data storage unit 13. Since [X] is not fixed at this stage, it is a “pseudo” SQL sentence.

さらに、検証文生成部9は、テンプレート格納部3から該当する文法パターンに対応する検証文テンプレートを読み出し、当該検証文テンプレートと擬似SQL文とを組み合わせて検証文を生成し、検証文データ格納部13に格納する(ステップS11)。図6の例では、(1)assert(empty)が抽出され、ステップS9で生成された擬似SQL文と組み合わされて、図10(c)に示すような検証文「Select 商品DB.商品コード where 注文DB.商品コード=[X]−>assert(empty)」が生成される。そして処理は端子Aを介して図11の処理に移行する。   Further, the verification statement generation unit 9 reads a verification statement template corresponding to the corresponding grammar pattern from the template storage unit 3, generates a verification statement by combining the verification statement template and the pseudo SQL statement, and generates a verification statement data storage unit. 13 (step S11). In the example of FIG. 6, (1) assert (empty) is extracted and combined with the pseudo SQL statement generated in step S9, and the verification statement “Select product DB. Product code where” shown in FIG. Order DB.Product code = [X]-> assert (empty) "is generated. Then, the processing shifts to the processing in FIG.

図11の処理の説明に移行して、パラメータ検出部11は、制約情報読み取り部5から受信した文法パターンのIDを用いて、該当する文法パターンに対応するカラム値取得テンプレートを、テンプレート格納部3から読み出す(ステップS13)。図5の例では、(1)「Select AA.BB」を読み出す。そして、当該カラム値取得テンプレートの変数に、変数データ格納部7に格納されている当該変数の値を代入し、パラメータ取得用のSQL文を生成し、例えばメインメモリなどの記憶装置に格納する(ステップS15)。図12(a)に示すように、「Select 注文DB.商品コード」というパラメータ取得用のSQL文を生成する。その後、パラメータ取得用のSQL文をDB200に対して実行し、検索結果であるパラメータを取得し、パラメータ格納部15に格納する(ステップS17)。図7のような注文DBの場合には、図12(b)に示すように商品コードの列の値「ZZ1」及び「ZZ2」が、パラメータとして抽出され、パラメータ格納部15に格納される。   Shifting to the description of the processing in FIG. 11, the parameter detection unit 11 uses the ID of the grammar pattern received from the constraint information reading unit 5 to convert the column value acquisition template corresponding to the corresponding grammar pattern to the template storage unit 3. (Step S13). In the example of FIG. 5, (1) “Select AA.BB” is read. Then, the value of the variable stored in the variable data storage unit 7 is substituted into the variable of the column value acquisition template to generate an SQL statement for parameter acquisition, for example, stored in a storage device such as a main memory ( Step S15). As shown in FIG. 12A, an SQL statement for parameter acquisition of “Select order DB. Commodity code” is generated. Thereafter, an SQL statement for parameter acquisition is executed on the DB 200, a parameter as a search result is acquired, and stored in the parameter storage unit 15 (step S17). In the case of the order DB as shown in FIG. 7, the values “ZZ1” and “ZZ2” of the product code column are extracted as parameters and stored in the parameter storage unit 15 as shown in FIG.

次に、検証実行部17は、パラメータ格納部15に格納されている未処理のパラメータを1つ選択し(ステップS19)、検証文データ格納部13に格納されている検証文の擬似SQL文部分の変数[X]に選択パラメータを代入し、検証用のSQL文を生成し、例えばメインメモリなどの記憶装置に格納する(ステップS21)。例えば、「ZZ1」を選択した場合には、図12(c)に示すように、検証用のSQL文「Select 商品DB.商品コード where 注文DB.商品コード=”ZZ1”」が生成される。そして、生成された検証用のSQL文をDB200に対して実行し、検索結果を取得する(ステップS23)。図8のような商品DBに対して、上記のようなSQL文を実行して検索を行うと、該当するレコードが存在するので、図12(d)に示すように「商品DB.ZZ1」が検索結果として得られる。   Next, the verification execution unit 17 selects one unprocessed parameter stored in the parameter storage unit 15 (step S19), and the pseudo SQL statement part of the verification statement stored in the verification statement data storage unit 13 The selected parameter is substituted into the variable [X], a verification SQL statement is generated, and stored in a storage device such as a main memory (step S21). For example, when “ZZ1” is selected, a verification SQL statement “Select product DB. Product code where order DB. Product code =“ ZZ1 ”” is generated as shown in FIG. Then, the generated SQL statement for verification is executed on the DB 200, and the search result is acquired (step S23). When a search is executed by executing the SQL statement as described above for the product DB as shown in FIG. 8, since the corresponding record exists, “Product DB.ZZ1” is displayed as shown in FIG. Obtained as a search result.

検証実行部17は、検索結果が検証文におけるassertの内容とマッチするか判断する(ステップS25)。図10(c)に示したように、本例における検証文においては「assert(empty)」となっているので、emptyの場合にはマッチしたと判断される。図12(d)のような検索結果の場合には、マッチしたとは言えない。ステップS25でマッチしたとは言えない場合には、ステップS29に移行する。一方、検索結果がemptyの場合には、assertの内容とマッチするので、評価ログを生成し、評価ログ格納部19に格納する(ステップS27)。   The verification execution unit 17 determines whether the search result matches the content of the assert in the verification sentence (step S25). As shown in FIG. 10C, since the verification statement in this example is “assert (empty)”, it is determined that there is a match in the case of empty. In the case of the search result as shown in FIG. 12D, it cannot be said that there is a match. When it cannot be said that it matched in step S25, it transfers to step S29. On the other hand, if the search result is empty, it matches the content of the assert, so an evaluation log is generated and stored in the evaluation log storage unit 19 (step S27).

そして、検証実行部17は、パラメータ格納部15に未処理のパラメータが存在しているか判断し(ステップS29)、未処理のパラメータが存在している場合にはステップS19に戻る。   Then, the verification execution unit 17 determines whether there is an unprocessed parameter in the parameter storage unit 15 (step S29). If there is an unprocessed parameter, the process returns to step S19.

ここでは「ZZ2」が残っているので、ステップS21で、図12(e)に示すように、検証用のSQL文「Select 商品DB.商品コード where 注文DB.商品コード=”ZZ2”」が生成される。そして、図8のような商品DBに対して、このようなSQL文を実行して検索を行うと、該当するレコードが存在しないので、図12(f)に示すように、「empty」という検索結果が得られる。そうすると、ステップS25で評価文のassertの内容とマッチすることになるので、評価ログを生成する。評価ログは、図13に示すように、「NG:注文DB.商品コード=”ZZ2”」となる。すなわち、評価ログを生成させることとなったパラメータ「ZZ2」を含み、業務上の整合性がとれなかった、検証対象データベースにおけるレコードを特定するためのデータである。   Here, since “ZZ2” remains, in step S21, as shown in FIG. 12E, a verification SQL statement “Select product DB. Product code where order DB. Product code =“ ZZ2 ”” is generated. Is done. Then, if a search is performed by executing such an SQL statement on the product DB as shown in FIG. 8, there is no corresponding record, so the search “empty” as shown in FIG. Results are obtained. If it does so, in step S25, since it will match the content of the assertion of an evaluation sentence, an evaluation log will be generated. As shown in FIG. 13, the evaluation log is “NG: order DB. Product code =“ ZZ2 ””. That is, it is data for specifying a record in the verification target database that includes the parameter “ZZ2” for which the evaluation log is to be generated and is not consistent in business.

このような処理を行って、未処理のパラメータが存在しないと判断された場合には、出力部21は、評価ログ格納部19に格納されている評価ログを表示装置や印刷装置などから出力する(ステップS31)。このようにすれば、ユーザは、検証対象データベースにおいてどの部分がテストを行う上で業務上の整合性がとれていないかを特定することができ、修正など対処を行うことができるようになる。   When it is determined that there is no unprocessed parameter after performing such processing, the output unit 21 outputs the evaluation log stored in the evaluation log storage unit 19 from a display device, a printing device, or the like. (Step S31). In this way, the user can specify which part of the verification target database is not consistent in business when performing the test, and can take corrective action such as correction.

以上のような処理を実施すれば、自動的に業務上の整合性についてデータベースの検証を実施することができるようになり、システムのテストなどにおいて問題の発生を未然に防止することができるようになる。   By performing the above processing, it is possible to automatically verify the database for business consistency, and to prevent problems from occurring during system testing. Become.

次に、図14乃至図17を用いて第2の具体例について説明しておく。例えば、図14に示すようなデータが制約情報格納部1に格納されているものとする。すなわち、検証対象データベースは「DB3」であり、検証対象カラムは「購入日」であり、チェック内容は「DB1.伝票番号=DB3.注文伝票番号&&DB1.注文日≦DB3.購入日」となっている。これは、DB1とDB3の同じ伝票番号の注文について、DB1の注文日はDB3の購入日以前でなければならないということを表す制約情報である。また、DB1には図15に示すようなデータが格納されているものとする。すなわち、伝票番号と、商品コードと、数量と、注文日とが登録されている。同様に、DB3には図16に示すようなデータが格納されているものとする。すなわち、商品コードと、購入日と、数量と、注文伝票番号とが登録されるようになっている。   Next, a second specific example will be described with reference to FIGS. For example, it is assumed that data as illustrated in FIG. 14 is stored in the constraint information storage unit 1. That is, the verification target database is “DB3”, the verification target column is “purchase date”, and the check contents are “DB1. Slip number = DB3. Order slip number && DB1. Order date ≦ DB3. Purchase date”. Yes. This is constraint information indicating that the order date of DB1 must be before the purchase date of DB3 for orders with the same slip number in DB1 and DB3. Further, it is assumed that data as shown in FIG. 15 is stored in DB1. That is, the slip number, product code, quantity, and order date are registered. Similarly, data as shown in FIG. 16 is stored in DB3. That is, the product code, purchase date, quantity, and order slip number are registered.

図9及び図11の処理フローに従うと、まず図3の文法パターンとマッチングさせて、(3)が該当する文法パターンとして特定される。ここで、図17(a)に示すように、「CC」=「DB1」、「DD」=「伝票番号」、「EE」=「DB3」、「FF」=「注文伝票番号」、「GG」=「注文日」、「II」=「購入日」という変数値が特定される。なお、[H]は「≦」である。   According to the processing flow of FIGS. 9 and 11, first, matching with the grammar pattern of FIG. 3, (3) is specified as the corresponding grammar pattern. Here, as shown in FIG. 17A, “CC” = “DB1”, “DD” = “slip number”, “EE” = “DB3”, “FF” = “order slip number”, “GG” "=" Order Date "and" II "=" Purchase Date "are specified. [H] is “≦”.

そうすると、検証文は、図4及び図6の(3)から、図17(b)に示すように、「Select DB3.注文伝票番号 from DB3 where DB3.注文伝票番号=[X] and DB1.注文日≦DB3.購入日−>assert(empty)」となる。   Then, as shown in FIG. 4 and FIG. 6 (3) to FIG. 17 (b), the verification sentence is “Select DB3. Order slip number from DB3 where DB3. Order slip number = [X] and DB1. Date ≦ DB3.Purchase date → assert (empty) ”.

また、パラメータ取得用のSQL文は、図5の(3)から、図17(c)に示すように、「Select DB1.伝票番号」となる。そして、このSQL文をDB1(図15)に対して実行すると、検索結果として図17(d)に示すように「A1234」及び「B1234」を取得する。   In addition, the SQL statement for parameter acquisition is “Select DB1. Slip number” as shown in FIG. 5 (3) to FIG. 17 (c). When this SQL statement is executed on DB1 (FIG. 15), “A1234” and “B1234” are acquired as search results as shown in FIG.

そして、検証用のSQL文は、図17(f)に示すように「Select DB3.注文伝票番号 from DB3 where DB3.注文伝票番号=”A1234” and DB1.注文日≦DB3.購入日」となり、これをDB200に対して実行すると、図17(g)に示すように「empty」となる。これは、伝票番号「A1234」の購入日は注文日より前であるので、上記検証用SQL文に合致するレコードが存在しないことになる。従って、図17(h)に示すように「NG:X=”A1234”」というような評価ログが生成される。   Then, the SQL statement for verification is “Select DB3. Order slip number from DB3 where DB3. Order slip number =“ A1234 ”and DB1. Order date ≦ DB3. Purchase date” as shown in FIG. When this is executed for the DB 200, “empty” is obtained as shown in FIG. This is because the purchase date of the slip number “A1234” is before the order date, so that there is no record that matches the verification SQL statement. Therefore, an evaluation log such as “NG: X =“ A1234 ”” is generated as shown in FIG.

また、次に、図17(i)に示すように「Select DB3.注文伝票番号 from DB3 where DB3.注文伝票番号=”B1234” and DB1.注文日≦DB3.購入日」という検証用のSQL文を生成し、DB200に対して実行すると、図17(j)に示すように「B1234」を得る。emptyではないので、評価ログは生成されない。   Next, as shown in FIG. 17 (i), a verification SQL statement “Select DB3. Order slip number from DB3 where DB3. Order slip number =“ B1234 ”and DB1. Order date ≦ DB3. Purchase date”. Is generated and executed on the DB 200, “B1234” is obtained as shown in FIG. Since it is not empty, an evaluation log is not generated.

このように、「A1234」という伝票番号について、業務上の整合性がとれないレコードが登録されていることが分かるようになる。   Thus, it can be seen that a record that is inconsistent in business is registered for the slip number “A1234”.

以上本発明の実施の形態を説明したが、本発明はこれに限定されるものではない。例えば、図1に示した機能ブロック図は、実際のプログラムモジュール構成と同一ではない場合もある。また、ステップS7乃至S11と、ステップS13乃至S17は、独立した処理であるから、並列に実行しても良いし、実行する順番を入れ替えても良い。   Although the embodiment of the present invention has been described above, the present invention is not limited to this. For example, the functional block diagram shown in FIG. 1 may not be the same as the actual program module configuration. In addition, since steps S7 to S11 and steps S13 to S17 are independent processes, they may be executed in parallel or the order of execution may be changed.

なお、データベース検証装置100は、例えばコンピュータ装置であって、図18に示すように当該コンピュータ装置においては、メモリ2501(記憶部)とCPU2503(処理部)とハードディスク・ドライブ(HDD)2505と表示装置2509に接続される表示制御部2507とリムーバブル・ディスク2511用のドライブ装置2513と入力装置2515とネットワークに接続するための通信制御部2517とがバス2519で接続されている。オペレーティング・システム(OS)及びWebブラウザを含むアプリケーション・プログラムは、HDD2505に格納されており、CPU2503により実行される際にはHDD2505からメモリ2501に読み出される。必要に応じてCPU2503は、表示制御部2507、通信制御部2517、ドライブ装置2513を制御して、必要な動作を行わせる。また、処理途中のデータについては、メモリ2501に格納され、必要があればHDD2505に格納される。このようなコンピュータは、上で述べたCPU2503、メモリ2501などのハードウエアとOS及び必要なアプリケーション・プログラムとが有機的に協働することにより、上で述べたような各種機能を実現する。   The database verification device 100 is, for example, a computer device. In the computer device, as shown in FIG. 18, a memory 2501 (storage unit), a CPU 2503 (processing unit), a hard disk drive (HDD) 2505, and a display device are included. A display control unit 2507 connected to 2509, a drive device 2513 for the removable disk 2511, an input device 2515, and a communication control unit 2517 for connecting to a network are connected by a bus 2519. Application programs including an operating system (OS) and a Web browser are stored in the HDD 2505, and are read from the HDD 2505 to the memory 2501 when executed by the CPU 2503. If necessary, the CPU 2503 controls the display control unit 2507, the communication control unit 2517, and the drive device 2513 to perform necessary operations. Further, data in the middle of processing is stored in the memory 2501 and stored in the HDD 2505 if necessary. Such a computer realizes various functions as described above by organically cooperating hardware such as the CPU 2503 and the memory 2501 described above with the OS and necessary application programs.

(付記1)
検証対象データベースを含むデータベースに格納されるデータ項目についての制約条件についての制約情報を格納する制約情報格納部と、前記制約情報の解析用テンプレートと当該解析用テンプレートに対応する検証用SQLテンプレート、パラメータ取得用SQLテンプレート及び検証文テンプレートとを格納するテンプレート格納部とにアクセス可能なコンピュータに、
前記制約情報格納部に格納されている制約情報と、前記テンプレート格納部に格納されている解析用テンプレートとをマッチングさせて、当該制約情報にマッチする解析用テンプレートを特定すると共に、当該制約情報から、特定された前記解析用テンプレートにおける変数の値を特定するステップと、
特定された前記解析用テンプレートに対応する前記パラメータ取得用SQLテンプレートと、特定された前記変数の値のうち該当するものとを組み合わせることによってパラメータ取得用SQL文を生成し、当該パラメータ取得用SQL文を前記データベースに対して実行して、当該検索結果をパラメータとして取得するステップと、
特定された前記解析用テンプレートに対応する前記検証用SQLテンプレートと、特定された前記変数の値のうち該当するものと、取得された前記パラメータのいずれかとが組み合わせられた検証用SQL文を前記データベースに対して実行して、検索結果を第2の検索結果として取得する検索結果取得ステップと、
取得された前記第2の検索結果が、特定された前記解析用テンプレートに対応する前記検証文テンプレートと前記検証用SQL文とが組み合わされた検証文を充足するものであるか判断し、充足する場合に、前記第2の検索結果をもたらした前記検証用SQL文に組み合わされた前記パラメータを含むログを生成するログ生成ステップと、
を実行させるためのデータベース検証プログラム。
(Appendix 1)
A constraint information storage unit that stores constraint information on constraint conditions for data items stored in a database including a database to be verified, an analysis template for the constraint information, a verification SQL template corresponding to the analysis template, and parameters To a computer accessible to a template storage unit for storing an acquisition SQL template and a verification statement template,
The constraint information stored in the constraint information storage unit is matched with the analysis template stored in the template storage unit to identify an analysis template that matches the constraint information, and from the constraint information Identifying the value of the variable in the identified analytical template;
A parameter acquisition SQL statement is generated by combining the parameter acquisition SQL template corresponding to the specified analysis template and the corresponding value of the specified variable, and the parameter acquisition SQL statement To the database to obtain the search result as a parameter;
A verification SQL statement in which the verification SQL template corresponding to the specified analysis template, the corresponding one of the specified values of the variable, and any one of the acquired parameters is combined is stored in the database. And a search result acquisition step for acquiring the search result as a second search result,
It is determined whether the acquired second search result satisfies a verification statement in which the verification statement template corresponding to the specified analysis template and the verification SQL statement are combined, and is satisfied. A log generation step for generating a log including the parameters combined with the verification SQL statement that resulted in the second search result;
Database verification program to execute.

(付記2)
前記ログ生成ステップにおいて、
特定された前記解析用テンプレート及び特定された前記変数の値のうち特定の変数の値に対応する検証文テンプレートが用いられる
付記1記載のデータベース検証プログラム。
(Appendix 2)
In the log generation step,
The database verification program according to claim 1, wherein a verification sentence template corresponding to a value of a specific variable among the specified template for analysis and the value of the specified variable is used.

(付記3)
検証対象データベースを含むデータベースに格納されるデータ項目についての制約条件についての制約情報を格納する制約情報格納部と、前記制約情報の解析用テンプレートと当該解析用テンプレートに対応する検証用SQLテンプレート、パラメータ取得用SQLテンプレート及び検証文テンプレートとを格納するテンプレート格納部とにアクセス可能であり、処理部を有するコンピュータに実行されるデータベース検証方法であって、
前記制約情報格納部に格納されている制約情報と、前記テンプレート格納部に格納されている解析用テンプレートとをマッチングさせて、当該制約情報にマッチする解析用テンプレートを特定すると共に、当該制約情報から、特定された前記解析用テンプレートにおける変数の値を特定するステップと、
特定された前記解析用テンプレートに対応する前記パラメータ取得用SQLテンプレートと、特定された前記変数の値のうち該当するものとを組み合わせることによってパラメータ取得用SQL文を生成し、当該パラメータ取得用SQL文を前記データベースに対して実行して、当該検索結果をパラメータとして取得するステップと、
特定された前記解析用テンプレートに対応する前記検証用SQLテンプレートと、特定された前記変数の値のうち該当するものと、取得された前記パラメータのいずれかとが組み合わせられた検証用SQL文を前記データベースに対して実行して、検索結果を第2の検索結果として取得する検索結果取得ステップと、
取得された前記第2の検索結果が、特定された前記解析用テンプレートに対応する前記検証文テンプレートと前記検証用SQL文とが組み合わされた検証文を充足するものであるか判断し、充足する場合に、前記第2の検索結果をもたらした前記検証用SQL文に組み合わされた前記パラメータを含むログを生成するログ生成ステップと、
を含むデータベース検証方法。
(Appendix 3)
A constraint information storage unit that stores constraint information on constraint conditions for data items stored in a database including a database to be verified, an analysis template for the constraint information, a verification SQL template corresponding to the analysis template, and parameters A database verification method that is accessible to a template storage unit that stores an acquisition SQL template and a verification statement template, and that is executed by a computer having a processing unit,
The constraint information stored in the constraint information storage unit is matched with the analysis template stored in the template storage unit to identify an analysis template that matches the constraint information, and from the constraint information Identifying the value of the variable in the identified analytical template;
A parameter acquisition SQL statement is generated by combining the parameter acquisition SQL template corresponding to the specified analysis template and the corresponding value of the specified variable, and the parameter acquisition SQL statement To the database to obtain the search result as a parameter;
A verification SQL statement in which the verification SQL template corresponding to the specified analysis template, the corresponding one of the specified values of the variable, and any one of the acquired parameters is combined is stored in the database. And a search result acquisition step for acquiring the search result as a second search result,
It is determined whether the acquired second search result satisfies a verification statement in which the verification statement template corresponding to the specified analysis template and the verification SQL statement are combined, and is satisfied. A log generation step for generating a log including the parameters combined with the verification SQL statement that resulted in the second search result;
Database validation method including:

(付記4)
検証対象データベースを含むデータベースに格納されるデータ項目についての制約条件についての制約情報を格納する制約情報格納部と、
前記制約情報の解析用テンプレートと当該解析用テンプレートに対応する検証用SQLテンプレート、パラメータ取得用SQLテンプレート及び検証文テンプレートとを格納するテンプレート格納部と、
前記制約情報格納部に格納されている制約情報と、前記テンプレート格納部に格納されている解析用テンプレートとをマッチングさせて、当該制約情報にマッチする解析用テンプレートを特定すると共に、当該制約情報から、特定された前記解析用テンプレートにおける変数の値を特定する手段と、
特定された前記解析用テンプレートに対応する前記パラメータ取得用SQLテンプレートと、特定された前記変数の値のうち該当するものとを組み合わせることによってパラメータ取得用SQL文を生成し、当該パラメータ取得用SQL文を前記データベースに対して実行して、当該検索結果をパラメータとして取得する手段と、
特定された前記解析用テンプレートに対応する前記検証用SQLテンプレートと、特定された前記変数の値のうち該当するものと、取得された前記パラメータのいずれかとが組み合わせられた検証用SQL文を前記データベースに対して実行して、検索結果を第2の検索結果として取得する検索結果取得手段と、
取得された前記第2の検索結果が、特定された前記解析用テンプレートに対応する前記検証文テンプレートと前記検証用SQL文とが組み合わされた検証文を充足するものであるか判断し、充足する場合に、前記第2の検索結果をもたらした前記検証用SQL文に組み合わされた前記パラメータを含むログを生成するログ生成手段と、
を有するデータベース検証装置。
(Appendix 4)
A constraint information storage unit that stores constraint information about constraint conditions for data items stored in the database including the database to be verified;
A template storage unit for storing an analysis template of the constraint information, a verification SQL template corresponding to the analysis template, a parameter acquisition SQL template, and a verification statement template;
The constraint information stored in the constraint information storage unit is matched with the analysis template stored in the template storage unit to identify an analysis template that matches the constraint information, and from the constraint information Means for specifying the value of the variable in the specified analysis template;
A parameter acquisition SQL statement is generated by combining the parameter acquisition SQL template corresponding to the specified analysis template and the corresponding value of the specified variable, and the parameter acquisition SQL statement Means for executing the search on the database and acquiring the search result as a parameter;
A verification SQL statement in which the verification SQL template corresponding to the specified analysis template, the corresponding one of the specified values of the variable, and any one of the acquired parameters is combined is stored in the database. And a search result acquisition means for acquiring the search result as a second search result,
It is determined whether the acquired second search result satisfies a verification statement in which the verification statement template corresponding to the specified analysis template and the verification SQL statement are combined, and is satisfied. Log generating means for generating a log including the parameter combined with the verification SQL statement that has resulted in the second search result,
A database verification apparatus.

本発明の実施の形態に係るシステム概要を示す図である。It is a figure which shows the system outline | summary which concerns on embodiment of this invention. 制約情報格納部に格納されるデータの一例を示す図である。It is a figure which shows an example of the data stored in a constraint information storage part. テンプレート格納部に格納されるデータ(文法パターン)の一例を示す図である。It is a figure which shows an example of the data (grammar pattern) stored in a template storage part. テンプレート格納部に格納されるデータ(擬似SQL文テンプレート)の一例を示す図である。It is a figure which shows an example of the data (pseudo SQL sentence template) stored in a template storage part. テンプレート格納部に格納されるデータ(カラム値取得用SQL文テンプレート)の一例を示す図である。It is a figure which shows an example of the data (SQL statement template for column value acquisition) stored in a template storage part. テンプレート格納部に格納されるデータ(検証文テンプレート)の一例を示す図である。It is a figure which shows an example of the data (verification sentence template) stored in a template storage part. 注文DBに格納されるデータの一例を示す図である。It is a figure which shows an example of the data stored in order DB. 商品DBに格納されるデータの一例を示す図である。It is a figure which shows an example of the data stored in goods DB. 本発明の実施の形態における処理フローを示す図である。It is a figure which shows the processing flow in embodiment of this invention. (a)乃至(c)は、処理フローにおける途中結果を示す図である。(A) thru | or (c) are figures which show the intermediate result in a processing flow. 本発明の実施の形態における処理フローを示す図である。It is a figure which shows the processing flow in embodiment of this invention. (a)乃至(f)は、処理フローにおける途中結果を示す図である。(A) thru | or (f) is a figure which shows the intermediate result in a processing flow. 評価ログ格納部に格納されるデータの一例を示す図である。It is a figure which shows an example of the data stored in an evaluation log storage part. 制約情報格納部に格納されるデータの一例を示す図である。It is a figure which shows an example of the data stored in a constraint information storage part. DB1に格納されるデータの一例を示す図である。It is a figure which shows an example of the data stored in DB1. DB3に格納されるデータの一例を示す図である。It is a figure which shows an example of the data stored in DB3. (a)乃至(j)は、第2の具体例における処理の途中結果を示す図である。(A) thru | or (j) is a figure which shows the intermediate result of the process in a 2nd specific example. コンピュータの機能ブロック図である。It is a functional block diagram of a computer.

符号の説明Explanation of symbols

1 制約情報格納部
3 テンプレート格納部
5 制約情報読み取り部
7 変数データ格納部
9 検証文生成部
11 パラメータ検出部
13 検証文データ格納部
15 パラメータ格納部
17 検証実行部
19 評価ログ格納部
21 出力部
100 データベース検証装置
200 DB
DESCRIPTION OF SYMBOLS 1 Constraint information storage part 3 Template storage part 5 Constraint information reading part 7 Variable data storage part 9 Verification sentence generation part 11 Parameter detection part 13 Verification sentence data storage part 15 Parameter storage part 17 Verification execution part 19 Evaluation log storage part 21 Output part 100 Database verification device 200 DB

Claims (4)

検証対象データベースを含むデータベースに格納されるデータ項目についての制約条件についての制約情報を格納する制約情報格納部と、前記制約情報の解析用テンプレートと当該解析用テンプレートに対応する検証用SQLテンプレート、パラメータ取得用SQLテンプレート及び検証文テンプレートとを格納するテンプレート格納部とにアクセス可能なコンピュータに、
前記制約情報格納部に格納されている制約情報と、前記テンプレート格納部に格納されている解析用テンプレートとをマッチングさせて、当該制約情報にマッチする解析用テンプレートを特定すると共に、当該制約情報から、特定された前記解析用テンプレートにおける変数の値を特定するステップと、
特定された前記解析用テンプレートに対応する前記パラメータ取得用SQLテンプレートと、特定された前記変数の値のうち該当するものとを組み合わせることによってパラメータ取得用SQL文を生成し、当該パラメータ取得用SQL文を前記データベースに対して実行して、当該検索結果をパラメータとして取得するステップと、
特定された前記解析用テンプレートに対応する前記検証用SQLテンプレートと、特定された前記変数の値のうち該当するものと、取得された前記パラメータのいずれかとが組み合わせられた検証用SQL文を前記データベースに対して実行して、検索結果を第2の検索結果として取得する検索結果取得ステップと、
取得された前記第2の検索結果が、特定された前記解析用テンプレートに対応する前記検証文テンプレートと前記検証用SQL文とが組み合わされた検証文を充足するものであるか判断し、充足する場合に、前記第2の検索結果をもたらした前記検証用SQL文に組み合わされた前記パラメータを含むログを生成するログ生成ステップと、
を実行させるためのデータベース検証プログラム。
A constraint information storage unit that stores constraint information on constraint conditions for data items stored in a database including a database to be verified, an analysis template for the constraint information, a verification SQL template corresponding to the analysis template, and parameters To a computer accessible to a template storage unit for storing an acquisition SQL template and a verification statement template,
The constraint information stored in the constraint information storage unit is matched with the analysis template stored in the template storage unit to identify an analysis template that matches the constraint information, and from the constraint information Identifying the value of the variable in the identified analytical template;
A parameter acquisition SQL statement is generated by combining the parameter acquisition SQL template corresponding to the specified analysis template and the corresponding value of the specified variable, and the parameter acquisition SQL statement To the database to obtain the search result as a parameter;
A verification SQL statement in which the verification SQL template corresponding to the specified analysis template, the corresponding one of the specified values of the variable, and any one of the acquired parameters is combined is stored in the database. And a search result acquisition step for acquiring the search result as a second search result,
It is determined whether the acquired second search result satisfies a verification statement in which the verification statement template corresponding to the specified analysis template and the verification SQL statement are combined, and is satisfied. A log generation step for generating a log including the parameters combined with the verification SQL statement that resulted in the second search result;
Database verification program to execute.
前記ログ生成ステップにおいて、
特定された前記解析用テンプレート及び特定された前記変数の値のうち特定の変数の値に対応する検証文テンプレートが用いられる
請求項1記載のデータベース検証プログラム。
In the log generation step,
The database verification program according to claim 1, wherein a verification sentence template corresponding to a value of a specific variable among the specified template for analysis and the value of the specified variable is used.
検証対象データベースを含むデータベースに格納されるデータ項目についての制約条件についての制約情報を格納する制約情報格納部と、前記制約情報の解析用テンプレートと当該解析用テンプレートに対応する検証用SQLテンプレート、パラメータ取得用SQLテンプレート及び検証文テンプレートとを格納するテンプレート格納部とにアクセス可能であり、処理部を有するコンピュータに実行されるデータベース検証方法であって、
前記制約情報格納部に格納されている制約情報と、前記テンプレート格納部に格納されている解析用テンプレートとをマッチングさせて、当該制約情報にマッチする解析用テンプレートを特定すると共に、当該制約情報から、特定された前記解析用テンプレートにおける変数の値を特定するステップと、
特定された前記解析用テンプレートに対応する前記パラメータ取得用SQLテンプレートと、特定された前記変数の値のうち該当するものとを組み合わせることによってパラメータ取得用SQL文を生成し、当該パラメータ取得用SQL文を前記データベースに対して実行して、当該検索結果をパラメータとして取得するステップと、
特定された前記解析用テンプレートに対応する前記検証用SQLテンプレートと、特定された前記変数の値のうち該当するものと、取得された前記パラメータのいずれかとが組み合わせられた検証用SQL文を前記データベースに対して実行して、検索結果を第2の検索結果として取得する検索結果取得ステップと、
取得された前記第2の検索結果が、特定された前記解析用テンプレートに対応する前記検証文テンプレートと前記検証用SQL文とが組み合わされた検証文を充足するものであるか判断し、充足する場合に、前記第2の検索結果をもたらした前記検証用SQL文に組み合わされた前記パラメータを含むログを生成するログ生成ステップと、
を含むデータベース検証方法。
A constraint information storage unit that stores constraint information on constraint conditions for data items stored in a database including a database to be verified, an analysis template for the constraint information, a verification SQL template corresponding to the analysis template, and parameters A database verification method that is accessible to a template storage unit that stores an acquisition SQL template and a verification statement template, and that is executed by a computer having a processing unit,
The constraint information stored in the constraint information storage unit is matched with the analysis template stored in the template storage unit to identify an analysis template that matches the constraint information, and from the constraint information Identifying the value of the variable in the identified analytical template;
A parameter acquisition SQL statement is generated by combining the parameter acquisition SQL template corresponding to the specified analysis template and the corresponding value of the specified variable, and the parameter acquisition SQL statement To the database to obtain the search result as a parameter;
A verification SQL statement in which the verification SQL template corresponding to the specified analysis template, the corresponding one of the specified values of the variable, and any one of the acquired parameters is combined is stored in the database. And a search result acquisition step for acquiring the search result as a second search result,
It is determined whether the acquired second search result satisfies a verification statement in which the verification statement template corresponding to the specified analysis template and the verification SQL statement are combined, and is satisfied. A log generation step for generating a log including the parameters combined with the verification SQL statement that resulted in the second search result;
Database validation method including:
検証対象データベースを含むデータベースに格納されるデータ項目についての制約条件についての制約情報を格納する制約情報格納部と、
前記制約情報の解析用テンプレートと当該解析用テンプレートに対応する検証用SQLテンプレート、パラメータ取得用SQLテンプレート及び検証文テンプレートとを格納するテンプレート格納部と、
前記制約情報格納部に格納されている制約情報と、前記テンプレート格納部に格納されている解析用テンプレートとをマッチングさせて、当該制約情報にマッチする解析用テンプレートを特定すると共に、当該制約情報から、特定された前記解析用テンプレートにおける変数の値を特定する手段と、
特定された前記解析用テンプレートに対応する前記パラメータ取得用SQLテンプレートと、特定された前記変数の値のうち該当するものとを組み合わせることによってパラメータ取得用SQL文を生成し、当該パラメータ取得用SQL文を前記データベースに対して実行して、当該検索結果をパラメータとして取得する手段と、
特定された前記解析用テンプレートに対応する前記検証用SQLテンプレートと、特定された前記変数の値のうち該当するものと、取得された前記パラメータのいずれかとが組み合わせられた検証用SQL文を前記データベースに対して実行して、検索結果を第2の検索結果として取得する検索結果取得手段と、
取得された前記第2の検索結果が、特定された前記解析用テンプレートに対応する前記検証文テンプレートと前記検証用SQL文とが組み合わされた検証文を充足するものであるか判断し、充足する場合に、前記第2の検索結果をもたらした前記検証用SQL文に組み合わされた前記パラメータを含むログを生成するログ生成手段と、
を有するデータベース検証装置。
A constraint information storage unit that stores constraint information about constraint conditions for data items stored in the database including the database to be verified;
A template storage unit for storing an analysis template of the constraint information, a verification SQL template corresponding to the analysis template, a parameter acquisition SQL template, and a verification statement template;
The constraint information stored in the constraint information storage unit is matched with the analysis template stored in the template storage unit to identify an analysis template that matches the constraint information, and from the constraint information Means for specifying the value of the variable in the specified analysis template;
A parameter acquisition SQL statement is generated by combining the parameter acquisition SQL template corresponding to the specified analysis template and the corresponding value of the specified variable, and the parameter acquisition SQL statement Means for executing the search on the database and acquiring the search result as a parameter;
A verification SQL statement in which the verification SQL template corresponding to the specified analysis template, the corresponding one of the specified values of the variable, and any one of the acquired parameters is combined is stored in the database. And a search result acquisition means for acquiring the search result as a second search result,
It is determined whether the acquired second search result satisfies a verification statement in which the verification statement template corresponding to the specified analysis template and the verification SQL statement are combined, and is satisfied. Log generating means for generating a log including the parameter combined with the verification SQL statement that has resulted in the second search result,
A database verification apparatus.
JP2007190368A 2007-07-23 2007-07-23 Database verification method and apparatus Expired - Fee Related JP5076700B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007190368A JP5076700B2 (en) 2007-07-23 2007-07-23 Database verification method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007190368A JP5076700B2 (en) 2007-07-23 2007-07-23 Database verification method and apparatus

Publications (2)

Publication Number Publication Date
JP2009026163A true JP2009026163A (en) 2009-02-05
JP5076700B2 JP5076700B2 (en) 2012-11-21

Family

ID=40397897

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007190368A Expired - Fee Related JP5076700B2 (en) 2007-07-23 2007-07-23 Database verification method and apparatus

Country Status (1)

Country Link
JP (1) JP5076700B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448980A (en) * 2021-06-18 2021-09-28 青岛海尔科技有限公司 Method and device for generating SQL (structured query language) statement and electronic equipment
CN113642039A (en) * 2021-08-09 2021-11-12 平安科技(深圳)有限公司 Configuration method and device of document template, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH064383A (en) * 1992-06-16 1994-01-14 Hitachi Ltd Method and system for managing data base
JP2002108886A (en) * 2000-09-28 2002-04-12 Yamatake Sangyo Systems Co Ltd Database management system
JP2006079260A (en) * 2004-09-08 2006-03-23 Nec Corp Method and device for inputting data to database, database system and program
JP2006344198A (en) * 2005-06-10 2006-12-21 Microsoft Corp Method and system for assignment of membership through script
JP2007004447A (en) * 2005-06-23 2007-01-11 Fujitsu Ltd Database system test program
JP2007058750A (en) * 2005-08-26 2007-03-08 Kyosan Electric Mfg Co Ltd Data specification description document and verification data generation device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH064383A (en) * 1992-06-16 1994-01-14 Hitachi Ltd Method and system for managing data base
JP2002108886A (en) * 2000-09-28 2002-04-12 Yamatake Sangyo Systems Co Ltd Database management system
JP2006079260A (en) * 2004-09-08 2006-03-23 Nec Corp Method and device for inputting data to database, database system and program
JP2006344198A (en) * 2005-06-10 2006-12-21 Microsoft Corp Method and system for assignment of membership through script
JP2007004447A (en) * 2005-06-23 2007-01-11 Fujitsu Ltd Database system test program
JP2007058750A (en) * 2005-08-26 2007-03-08 Kyosan Electric Mfg Co Ltd Data specification description document and verification data generation device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448980A (en) * 2021-06-18 2021-09-28 青岛海尔科技有限公司 Method and device for generating SQL (structured query language) statement and electronic equipment
CN113642039A (en) * 2021-08-09 2021-11-12 平安科技(深圳)有限公司 Configuration method and device of document template, computer equipment and storage medium

Also Published As

Publication number Publication date
JP5076700B2 (en) 2012-11-21

Similar Documents

Publication Publication Date Title
US7340475B2 (en) Evaluating dynamic expressions in a modeling application
US7676777B2 (en) Method and apparatus for supporting verification, and computer product
KR102573518B1 (en) Information processing method and device, electronic device, computer-readable medium and computer program stored in medium
KR20010022215A (en) System and method for generating year 2000 test cases
CN111159016A (en) Standard detection method and device
US20180341468A1 (en) Source code analysis and adjustment system
JP7015319B2 (en) Data analysis support device, data analysis support method and data analysis support program
US20170091082A1 (en) Test db data generation apparatus
JP6440895B2 (en) Software analysis apparatus and software analysis method
US10628140B2 (en) Program code generation apparatus
JP5460629B2 (en) Tabular software specification creation support method and apparatus
JP5076700B2 (en) Database verification method and apparatus
JP7015320B2 (en) Data analysis support device, data analysis support method and data analysis support program
US6681347B1 (en) Method for testing keyboard complied with language code
JP5900212B2 (en) Test data generation apparatus, program, and method
JP6680218B2 (en) Metadata processing method, metadata processing device, and metadata processing program
JP2006293891A (en) Property conversion apparatus
WO2015030016A1 (en) System for processing unstructured data, method for processing unstructured data, and recording medium
CN116860356A (en) Plug-in generation method, plug-in generation device, electronic equipment and computer readable storage medium
JP2008077329A (en) Database access design information analysis system
CN118036792A (en) Method and system for predicting abnormal enterprises
JP2006221473A (en) Device, method, and program for logic verification
JP5581894B2 (en) Data processing program automatic generation system
CN116627835A (en) Test method, test device, computing equipment and storage medium
JP2014038397A (en) Diagram program test data generation device, method therefor, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100416

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120622

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: 20120731

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120813

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150907

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees