JP2009301352A - Test unit and test method - Google Patents

Test unit and test method Download PDF

Info

Publication number
JP2009301352A
JP2009301352A JP2008155680A JP2008155680A JP2009301352A JP 2009301352 A JP2009301352 A JP 2009301352A JP 2008155680 A JP2008155680 A JP 2008155680A JP 2008155680 A JP2008155680 A JP 2008155680A JP 2009301352 A JP2009301352 A JP 2009301352A
Authority
JP
Japan
Prior art keywords
data
test
production
unit
version
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.)
Pending
Application number
JP2008155680A
Other languages
Japanese (ja)
Inventor
Kiyohiko Narasaki
清彦 奈良崎
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2008155680A priority Critical patent/JP2009301352A/en
Publication of JP2009301352A publication Critical patent/JP2009301352A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To facilitate the test of a database processing program. <P>SOLUTION: Execution mode information 1320 defining a real execution mode and a test mode is stored. Using the execution mode information 1320, a test information management section 1430 makes an application execution section (AP execution section) correspond to an execution mode. When the AP execution section issues a connection request to a database 1500, a DB access control section 1440 transmits execution mode information 1320. Based on the execution mode information 1320, a connection for real execution or test is generated, and the connection is established. Each of data storage sections (1560, 1561) stores a data to be processed by the AP execution section as a real execution data or a test data. When the data is updated, the version of the updated real execution data or the test data is identified. As such, by the separation of the real execution data from the test data, the influence of the test is isolated from the real execution data. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、データベースでデータ処理(この処理を、「データベース処理」という場合がある。)をするためのプログラムのテストの技術に関する。   The present invention relates to a technique for testing a program for data processing in a database (this processing may be referred to as “database processing”).

従来、計算機に、データベースでデータ処理を実行させるプログラム(データベース処理プログラム(つまり、アプリケーション(Application:以下「AP」と略記する場合がある。)))のテストを行う際は、本番用データベースとは異なるテスト用データベースを使用するか、またはテストに本番用データベースを使用して、テスト終了後にロールバックして、本番用データベースの状態をテスト前の状態に戻す、といった方法をとっていた。   Conventionally, when testing a program (a database processing program (that is, application (hereinafter sometimes abbreviated as “AP”))) that causes a computer to perform data processing on a database, what is a production database? Either a different test database was used, or a production database was used for the test, and the test database was rolled back after the test to return the production database to the state before the test.

これらの従来のテストの方法のうち、テスト用データベースを使用する方法の場合には、本番用データベースとは別にテスト用データベースを用意しなければならなかったので、テスト環境を整えるまでに時間がかかる。加えて、資源等の問題もあって、大規模データベースに対するテストは行いづらい。もし、本番用データベースよりも規模の小さいテスト用データベースを使用した場合には、データの組み合わせや処理件数によって生じる問題等については、十分なテストが行えない等の欠点がある。   Of these conventional test methods, in the case of using the test database, it was necessary to prepare a test database separately from the production database, so it took time to prepare the test environment. . In addition, there are problems with resources, etc., making it difficult to test large databases. If a test database having a smaller scale than the production database is used, there is a drawback that a sufficient test cannot be performed for problems caused by the combination of data and the number of processing cases.

また、本番用データベースを使用してテストを行い、テスト終了後にロールバックする方法では、テストと本番との実施期間を隔離しなければならないという欠点がある。   In addition, the method of performing a test using a production database and rolling back after the test is completed has a disadvantage that it is necessary to separate the test and production periods.

前記欠点を解消するために、特許文献1に記載されている方式が提案されているが、インメモリデータベースの分野では適用しづらいという欠点がある。特許文献1に示す、ディスクを使った従来のデータベースの場合、一般的に検索のときも更新のときもバッファに読み込んでから処理するようになっている。データを読み込む単位や、データ構造、検索アルゴリズムなどが、バッファに読み込んだデータへのキャッシュヒット率が高くなるように最適化されているので、特許文献1の解決方法でも本番に近いテストを行うことができる。一方、インメモリデータベースの場合は、データはメモリ上に存在するので、直接データにアクセスするように設計されている。そのため、テストの場合だけ検索や更新で特別なバッファを使用するという解決策を適用するのは困難である。   In order to eliminate the drawbacks, a method described in Patent Document 1 has been proposed, but there is a drawback that it is difficult to apply in the field of in-memory databases. In the case of a conventional database using a disk as shown in Patent Document 1, generally, a search and an update are performed after reading into a buffer. Since the unit for reading data, data structure, search algorithm, etc. are optimized so as to increase the cache hit rate for the data read into the buffer, even the solution of Patent Document 1 should perform a test close to the actual test Can do. On the other hand, in the case of an in-memory database, since the data exists in the memory, it is designed to directly access the data. Therefore, it is difficult to apply a solution that uses a special buffer for searching and updating only for testing.

分散APサーバの分野では、本番とテストとを区別するために、例えば、特許文献2に記載されているような方式が提案されている。しかし、特許文献2では、APサーバからデータベースまで一貫してテストを行う方法は言及されていない。
特開平2−125346号公報 特開2006−146434号公報
In the field of the distributed AP server, for example, a method as described in Patent Document 2 has been proposed in order to distinguish between the performance and the test. However, Patent Document 2 does not mention a method for performing a consistent test from the AP server to the database.
JP-A-2-125346 JP 2006-146434 A

前記事情を鑑みて、本発明の目的は、データベース処理プログラムのテストを容易に行うことである。   In view of the above circumstances, an object of the present invention is to easily test a database processing program.

前記目的を達成するために、本発明は、データベース処理プログラムのテストを実施する際に、本番用データベースを使用しながら、被テストプログラムによるテスト用データの更新の影響を、本番用データから切り離すようにする。詳細は後記する。   In order to achieve the above object, the present invention separates the influence of the update of the test data by the program under test from the production data while using the production database when testing the database processing program. To. Details will be described later.

本発明によれば、テスト用データベースを用意することなく、かつ本番用データベースのロールバックを行うこともないため、データベース処理プログラムのテストを容易に行うことができる。   According to the present invention, since a test database is not prepared and a production database is not rolled back, a database processing program can be easily tested.

以下、本発明を実施するための最良の形態(以下、「実施形態」という。)を、図面を適宜参照しつつ、詳細に説明する。   Hereinafter, the best mode for carrying out the present invention (hereinafter referred to as “embodiment”) will be described in detail with reference to the drawings as appropriate.

≪構成≫
図1は、本実施形態のデータベース処理プログラムのテスト方法を実行する計算機の内部機能構成を図示したものである。
計算機1000(テスト装置)は、データベースを用いてデータを処理するアプリケーション実行部(AP実行部)の実行を制御する制御部として実現されるCPU(Central Processing Unit:中央処理装置)1100、および記憶部として実現される主記憶装置1200を有して構成されるコンピュータである。主記憶装置1200上には、AP配備情報1300、APサーバ1400、データベース1500が配置される。なお、主記憶装置1200に何らかのデータ、アプリケーション実行部、ミドルウェア、データベース等が「配置」されるとは、データ、アプリケーション実行部、ミドルウェア、データベース等が主記憶装置1200内の所定の場所(アドレス)に記憶されることを意味する。また、本実施形態のデータベース処理プログラムをテストするために実行されるプログラムは、主記憶装置1200に記憶されていると良い。CPU1100は、そのプログラムを読み出すことにより、データベース処理プログラムのテストを実行するように処理する。換言すれば、このプログラムは、以降で説明する各部を実現するためのものであって、このプログラムがCPU1100で処理されることで、各部の処理が実現される。各処理部(各部)は、プログラムで実現されても良く、その場合はCPU1100で実行されることにより、その処理は実現される。それらのプログラムは、CD−ROMやDVDに記憶され、メモリ(主記憶装置1200)にインストールされても良い。各処理部は、その機能をハードウェアで実現することも可能である。
≪Configuration≫
FIG. 1 illustrates the internal functional configuration of a computer that executes the database processing program test method of the present embodiment.
A computer 1000 (test apparatus) includes a CPU (Central Processing Unit) 1100 that is realized as a control unit that controls execution of an application execution unit (AP execution unit) that processes data using a database, and a storage unit A computer having a main storage device 1200 realized as AP deployment information 1300, AP server 1400, and database 1500 are arranged on the main storage device 1200. Note that “arrangement” of some data, application execution unit, middleware, database, or the like in the main storage device 1200 means that the data, application execution unit, middleware, database, or the like is a predetermined location (address) in the main storage device 1200. It means that it is memorized. Further, a program executed for testing the database processing program of the present embodiment may be stored in the main storage device 1200. The CPU 1100 reads out the program and performs processing so as to execute a test of the database processing program. In other words, this program is for realizing each unit described below, and processing of each unit is realized by processing this program by the CPU 1100. Each processing unit (each unit) may be realized by a program, and in that case, the processing is realized by being executed by the CPU 1100. Those programs may be stored in a CD-ROM or DVD and installed in a memory (main storage device 1200). Each processing unit can also realize its function by hardware.

AP配備情報1300は、AP情報1310と、実行モード情報1320とを有している。AP情報1310は、配備を行うAP実行部に関する情報(例えば、当該AP実行部を実行するためのファイル等)を保持する。なお、AP実行部の「配備」とは、計算機1000に、前記ファイルを読み出してAPをインストールして、そのAP実行部を利用可能な状態にすることを意味する。実行モード情報1320は、AP実行部が本番用に実行されることを示す本番モードまたはAP実行部がテスト用に実行されることを示すテストモードに区別される実行モードを識別する情報である。後記する実行モード判定処理部1511により、その識別が行われる。   The AP deployment information 1300 includes AP information 1310 and execution mode information 1320. The AP information 1310 holds information related to the AP execution unit that performs deployment (for example, a file or the like for executing the AP execution unit). Note that “deployment” of the AP execution unit means that the computer 1000 reads the file and installs the AP so that the AP execution unit can be used. The execution mode information 1320 is information for identifying an execution mode that is classified into a production mode indicating that the AP execution unit is executed for production or a test mode indicating that the AP execution unit is executed for testing. The identification is performed by an execution mode determination processing unit 1511 described later.

APサーバ1400は、ユーザからの要求(計算機1000の入力手段(キーボードやマウス等で実現されるもの)から入力された要求)を受け付けて、その要求をデータベース1500の処理に橋渡しする機能を有するミドルウェアである。このAPサーバ1400は、アプリケーション実行部を実行するための環境(記憶領域)を与えるコンテナ1410、AP配備情報1300に基づいてAP実行部の配備を行うAP配備部1420、AP実行部の実行モードを管理するテスト情報管理部1430、データベース1500と通信するDB(Data Base)アクセス制御部1440を有している。   The AP server 1400 is a middleware having a function of accepting a request from a user (a request input from an input means (a keyboard or mouse or the like) of the computer 1000) and bridging the request to the processing of the database 1500. It is. The AP server 1400 includes a container 1410 that provides an environment (storage area) for executing the application execution unit, an AP deployment unit 1420 that deploys the AP execution unit based on the AP deployment information 1300, and an execution mode of the AP execution unit. A test information management unit 1430 for management and a DB (Data Base) access control unit 1440 for communication with the database 1500 are provided.

このAPサーバ1400おいて、さらに、コンテナ1410には、計算機1000において実行されるアプリケーション実行部として、AP実行部1(1411)、AP実行部2(1412)が配備されている。
また、テスト情報管理部1430には、AP実行部ごとに実行モードを格納するためのテスト情報管理テーブル1431が接続されている。
In this AP server 1400, an AP execution unit 1 (1411) and an AP execution unit 2 (1412) are further provided in the container 1410 as application execution units executed in the computer 1000.
The test information management unit 1430 is connected to a test information management table 1431 for storing an execution mode for each AP execution unit.

データベース1500は、主記憶装置1200に配置されたインメモリデータベースである。このデータベース1500は、DBアクセス制御部1440からの接続要求を受け付ける接続処理部1510、コネクションの生成と管理をするコネクション制御部1520、SQL(Structured Query Language)を解析してデータ処理の計画をたてるSQL解析部1530、AP実行部を実行したときに対象となるデータの処理を制御するデータ制御部1540、MVCC(Multi Version Concurrency Control)で本番用データ(本番用の更新データ等)を管理するため、データのタイムスタンプを管理するバージョン制御部1550、データを格納するデータ格納部(図1の、本番用データ格納部1560およびテスト用データ格納部1561の総称)を有している。   The database 1500 is an in-memory database arranged in the main storage device 1200. This database 1500 analyzes a connection processing unit 1510 that accepts a connection request from the DB access control unit 1440, a connection control unit 1520 that generates and manages connections, and a structured query language (SQL) to plan data processing. In order to manage production data (production update data, etc.) with the SQL analysis unit 1530, the data control unit 1540 that controls the processing of the target data when the AP execution unit is executed, and MVCC (Multi Version Concurrency Control) A version control unit 1550 that manages the time stamp of the data, and a data storage unit that stores the data (generic name of the production data storage unit 1560 and the test data storage unit 1561 in FIG. 1).

このデータベース1500において、さらに、接続処理部1510には、実行モード情報1320から実行モードを判定する実行モード判定処理部1511が接続されている。
また、コネクション制御部1520には、実行モードがテストモードであるときは、当該実行モード情報1320をコネクションに設定するテスト用コネクション処理部1521が接続されている。
また、バージョン制御部1550には、MVCCでテスト用データ(テスト用の更新データ等)を管理するため、データのタイムスタンプを管理するテスト用バージョン制御部1551が接続されている。
以下、各部について簡単に説明する。
In the database 1500, the connection processing unit 1510 is further connected with an execution mode determination processing unit 1511 that determines an execution mode from the execution mode information 1320.
Further, when the execution mode is the test mode, the connection control unit 1520 is connected to a test connection processing unit 1521 that sets the execution mode information 1320 to the connection.
The version control unit 1550 is connected to a test version control unit 1551 that manages time stamps of data in order to manage test data (such as test update data) using MVCC.
Hereinafter, each part will be briefly described.

[コンテナ]
コンテナ1410は、AP実行部の実行環境を提供する。その実行環境を提供するために、例えば、データ構造、抽象データ型またはクラス等を表現するオブジェクトの集合を組織的に主記憶装置1200に格納する。そして、AP実行部はコンテナ1410の中に配備された後、実行が開始される。図1の例では、AP実行部1(1411)、AP実行部2(1412)はコンテナ1410に配備された後、それぞれに要求された処理を実行する。
[container]
The container 1410 provides an execution environment for the AP execution unit. In order to provide the execution environment, for example, a set of objects representing a data structure, an abstract data type, a class, or the like is systematically stored in the main storage device 1200. Then, after the AP execution unit is deployed in the container 1410, execution is started. In the example of FIG. 1, the AP execution unit 1 (1411) and the AP execution unit 2 (1412) are deployed in the container 1410 and then execute the requested processes.

[AP配備部]
AP配備部1420は、指定されたAP実行部の配備を行う。そして、実行モードに応じて配備のための処理を切り替える機能なども含めている。なお、AP実行部の指定は、例えば、計算機1000が備える、前記入力手段により当該APを選択することによりなされる。
[AP deployment department]
The AP deployment unit 1420 deploys the designated AP execution unit. And the function etc. which switch the process for deployment according to execution mode are also included. The AP execution unit is specified by, for example, selecting the AP using the input unit provided in the computer 1000.

[テスト情報管理部]
テスト情報管理部1430は、指定された実行モードをテスト情報管理テーブル1431に格納する。実行モードの指定は、例えば、実行モード情報1320を用いて前記入力手段から行われ、その指定内容が、テスト情報管理テーブル1431に反映される。図1において、テスト情報管理テーブル1431では、AP実行部1(1411)はテストモードで実行され、AP実行部2(1412)は本番モードで実行されるように、実行モードがAP実行部ごとに格納されている。
[Test Information Management Department]
The test information management unit 1430 stores the designated execution mode in the test information management table 1431. For example, the execution mode is specified from the input unit using the execution mode information 1320, and the specified content is reflected in the test information management table 1431. In FIG. 1, in the test information management table 1431, the AP execution unit 1 (1411) is executed in the test mode, and the AP execution unit 2 (1412) is executed in the production mode. Stored.

[DBアクセス制御部]
DBアクセス制御部1440は、データベース1500への接続を行う機能を有する。また、コンテナ1410に配備されたAP実行部(図1では、AP実行部1(1411)、AP実行部2(1412))からAP実行部が配備されたことを示す接続情報を受信し、その接続情報をデータベース1500に送信する。
このDBアクセス制御部1440は、接続処理部1510に通信して接続する(接続要求をする)と、SQL文をデータベース1500に伝えるためのコネクションを、接続処理部1510から受け取る。
また、DBアクセス制御部1440は、接続時に、テスト情報管理部1430から取得した実行モード情報1320を、接続処理部1510に伝える機能も有する。
[DB access control unit]
The DB access control unit 1440 has a function of connecting to the database 1500. Also, connection information indicating that the AP execution unit has been deployed is received from the AP execution unit deployed in the container 1410 (in FIG. 1, AP execution unit 1 (1411), AP execution unit 2 (1412)). The connection information is transmitted to the database 1500.
When the DB access control unit 1440 communicates and connects to the connection processing unit 1510 (makes a connection request), the DB access control unit 1440 receives a connection for transmitting the SQL statement to the database 1500 from the connection processing unit 1510.
The DB access control unit 1440 also has a function of transmitting the execution mode information 1320 acquired from the test information management unit 1430 to the connection processing unit 1510 at the time of connection.

[接続処理部]
接続処理部1510は、DBアクセス制御部1440からデータベース1500への接続要求を受け取って、SQLリクエストを受け付けるためのコネクションをDBアクセス制御部1440へ返す。さらに、前記接続情報を解析する機能も有しており、この接続情報には、タイムアウトなどの情報も含まれる。さらに、接続処理部1510は、実行モード判定処理部1511から実行モードを受け取り、実行モードを接続情報とともにコネクション制御部1520に出力する機能を有する。
[Connection processing section]
The connection processing unit 1510 receives a connection request to the database 1500 from the DB access control unit 1440 and returns a connection for accepting the SQL request to the DB access control unit 1440. Furthermore, it has a function of analyzing the connection information, and this connection information includes information such as timeout. Further, the connection processing unit 1510 has a function of receiving the execution mode from the execution mode determination processing unit 1511 and outputting the execution mode to the connection control unit 1520 together with the connection information.

[コネクション制御部]
コネクション制御部1520は、接続処理部1510から接続情報および実行モードが入力されたときに、コネクションを生成する。さらに、テスト用コネクション処理部1521を使い、実行モードがテストモードであるときは、生成したコネクションに当該実行モード情報1320を入力する機能を有する。このようにして、実行モードがテストモードであるときは、テスト用のコネクションを生成し、実行モードが本番モードであるときは、本番用のコネクションを生成する。
[Connection control section]
The connection control unit 1520 generates a connection when connection information and an execution mode are input from the connection processing unit 1510. Further, when the test connection processing unit 1521 is used and the execution mode is the test mode, the execution mode information 1320 is input to the generated connection. In this way, a test connection is generated when the execution mode is the test mode, and a production connection is generated when the execution mode is the production mode.

[SQL解析部]
SQL解析部1530は、コネクションから入力されたSQLリクエストを解析し、検索(参照)や更新といったデータ処理をデータ制御部1540に要求する。
[SQL analysis section]
The SQL analysis unit 1530 analyzes the SQL request input from the connection, and requests the data control unit 1540 to perform data processing such as search (reference) or update.

[データ制御部]
データ制御部1540は、データ格納部(1560、1561)に格納されているデータを参照したり、更新データを作成したりする。データのある場所や作成する場所(アドレス)は、バージョン制御部1550から取得する。
[Data control section]
The data control unit 1540 refers to the data stored in the data storage unit (1560, 1561) or creates update data. The location where the data exists and the location (address) to be created are acquired from the version control unit 1550.

[バージョン制御部]
バージョン制御部1550は、データが更新されるたびに、その更新データの各々に対してバージョン情報を追加し、データの更新状況を制御する機能を有する。トランザクションのタイムスタンプから、そのトランザクションが開始した時点より前に更新されたバージョンのデータを見えるようにする。例えば、計算機1000が備える表示手段(ディスプレイ等により実現されたもの)において、追加したバージョン情報として、そのデータに採番したバージョン、タイムスタンプ、内容、更新日時等を表示するようにする。実行モードがテストモードの場合には、テスト用バージョン制御部1551にテストデータのバージョンを問い合わせる機能を有する。このようにして、本番用のデータの更新状況およびテスト用のデータの更新状況を独立に管理する。
[Version control section]
Each time the data is updated, the version control unit 1550 has a function of adding version information to each of the update data and controlling the data update status. Make a transaction's timestamp visible to a version of the data that was updated before the transaction started. For example, the display means (implemented by a display or the like) included in the computer 1000 displays the version number, time stamp, content, update date and time, etc. assigned to the data as the added version information. When the execution mode is the test mode, the test version control unit 1551 is inquired about the version of the test data. In this way, the update status of production data and the update status of test data are managed independently.

[データ格納部]
データ格納部は、アプリケーション実行部が実行の対象とするデータを格納するエリア(記憶領域:例えば、RAM(Random Access Memory)等で実現される。)であり、本番用のデータを格納する本番用データ格納部1560とテスト用のデータを格納するテスト用データ格納部1561に分かれている。本番用データ格納部1560とテスト用データ格納部1561は、それぞれデータに対してのロックの状態をもつ。その状態をもたせるために、当該データに対し、ロックの状態を示すフラグを追加し、データ制御部1540の制御に基づいてフラグの値を設定する。
[Data storage section]
The data storage unit is an area (storage area: realized by, for example, a RAM (Random Access Memory) or the like) that stores data to be executed by the application execution unit, and is used for production data that stores production data. It is divided into a data storage unit 1560 and a test data storage unit 1561 for storing test data. The production data storage unit 1560 and the test data storage unit 1561 each have a locked state with respect to the data. In order to have this state, a flag indicating the lock state is added to the data, and the value of the flag is set based on the control of the data control unit 1540.

このような構成を有することにより、CPU1100は、アプリケーション実行部ごとに付された実行モード情報1320に基づいて、配備されたアプリケーション実行部を本番用またはテスト用として実行することができる。このとき、本番用としてあるアプリケーション実行部を実行している間に、テスト用として別のアプリケーション実行部を実行することもできる。つまり、各アプリケーション実行部の実行は、テストモードであれ本番モードであれ、独立して行われる。   By having such a configuration, the CPU 1100 can execute the deployed application execution unit for production or testing based on the execution mode information 1320 attached to each application execution unit. At this time, another application execution unit can be executed for testing while the application execution unit for production is being executed. That is, the execution of each application execution unit is performed independently whether in the test mode or the production mode.

≪処理≫
図2は、本実施形態において、AP実行部を配備しテストを実行する処理の流れ全体を示すシーケンス図である。なお、接続処理部1510がコネクション2000を生成する処理の流れの詳細は、図3にて説明する。また、SQLリクエストを受け取ったコネクション2000の処理の流れの詳細は、図4、図5にて説明する。
<< Process >>
FIG. 2 is a sequence diagram illustrating the entire flow of processing for deploying an AP execution unit and executing a test in the present embodiment. Details of the flow of processing in which the connection processing unit 1510 generates the connection 2000 will be described with reference to FIG. Details of the processing flow of the connection 2000 that has received the SQL request will be described with reference to FIGS.

AP配備部1420は、AP情報1310と実行モード情報1320から構成されるAP配備情報1300の入力を受けて、実行モード情報1320をテスト情報管理部1430に書き込む(ステップS210)。さらに、AP配備部1420は、AP情報を使い、コンテナ1410に、テストの対象となるAP実行部1(1411)を配備する(ステップS211)。   The AP deployment unit 1420 receives the AP deployment information 1300 configured from the AP information 1310 and the execution mode information 1320, and writes the execution mode information 1320 to the test information management unit 1430 (step S210). Further, the AP deployment unit 1420 deploys the AP execution unit 1 (1411) to be tested in the container 1410 using the AP information (step S211).

AP実行部1(1411)の配備後にテストが開始され、データベース処理が必要になった時に、DBアクセス制御部1440に、データベース1500に接続するためのコネクションを要求する(ステップS212)。この要求をするにあたり、AP実行部1(1411)は、接続情報をDBアクセス制御部1440に送信する。   When the test is started after the deployment of the AP execution unit 1 (1411) and database processing becomes necessary, the DB access control unit 1440 is requested to connect to the database 1500 (step S212). In making this request, the AP execution unit 1 (1411) transmits the connection information to the DB access control unit 1440.

前記要求を受け付けたDBアクセス制御部1440は、テスト情報管理部1430からAP実行部1(1411)の実行モード情報を読み取り(ステップS213)、接続情報に実行モード情報を追加し、接続処理部1510に接続する(ステップS214)。   The DB access control unit 1440 that has received the request reads the execution mode information of the AP execution unit 1 (1411) from the test information management unit 1430 (step S213), adds the execution mode information to the connection information, and the connection processing unit 1510. (Step S214).

DBアクセス制御部1440と接続処理部1510は、接続情報を使って通信路を確立する。この例では、接続処理部1510が、コネクション制御部1520(図3参照)によりコネクション2000を生成させ(ステップS215)、生成したコネクション2000を、そのままDBアクセス制御部1440に返している(ステップS216)。この処理の流れの詳細は、図3を使って説明する。   The DB access control unit 1440 and the connection processing unit 1510 establish a communication path using the connection information. In this example, the connection processing unit 1510 generates a connection 2000 by the connection control unit 1520 (see FIG. 3) (step S215), and returns the generated connection 2000 to the DB access control unit 1440 as it is (step S216). . Details of this processing flow will be described with reference to FIG.

AP実行部1(1411)は、DBアクセス制御部1440から受け取ったコネクション2000を使い、SQLリクエストを送信し(ステップS217)、その返信としてSQLレスポンスを受け取る(ステップS218)。この処理の流れの詳細は、それぞれ図4、図5を使って説明する。
以上で、AP実行部を配備しテストを実行する処理の流れ全体に関する説明を終了する。
The AP execution unit 1 (1411) uses the connection 2000 received from the DB access control unit 1440, transmits an SQL request (step S217), and receives an SQL response as a reply (step S218). Details of this processing flow will be described with reference to FIGS. 4 and 5, respectively.
This is the end of the description of the entire process flow of deploying the AP execution unit and executing the test.

図3は、接続処理部1510がコネクション2000を生成する処理の流れの詳細を示すシーケンス図である。接続処理部1510は、DBアクセス制御部1440から実行モード情報を含んだ接続情報を入力として受け取る。   FIG. 3 is a sequence diagram showing details of the flow of processing in which the connection processing unit 1510 generates the connection 2000. The connection processing unit 1510 receives connection information including execution mode information from the DB access control unit 1440 as an input.

接続処理部1510は、接続情報を実行モード判定処理部1511に送信する(ステップS301)。実行モード判定処理部1511は、接続情報から実行モード情報をとりだして、実行モードを判定する。ちなみに、配備されたのはAP実行部1(1411)であるため、実行モードは、テストモードである(例えば、図1参照)。判定した後、その実行モード情報を接続処理部1510に返す(ステップS302)。   The connection processing unit 1510 transmits connection information to the execution mode determination processing unit 1511 (step S301). The execution mode determination processing unit 1511 extracts the execution mode information from the connection information and determines the execution mode. Incidentally, since the AP execution unit 1 (1411) is deployed, the execution mode is the test mode (see, for example, FIG. 1). After the determination, the execution mode information is returned to the connection processing unit 1510 (step S302).

接続処理部1510は、接続情報と実行モード情報を入力として、コネクション制御部1520にコネクションを要求する(ステップS303)。コネクション制御部1520はコネクション2000を生成し(ステップS304)、さらに、実行モードがテストモードであるため、生成したコネクション2000の情報と実行モード情報とをテスト用コネクション処理部1521に送信する(ステップS305)。テスト用コネクション処理部1521は、コネクション2000に実行モード情報を設定する(ステップS306)。このようにしてテスト用のコネクションを生成する。   The connection processing unit 1510 receives the connection information and the execution mode information as input, and requests a connection from the connection control unit 1520 (step S303). The connection control unit 1520 generates the connection 2000 (step S304), and further transmits the generated connection 2000 information and execution mode information to the test connection processing unit 1521 because the execution mode is the test mode (step S305). ). The test connection processing unit 1521 sets execution mode information for the connection 2000 (step S306). In this way, a test connection is generated.

その後、生成したコネクション2000は、コネクション制御部1520から、接続処理部1510を介して、DBアクセス制御部1440に渡される。これにより、APサーバ1400とデータベース1500との通信路が確立される。
以上で、接続処理部1510がコネクション2000を生成する処理の流れの詳細の説明を終了する。
Thereafter, the generated connection 2000 is transferred from the connection control unit 1520 to the DB access control unit 1440 via the connection processing unit 1510. Thereby, a communication path between the AP server 1400 and the database 1500 is established.
This is the end of the detailed description of the flow of processing in which the connection processing unit 1510 generates the connection 2000.

図4は、参照系のSQLリクエストを受け取ったコネクション2000の処理の流れの詳細を示すシーケンス図である。ここでいう「参照系のSQLリクエスト」とは、データの更新や削除をせず、さらにデータにロックをかける必要のないSQLリクエストのことをいう。   FIG. 4 is a sequence diagram showing details of the processing flow of the connection 2000 that has received the reference SQL request. The “reference SQL request” here refers to an SQL request that does not update or delete data and that does not require locking of data.

AP実行部1(1411)からSQLリクエストを受信したコネクション2000は、SQL解析部1530にSQLリクエストを入力する。この際、コネクション毎に設定されている実行モード情報も入力する(ステップS401)。   The connection 2000 that has received the SQL request from the AP execution unit 1 (1411) inputs the SQL request to the SQL analysis unit 1530. At this time, the execution mode information set for each connection is also input (step S401).

SQL解析部1530は、入力されたSQLリクエストの解析を行う。解析した結果、データに対しての処理が必要な場合は、データ制御部1540にデータ処理を要求する。この際に、実行モード情報も入力する(ステップS402)。   The SQL analysis unit 1530 analyzes the input SQL request. As a result of the analysis, if processing on the data is necessary, the data control unit 1540 is requested to perform data processing. At this time, execution mode information is also input (step S402).

データ制御部1540は、SQL解析部1530からの要求に従って、バージョン制御部1550に対し、データのバージョン情報(本番用データのバージョン情報またはテスト用データのバージョン情報)を取得するように要求する。このとき、本番用データ格納部1560またはテスト用データ格納部1561上のデータを参照する方法も要求する(ステップS403)。バージョン制御部1550は、実行モードがテストモードだった場合、テスト用バージョン制御部1551に、テスト用データ格納部1561上のデータを参照する方法を要求する(ステップS404)。   The data control unit 1540 requests the version control unit 1550 to acquire data version information (production data version information or test data version information) in accordance with a request from the SQL analysis unit 1530. At this time, a method for referring to the data in the production data storage unit 1560 or the test data storage unit 1561 is also requested (step S403). When the execution mode is the test mode, the version control unit 1550 requests the test version control unit 1551 to refer to the data on the test data storage unit 1561 (step S404).

データがテスト用データ格納部1561に存在する場合、テスト用データ格納部1561上のデータを参照するための情報が、テスト用バージョン制御部1551からバージョン制御部1550を介してデータ制御部1540に送信される。データがテスト用データ格納部1561に存在しない場合、または実行モードが本番モードの場合、本番用データ格納部1560上のデータを参照するための情報が、バージョン制御部1550を介してデータ制御部1540に送信される。   When the data exists in the test data storage unit 1561, information for referring to the data in the test data storage unit 1561 is transmitted from the test version control unit 1551 to the data control unit 1540 via the version control unit 1550. Is done. When the data does not exist in the test data storage unit 1561 or when the execution mode is the production mode, information for referring to the data on the production data storage unit 1560 is sent via the version control unit 1550 to the data control unit 1540. Sent to.

データ制御部1540は、バージョン制御部1550から受け取った情報に従って、本番用データ格納部1560かテスト用データ格納部1561かのどちらかに存在するデータを参照する(ステップS405)。   The data control unit 1540 refers to the data existing in either the production data storage unit 1560 or the test data storage unit 1561 according to the information received from the version control unit 1550 (step S405).

その後、前記SQLリクエストに対するSQLレスポンスが、データ制御部1540からSQL解析部1530およびコネクション2000を介して、AP実行部1(1411)に送信される。これにより、本番用データ格納部1560のデータまたはテスト用データ格納部1561のデータの参照処理が完了する。
以上で、参照系のSQLリクエストを受け取ったコネクション2000の処理の流れの詳細に関する説明を終了する。
Thereafter, an SQL response to the SQL request is transmitted from the data control unit 1540 to the AP execution unit 1 (1411) via the SQL analysis unit 1530 and the connection 2000. Thereby, the reference processing of the data in the production data storage unit 1560 or the data in the test data storage unit 1561 is completed.
This is the end of the description regarding the details of the processing flow of the connection 2000 that has received the reference SQL request.

図5は、更新系のSQLリクエストを受け取ったコネクション2000の処理の流れの詳細を示すシーケンス図である。ここでいう「更新系のSQLリクエスト」とは、参照系のSQLリクエスト以外のSQLリクエストをいう。   FIG. 5 is a sequence diagram showing details of the processing flow of the connection 2000 that has received the update-type SQL request. The “update SQL request” here refers to an SQL request other than a reference SQL request.

一般的に、データベースでデータを更新する場合は、障害に備えて更新前と更新後のデータの値をログに書き込むため、更新前データも必要とする。そのため、更新前データ取得の処理(ステップS501からステップS505)までは、図4のデータ参照までの処理の流れ(ステップS401からステップS405)と同じである。つまり、更新前のデータを取得するための一連の処理は、データを参照するための一連の処理と同一である。よって、このあたりの詳細な説明は、省略する。   In general, when data is updated in a database, data values before and after updating are written in a log in preparation for a failure, so that data before updating is also required. For this reason, the process for obtaining pre-update data (step S501 to step S505) is the same as the process flow (step S401 to step S405) up to the data reference in FIG. That is, a series of processes for acquiring data before update is the same as a series of processes for referring to data. Therefore, detailed description around this will be omitted.

更新後データは、実行モードが本番モードの場合は、本番用データ格納部1560に作成される(ステップS506)。また、更新後データは、実行モードがテストモードの場合は、テスト用データ格納部1561に作成される(ステップS507)。   The updated data is created in the production data storage unit 1560 when the execution mode is the production mode (step S506). Further, the post-update data is created in the test data storage unit 1561 when the execution mode is the test mode (step S507).

さらに、データ制御部1540は、更新後データを本番用データ格納部1560に作成した場合(ステップS506参照)は、バージョン制御部1550に、作成した更新後データの情報を入力して、バージョン情報を追加する(ステップS508)。このとき、本番用データの最新のバージョンを採番する。また、データ制御部1540は、更新後データをテスト用データ格納部1561に作成した場合(ステップS507参照)は、テスト用バージョン制御部1551に、作成した更新後データの情報を入力して、バージョン情報を追加する(ステップS509)。このとき、テスト用データの最新のバージョンを採番する。   Furthermore, when the updated data is created in the production data storage unit 1560 (see step S506), the data control unit 1540 inputs information on the created updated data into the version control unit 1550, and the version information is updated. It adds (step S508). At this time, the latest version of the production data is numbered. In addition, when the updated data is created in the test data storage unit 1561 (see step S507), the data control unit 1540 inputs information of the created updated data to the test version control unit 1551, and the version Information is added (step S509). At this time, the latest version of the test data is numbered.

その後、前記SQLリクエストに対するSQLレスポンスが、データ制御部1540からSQL解析部1530およびコネクション2000を介して、AP実行部1(1411)に送信される。これにより、本番用データ格納部1560のデータまたはテスト用データ格納部1561のデータの更新処理が完了する。
以上で、更新系のSQLリクエストを受け取ったコネクション2000の処理の流れの詳細に関する説明を終了する。
Thereafter, an SQL response to the SQL request is transmitted from the data control unit 1540 to the AP execution unit 1 (1411) via the SQL analysis unit 1530 and the connection 2000. Thereby, the update process of the data in the production data storage unit 1560 or the data in the test data storage unit 1561 is completed.
This is the end of the description regarding the details of the processing flow of the connection 2000 that has received the update-type SQL request.

図6は、テストと本番が同じデータの参照および更新をする場合の、データの管理について示すシーケンス図である。SQL解析部1530、データ制御部1540、バージョン制御部1550、テスト用バージョン制御部1551の動作は図3および図4で説明しているので、重複した説明を避けるため、この図には含めないものとする。   FIG. 6 is a sequence diagram showing data management when referring to and updating data having the same test and production. Since the operations of the SQL analysis unit 1530, the data control unit 1540, the version control unit 1550, and the test version control unit 1551 have been described with reference to FIGS. 3 and 4, they are not included in this figure in order to avoid redundant description. And

この処理では、コネクション(テスト)C60とコネクション(本番)C61からは、データ1の参照と更新を行うSQLリクエストが、それぞれ送信されてくるものとする。また、テストを実施する前は、本番用データ格納部1560にしかデータ1は存在しないものとする(ND601参照)。なお、コネクション(テスト)C60は、テストモードとして実行されるAP実行部1(1411)がデータベース1500にアクセスしたときに生成されるコネクションである。また、コネクション(本番)C61は、本番モードとして実行されるAP実行部2(1412)がデータベース1500にアクセスしたときに生成されるコネクションである。したがって、図6では、AP実行部1(1411)およびAP実行部2(1412)が1つのデータ(データ1)に対してデータ処理を実行する場合における、当該データの管理に関するものである。   In this process, it is assumed that an SQL request for referring to and updating data 1 is transmitted from the connection (test) C60 and the connection (production) C61. Further, it is assumed that data 1 exists only in the production data storage unit 1560 before the test is performed (see ND 601). The connection (test) C60 is a connection generated when the AP execution unit 1 (1411) executed as the test mode accesses the database 1500. The connection (production) C61 is a connection generated when the AP execution unit 2 (1412) executed as the production mode accesses the database 1500. Therefore, FIG. 6 relates to management of data when the AP execution unit 1 (1411) and the AP execution unit 2 (1412) execute data processing on one piece of data (data 1).

この処理では、まず、コネクション(テスト)C60でテストモードのトランザクションが開始される(ステップS601)。データ1の参照では、テスト用データ格納部1561にはデータ1が存在しないので、本番用データ格納部1560上の、バージョンが本番001と採番されたデータ1(ND601)を参照する(ステップS602)。また、データ1の更新では、本番001と採番されたデータ1(ND601)をテスト用に複製し、その複製したデータを更新する。その結果、テスト用データ格納部1561には、更新後のデータ1(TD601)を、テスト001というバージョンで作成する(ステップS603)。更新前の古いデータである、バージョンが本番001のデータ1(ND601)は、本番用データ格納部1560の中では最新のデータなので、捨てずに残しておく。なお、本番用データをテスト用データに複製する処理は、データ制御部1540が実行する。   In this process, first, a test mode transaction is started at connection (test) C60 (step S601). In reference to data 1, since data 1 does not exist in test data storage unit 1561, reference is made to data 1 (ND601) whose version is numbered 001 on production data storage unit 1560 (step S602). ). In the update of data 1, data 1 (ND601) numbered as production 001 is duplicated for testing, and the duplicated data is updated. As a result, the updated data 1 (TD601) is created in the test data storage unit 1561 with a version of test 001 (step S603). Data 1 (ND601) whose version is production 001, which is old data before update, is the latest data in the production data storage unit 1560 and is left without being discarded. The data control unit 1540 executes the process of copying the production data to the test data.

次に、コネクション(本番)C61にて、本番モードのトランザクションが開始されると(ステップS604)、実行モードが本番モードなので、参照(ステップS605)も、更新(ステップS606)も、本番用データ格納部1560に格納された本番001と採番されたデータ1(ND601)に対して行われる。その結果、更新後の新しいデータ1をバージョンが本番002と採番して、作成する(ND602参照)。   Next, when a transaction in the production mode is started in the connection (production) C61 (step S604), since the execution mode is the production mode, both the reference (step S605) and the update (step S606) are stored for production data. This is performed for the production number 001 and the numbered data 1 (ND601) stored in the section 1560. As a result, the new data 1 after the update is created with the version numbered as the actual 002 (see ND602).

バージョンが本番001であるデータ1(ND601)は、参照する本番モードのトランザクションが終了した時点で、不要データとして回収対象になる。回収対象になったデータ(つまり、本番001と採番されたデータ1(ND601))は非同期で回収され、本番用データ格納部1560から削除される(ステップS607)。   Data 1 (ND601) whose version is 001 is the collection target as unnecessary data at the time when the transaction in the production mode to be referred to is completed. Data to be collected (that is, production number 001 and numbered data 1 (ND601)) are collected asynchronously and deleted from the production data storage unit 1560 (step S607).

次に、コネクション(テスト)C60で、テストモードのトランザクションが開始される(ステップS608)。データ1の参照では、テスト用データ格納部1561に格納された、バージョンがテスト001と採番されたデータ1(TD601)が存在するので、そのデータ1を参照する(ステップS609)。また、データ1の更新では、テスト001と採番されたデータ1(TD601)を更新し、テスト用データ格納部1561に更新後のデータ1(TD602)を、テスト002というバージョンで作成する(ステップS610)。   Next, a test mode transaction is started at connection (test) C60 (step S608). In reference to data 1, since there is data 1 (TD601) numbered version 001 stored in test data storage unit 1561, data 1 is referred to (step S609). In the update of data 1, data 1 (TD601) numbered as test 001 is updated, and updated data 1 (TD602) is created in the test data storage unit 1561 with a version of test 002 (step 002). S610).

バージョンがテスト001であるデータ1(TD601)は、参照するテストモードのトランザクションが終了した時点で、不要データとして回収対象になる。回収対象になったデータ(つまり、テスト001と採番されたデータ1(TD601))は、非同期で回収され、テスト用データ格納部1561から削除される(ステップS611)。
以上で、テストと本番が同じデータの参照および更新をする場合の、データの管理に関する説明を終了する。
Data 1 (TD601) whose version is test 001 becomes a collection target as unnecessary data at the time when the transaction in the test mode to be referred to is completed. Data to be collected (that is, data 1 (TD601) numbered as test 001) is collected asynchronously and deleted from the test data storage unit 1561 (step S611).
This is the end of the description regarding the management of data in the case of referring to and updating data having the same test and production.

図7は、テスト用のデータにロックをかけた場合の本番の処理の流れを示すシーケンス図である。ここでいう「ロック」とは、参照ロックと更新ロックのどちらの場合も含むものとする。なお、参照ロックとは、あるユーザによって参照中のデータが、別のユーザによって同時に更新等されるのを防ぐロックである。また、更新ロックとは、あるユーザによって更新中のデータが、別のユーザによって同時に更新等されるのを防ぐロックである。また、コネクション(テスト)C70は、テストモードとして実行されるAP実行部1(1411)がデータベース1500にアクセスしたときに生成されるコネクションである。また、コネクション(本番)C71は、本番モードとして実行されるAP実行部2(1412)がデータベース1500にアクセスしたときに生成されるコネクションである。   FIG. 7 is a sequence diagram showing the flow of the actual process when the test data is locked. The term “lock” here includes both a reference lock and an update lock. The reference lock is a lock that prevents data being referred to by a certain user from being updated simultaneously by another user. An update lock is a lock that prevents data being updated by one user from being updated simultaneously by another user. The connection (test) C70 is a connection generated when the AP execution unit 1 (1411) executed as the test mode accesses the database 1500. The connection (production) C71 is a connection generated when the AP execution unit 2 (1412) executed as the production mode accesses the database 1500.

まず、コネクション(本番)C71で実行モードが本番モードのトランザクションが開始される(ステップS701)。次に、コネクション(テスト)C70で実行モードがテストモードのトランザクションが開始される(ステップS702)。さらに、データ制御部1540によって、データ1のロックがAP実行部1(1411)から取得される(ステップS703)。この際、テスト用データ格納部1561において、バージョンが本番001のデータ1(ND701)の複製を、バージョンがテスト001のデータ1(TD701)として作成し、さらに、テスト用データ格納部1561上のデータ1(TD701)にのみロックをかける。   First, a transaction in which the execution mode is the production mode is started in the connection (production) C71 (step S701). Next, a transaction whose execution mode is the test mode is started in the connection (test) C70 (step S702). Further, the data control unit 1540 acquires the lock of data 1 from the AP execution unit 1 (1411) (step S703). At this time, in the test data storage unit 1561, a copy of the data 1 (ND701) whose version is production 001 is created as data 1 (TD701) whose version is test 001, and further, the data on the test data storage unit 1561 Only 1 (TD701) is locked.

バージョンがテスト001のデータ1(TD701)を別個に作成しているので、実行モードが本番モードのトランザクション(S701参照)は、実行モードがテストモードのトランザクション(S702参照)がかけたロックから影響を受けない。よって、ロックの開放(ステップS706)を行う前に、バージョンが本番001と採番されたデータ1(ND701)に対しての参照(ステップS704)や更新(ステップS705)を行うことができる。   Since data 1 (TD701) whose version is test 001 is created separately, the transaction whose execution mode is the production mode (see S701) is affected by the lock applied by the transaction whose execution mode is the test mode (see S702). I do not receive it. Therefore, before releasing the lock (step S706), the reference (step S704) and the update (step S705) can be performed with respect to the data 1 (ND701) whose version is numbered 001.

なお、図7の処理は、本番用のデータにロックをかけた場合のテストの処理についても同様である。実行モードがテストモードのトランザクションは、実行モードが本番モードのトランザクションがかけたロックから影響を受けないので、本番用のデータにかけたロックの開放を行う前に、テスト用のデータに対しての参照や更新を行うことができる。
以上で、テスト用のデータにロックをかけた場合の本番の処理に関する説明を終了する。
The process of FIG. 7 is the same as the test process when the production data is locked. Transactions whose execution mode is test mode are not affected by the lock applied by the transaction whose execution mode is production mode, so the reference to the test data before releasing the lock applied to the production data And can be updated.
This is the end of the description of the actual process when the test data is locked.

≪まとめ≫
以上説明した本実施形態によれば、テスト用データベースを用意することなく、かつ本番用データベースのロールバックを行うこともないため、データベース処理プログラムのテストを容易に行うことができる。
≪Summary≫
According to the present embodiment described above, the test of the database processing program can be easily performed because the test database is not prepared and the production database is not rolled back.

このとき、本番モードとテストモードとで同じデータを使用する場合であっても、テストによるデータの更新を本番用データに影響させずにすむため、テストを容易に行うことができるようになる。
また、参照系SQLの場合に、既存の本番用データをそのまま使うことができるので、テストによって使用するデータの記憶領域を削減することができる。
At this time, even when the same data is used in the production mode and the test mode, the update of the data by the test is not affected to the production data, so that the test can be easily performed.
Further, in the case of the reference system SQL, the existing production data can be used as it is, so that it is possible to reduce the data storage area used by the test.

また、本番用データとテスト用データとでロックの管理を分離するので、テストモードのトランザクションがロックをかけることによる、本番モードにおけるトランザクションのスループットの低下を削減することができる。
また、本番モードのトランザクションがロックをかけることによる、テストモードのトランザクションへの影響も削減することができる。
Further, since the lock management is separated between the production data and the test data, it is possible to reduce a decrease in the throughput of the transaction in the production mode due to the lock in the test mode transaction.
In addition, the influence on the test mode transaction due to the lock of the production mode transaction can be reduced.

また、本実施形態だと、参照にしか使わないデータの複製を必要としないので、インメモリデータベースの場合に、テストで使用するメモリの使用量を削減できるという効果もある。   In addition, according to the present embodiment, it is not necessary to duplicate data that is used only for reference. Therefore, in the case of an in-memory database, there is an effect that the amount of memory used for testing can be reduced.

≪その他≫
以上本発明の実施形態についての一例を示したが、本発明は、これに限定されず、本発明の趣旨を逸脱しない範囲で適宜変更が可能である。
≪Others≫
An example of the embodiment of the present invention has been described above, but the present invention is not limited to this and can be appropriately changed without departing from the spirit of the present invention.

例えば、本実施形態では、実行モード情報として本番モードとテストモードとの2つを区別する情報しか使わなかった。しかし、テスト毎に実行モード情報を変更し、複数のテストを同時にできるようにしても良い。具体的には、テスト情報管理テーブル1431において、アプリケーション実行部ごとに、実行しようとする種々のテストモードを割り当てて対応付けるように記憶する。   For example, in the present embodiment, only information that distinguishes between the production mode and the test mode is used as the execution mode information. However, the execution mode information may be changed for each test so that a plurality of tests can be performed simultaneously. Specifically, in the test information management table 1431, for each application execution unit, various test modes to be executed are assigned and stored so as to be associated with each other.

また、本実施形態では、コネクション制御部1520で生成したコネクション2000を、接続処理部1510を介して、通信路を含めてDBアクセス制御部1440に渡すようにした。しかし、通信路だけをDBアクセス制御部1440に返し、DBアクセス制御部1440でコネクション2000を別途作成することで、APサーバ1400とデータベース1500間を別の計算機に配置し、それらの間をネットワーク接続するようにしても良い。このようなネットワークを構成することにより、ディスクを使ったデータベースに対してこのテストを実行することもできる。   In the present embodiment, the connection 2000 generated by the connection control unit 1520 is transferred to the DB access control unit 1440 including the communication path via the connection processing unit 1510. However, by returning only the communication path to the DB access control unit 1440 and creating a connection 2000 separately by the DB access control unit 1440, the AP server 1400 and the database 1500 are arranged on different computers, and the network connection is established between them. You may make it do. By configuring such a network, this test can be performed on a database using disks.

その他、ハードウェア、ソフトウェア、各シーケンスなどの具体的な構成について、本発明の趣旨を逸脱しない範囲で適宜変更が可能である。   In addition, specific configurations of hardware, software, each sequence, and the like can be changed as appropriate without departing from the spirit of the present invention.

本実施形態のデータベース処理プログラムのテスト方法を実行する計算機の内部機能構成を図示したものである。2 illustrates an internal functional configuration of a computer that executes a test method for a database processing program according to the present embodiment. AP実行部を配備しテストを実行する処理の流れ全体を示すシーケンス図である。It is a sequence diagram which shows the whole flow of the process which arrange | positions AP execution part and performs a test. 接続処理部1510がコネクション2000を生成する処理の流れの詳細を示すシーケンス図である。FIG. 11 is a sequence diagram illustrating details of a flow of processing in which a connection processing unit 1510 generates a connection 2000. 参照系のSQLリクエストを受け取ったコネクション2000の処理の流れの詳細を示すシーケンス図である。FIG. 10 is a sequence diagram illustrating details of a processing flow of a connection 2000 that has received a reference-system SQL request. 更新系のSQLリクエストを受け取ったコネクション2000の処理の流れの詳細を示すシーケンス図である。FIG. 10 is a sequence diagram illustrating details of a processing flow of a connection 2000 that has received an update-type SQL request. テストと本番が同じデータの参照および更新をする場合の、データの管理について示すシーケンス図である。FIG. 11 is a sequence diagram illustrating data management when referring to and updating data having the same test and actual data. テスト用のデータにロックをかけた場合の、本番の処理の流れを示すシーケンス図である。FIG. 6 is a sequence diagram showing a flow of actual processing when lock is applied to test data.

符号の説明Explanation of symbols

1000 計算機
1100 CPU
1200 主記憶装置
1300 AP配備情報
1310 AP情報
1320 実行モード情報
1400 APサーバ
1410 コンテナ
1411、1412 AP実行部
1420 AP配備部
1430 テスト情報管理部
1431 テスト情報管理テーブル
1440 DBアクセス制御部
1500 データベース
1510 接続処理部
1511 実行モード判定処理部
1520 コネクション制御部
1521 テスト用コネクション処理部
1530 SQL解析部
1540 データ制御部
1550 バージョン制御部
1551 テスト用バージョン制御部
1560 本番用データ格納部
1561 テスト用データ格納部
2000、C60、C61、C70、C71 コネクション
ND601、ND602、ND701、ND702、TD601、TD602、TD701 データ1
1000 computer 1100 CPU
1200 Main storage device 1300 AP deployment information 1310 AP information 1320 Execution mode information 1400 AP server 1410 Container 1411, 1412 AP execution unit 1420 AP deployment unit 1430 Test information management unit 1431 Test information management table 1440 DB access control unit 1500 Database 1510 Connection processing Section 1511 Execution mode determination processing section 1520 Connection control section 1521 Test connection processing section 1530 SQL analysis section 1540 Data control section 1550 Version control section 1551 Test version control section 1560 Production data storage section 1561 Test data storage section 2000, C60 , C61, C70, C71 connection ND601, ND602, ND701, ND702, TD601, TD602, TD701 data 1

Claims (4)

データベース、および前記データベースを用いてデータを処理するアプリケーション実行部を実行可能な状態で記憶領域に配備する記憶手段と、
前記アプリケーション実行部の実行を制御する制御手段と、
を有するアプリケーションのテスト装置において、
前記記憶手段は、
少なくとも本番用に配備されたアプリケーション実行部を当該本番用に実行するように定める本番モードおよびテスト用に配備されたアプリケーション実行部を当該テスト用に実行するように定めるテストモードを有する実行モードを含む実行モード情報と、
前記実行モード情報を用いて前記アプリケーション実行部と前記実行モードとを対応付けることにより、本番用に実行されるアプリケーション実行部およびテスト用に実行されるアプリケーション実行部を特定するテスト情報管理部と、
前記特定したアプリケーション実行部の実行に際して、前記データベースにアクセスする要求を行うときには前記データベースに前記実行モード情報を送信するデータベースアクセス制御部と、
前記要求に従い、アクセスしようとするアプリケーション実行部に対応する実行モード情報に基づいて、本番用のコネクションまたはテスト用のコネクションを生成し、前記アプリケーション実行部と前記データベースとのアクセスを確立するコネクション制御部と、
前記実行モードが本番モードであるとき、前記本番用のアプリケーション実行部が処理するデータを本番用データとして格納する本番用データ格納部と、
前記実行モードがテストモードであるとき、前記テスト用のアプリケーション実行部が処理するデータをテスト用データとして格納するテスト用データ格納部と、
前記本番用データおよび前記テスト用データを、参照または更新するデータ制御部と、
前記本番用データが更新されると、その更新された本番用データのバージョンを特定し、前記本番用データの更新状況を管理する本番用バージョン制御部と、
前記テスト用データが更新されると、その更新されたテスト用データのバージョンを特定し、前記テスト用データの更新状況を管理するテスト用バージョン制御部と、
を記憶し、
前記制御手段は、
前記実行モード情報に基づいて、前記本番用のアプリケーション実行部およびテスト用のアプリケーション実行部のいずれかを実行させる
ことを特徴とするテスト装置。
A storage unit that deploys a database and an application execution unit that processes data using the database in an executable state;
Control means for controlling execution of the application execution unit;
In an application testing device having
The storage means
It includes an execution mode having at least a production mode for executing an application execution unit deployed for production and a test mode for executing an application execution unit deployed for test for the test. Execution mode information and
A test information management unit that identifies an application execution unit to be executed for production and an application execution unit to be executed for a test by associating the application execution unit with the execution mode using the execution mode information;
A database access control unit that transmits the execution mode information to the database when making a request to access the database during execution of the identified application execution unit;
In accordance with the request, a connection control unit that generates a production connection or a test connection based on execution mode information corresponding to the application execution unit to be accessed and establishes access between the application execution unit and the database When,
When the execution mode is the production mode, a production data storage unit that stores data to be processed by the production application execution unit as production data;
When the execution mode is a test mode, a test data storage unit that stores data to be processed by the test application execution unit as test data;
A data control unit for referring to or updating the production data and the test data;
When the production data is updated, the version of the updated production data is specified, and the production version control unit that manages the update status of the production data;
When the test data is updated, the version of the updated test data is specified, and the test version control unit that manages the update status of the test data;
Remember
The control means includes
One of the production application execution unit and the test application execution unit is executed based on the execution mode information.
前記アプリケーション実行部からデータの参照要求がなされた場合において、
前記データ制御部は、
前記実行モードがテストモードであり、前記テスト用データ格納部に前記テスト用データが格納されているときは、前記テスト用バージョン制御部から前記テスト用データのバージョンを特定し、前記バージョンのテスト用データを参照し、
前記実行モードが本番モードであるか、または、前記実行モードがテストモードであるが前記テスト用データ格納部に前記テスト用データが格納されていないときは、前記本番用バージョン制御部から前記本番用データのバージョンを特定し、前記バージョンの本番用データを参照する
ことを特徴とする請求項1に記載のテスト装置。
When a data reference request is made from the application execution unit,
The data control unit
When the execution mode is a test mode and the test data is stored in the test data storage unit, a version of the test data is specified from the test version control unit, and the version test Browse the data,
When the execution mode is the production mode or when the execution mode is the test mode but the test data is not stored in the test data storage unit, the production version control unit The test apparatus according to claim 1, wherein a data version is specified, and the production data of the version is referred to.
前記アプリケーション実行部からデータの更新要求がなされた場合において、
前記データ制御部は、
前記実行モードがテストモードであるときは、前記テスト用バージョン制御部から前記テスト用データのバージョンを特定し、前記バージョンのテスト用データを更新前データとして取得して更新し、当該更新後データを前記テスト用データ格納部に格納するとともに、前記テスト用バージョン制御部により、前記更新後データに対するバージョンを採番し、
前記実行モードが本番モードであるときは、前記本番用バージョン制御部から前記本番用データのバージョンを特定し、前記バージョンの本番用データを更新前データとして取得して更新し、当該更新後データを前記本番用データ格納部に格納するとともに、前記本番用バージョン制御部により、前記更新後データに対するバージョンを採番する
ことを特徴とする請求項1に記載のテスト装置。
When a data update request is made from the application execution unit,
The data control unit
When the execution mode is a test mode, the version of the test data is specified from the test version control unit, the test data of the version is acquired and updated as pre-update data, and the updated data is updated. While storing in the test data storage unit, by the test version control unit, number the version for the updated data,
When the execution mode is the production mode, the version of the production data is identified from the production version control unit, the production data of the version is acquired and updated as pre-update data, and the post-update data is updated. The test apparatus according to claim 1, wherein the test apparatus is stored in the production data storage unit, and the version for the updated data is numbered by the production version control unit.
データベース、および前記データベースを用いてデータを処理するアプリケーション実行部を実行可能な状態で記憶領域に配備する記憶手段と、
前記アプリケーション実行部の実行を制御する制御手段と、
を有するアプリケーションのテスト装置におけるテスト方法おいて、
前記記憶手段は、
少なくとも本番用に配備されたアプリケーション実行部を当該本番用に実行するように定める本番モードおよびテスト用に配備されたアプリケーション実行部を当該テスト用に実行するように定めるテストモードを有する実行モードを含む実行モード情報を記憶し、
前記制御手段において、
前記実行モード情報を用いて前記アプリケーション実行部と前記実行モードとを対応付けることにより、本番用に実行されるアプリケーション実行部およびテスト用に実行されるアプリケーション実行部を特定するステップと、
前記特定したアプリケーション実行部の実行に際して、前記データベースにアクセスする要求を行うときには前記データベースに前記実行モード情報を送信するステップと、
前記要求に従い、アクセスしようとするアプリケーション実行部に対応する実行モード情報に基づいて、本番用のコネクションまたはテスト用のコネクションを生成し、前記アプリケーション実行部と前記データベースとのアクセスを確立するステップと、
前記実行モードが本番モードであるとき、前記本番用のアプリケーション実行部が処理するデータを本番用データとして格納するステップと、
前記実行モードがテストモードであるとき、前記テスト用のアプリケーション実行部が処理するデータをテスト用データとして格納するステップと、
前記本番用データおよび前記テスト用データを、参照または更新するステップと、
前記本番用データが更新されると、その更新された本番用データのバージョンを特定し、前記本番用データの更新状況を管理するステップと、
前記テスト用データが更新されると、その更新されたテスト用データのバージョンを特定し、前記テスト用データの更新状況を管理するステップと、を実行し、
前記実行モード情報に基づいて、前記本番用のアプリケーション実行部およびテスト用のアプリケーション実行部のいずれかを実行させる
ことを特徴とするテスト方法。
A storage unit that deploys a database and an application execution unit that processes data using the database in an executable state;
Control means for controlling execution of the application execution unit;
In a test method for an application test apparatus having
The storage means
It includes an execution mode having at least a production mode for executing an application execution unit deployed for production and a test mode for executing an application execution unit deployed for test for the test. Memorize execution mode information,
In the control means,
Identifying the application execution unit executed for production and the application execution unit executed for testing by associating the application execution unit with the execution mode using the execution mode information;
Transmitting the execution mode information to the database when making a request to access the database when executing the specified application execution unit;
In accordance with the request, based on execution mode information corresponding to the application execution unit to be accessed, generating a production connection or a test connection, and establishing access between the application execution unit and the database;
When the execution mode is the production mode, storing the data processed by the production application execution unit as production data;
When the execution mode is a test mode, storing data processed by the test application execution unit as test data;
Referencing or updating the production data and the test data;
When the production data is updated, the version of the updated production data is specified, and the update status of the production data is managed,
When the test data is updated, the version of the updated test data is specified, and the update status of the test data is managed.
One of the production application execution unit and the test application execution unit is executed based on the execution mode information.
JP2008155680A 2008-06-13 2008-06-13 Test unit and test method Pending JP2009301352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008155680A JP2009301352A (en) 2008-06-13 2008-06-13 Test unit and test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008155680A JP2009301352A (en) 2008-06-13 2008-06-13 Test unit and test method

Publications (1)

Publication Number Publication Date
JP2009301352A true JP2009301352A (en) 2009-12-24

Family

ID=41548167

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008155680A Pending JP2009301352A (en) 2008-06-13 2008-06-13 Test unit and test method

Country Status (1)

Country Link
JP (1) JP2009301352A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013206126A (en) * 2012-03-28 2013-10-07 Nec Corp Content switching method, content switching system, relying party and open id provider
JP2016021161A (en) * 2014-07-15 2016-02-04 株式会社日立製作所 Simulator system, gateway system test device, and gateway system test method
JPWO2017072828A1 (en) * 2015-10-26 2018-03-08 株式会社日立製作所 Method and computer system for supporting debugging

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013206126A (en) * 2012-03-28 2013-10-07 Nec Corp Content switching method, content switching system, relying party and open id provider
JP2016021161A (en) * 2014-07-15 2016-02-04 株式会社日立製作所 Simulator system, gateway system test device, and gateway system test method
JPWO2017072828A1 (en) * 2015-10-26 2018-03-08 株式会社日立製作所 Method and computer system for supporting debugging
US10235270B2 (en) 2015-10-26 2019-03-19 Hitachi Ltd. Method for assisting with debugging, and computer system

Similar Documents

Publication Publication Date Title
JP6553822B2 (en) Dividing and moving ranges in distributed systems
US9251163B2 (en) File sharing system and file sharing method
KR101099199B1 (en) System and method for a snapshot query during database recovery
JP5652228B2 (en) Database server device, database update method, and database update program
US20170192863A1 (en) System and method of failover recovery
US20110082833A1 (en) Database parallel editing method
CN105144162B (en) Integrated data base frame
US8959052B2 (en) Database update control apparatus, database management system, and non-transitory computer-readable storage medium
US9998544B2 (en) Synchronization testing of active clustered servers
JP2022550049A (en) Data indexing method in storage engine, data indexing device, computer device and computer program
CN106407376B (en) Index reconstruction method and device
CN110795447A (en) Data processing method, data processing system, electronic device, and medium
KR20200092095A (en) Transaction control method to synchronize DML statements in relational database to NoSQL database
US8001098B2 (en) Database update management
CN113056734A (en) System and method for managing shared database
JP6008947B2 (en) Database management method, database system, and program
US9009098B1 (en) Methods and apparatus for creating a centralized data store
JP4951140B2 (en) How to manage the database
WO2009147846A1 (en) Conflict resolution system for database parallel editing
JP2009301352A (en) Test unit and test method
US10437813B2 (en) Self-healing of layer metadata within a layering system
US9015116B2 (en) Consistent replication of transactional updates
CN112328637B (en) High-speed distributed data caching method, device, computer equipment and storage medium
CN116821232A (en) Data synchronization method and related device
CN115113989A (en) Transaction execution method and device, computing equipment and storage medium