WO2012104907A1 - プログラムの実行性能評価のためのテストデータ生成方法 - Google Patents

プログラムの実行性能評価のためのテストデータ生成方法 Download PDF

Info

Publication number
WO2012104907A1
WO2012104907A1 PCT/JP2011/000556 JP2011000556W WO2012104907A1 WO 2012104907 A1 WO2012104907 A1 WO 2012104907A1 JP 2011000556 W JP2011000556 W JP 2011000556W WO 2012104907 A1 WO2012104907 A1 WO 2012104907A1
Authority
WO
WIPO (PCT)
Prior art keywords
source program
loop
test data
basic block
execution
Prior art date
Application number
PCT/JP2011/000556
Other languages
English (en)
French (fr)
Inventor
千代 英一郎
Original Assignee
株式会社日立製作所
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 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2011/000556 priority Critical patent/WO2012104907A1/ja
Priority to US13/880,464 priority patent/US9092577B2/en
Priority to JP2012555559A priority patent/JP5450840B2/ja
Publication of WO2012104907A1 publication Critical patent/WO2012104907A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3414Workload generation, e.g. scripts, playback
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/865Monitoring of software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/88Monitoring involving counting

Definitions

  • This relates to the generation of test data used when evaluating the execution performance of a program executed on a computer.
  • An evaluation of execution performance is one of the program test processes. This is done in order to confirm that the developed program can achieve the processing performance standards requested by customers during actual operation.
  • test data In order to accurately evaluate the performance of the program during actual operation, it is necessary to prepare test data similar to the data input during actual operation and execute the program using the test data. Therefore, a technique for generating test data for performance evaluation tests is required.
  • Patent Document 1 exists as a conventional technique for generating test data for performance evaluation. With this technique, test data can be generated by providing schema information and data generation rules of a database.
  • Patent Document 2 shows a method for generating a program used for generating test data for performance evaluation.
  • the first problem is that the user needs to specify a method for generating test data. Therefore, in order to generate test data so that the behavior of the performance evaluation target program is similar to that in actual operation, the user needs to investigate the source program and devise appropriate test data generation rules or patterns. .
  • the test data generation methods that can be specified are limited, there are cases where an appropriate test data generation method cannot be specified even if it is determined what test data should be generated.
  • the second problem is that the prior art is a technique for generating test data for a database and can only be used for performance evaluation of a database program.
  • a source program for performance evaluation, sample data, and generation parameters used to determine the size of generated test data are received from the input device.
  • the processor executes the source program using the sample data, and obtains the number of executions for each of a plurality of statements in the source program. Furthermore, the test data has a size that is twice the generation parameter of the sample data size, and the execution frequency of each of the plurality of statements in the source program corresponds to each of the plurality of portions when the source program is executed using the sample data. The processor generates test data that is the same as the execution frequency with respect to the number of executions acquired.
  • test data of any size that has commonality between sample data and execution characteristics simply by preparing small sample data reflecting the tendency of data input during actual operation. This can reduce the development man-hours required for program performance evaluation.
  • FIG. 1 is a diagram showing a configuration example of a computer system in which a test data generation apparatus operates.
  • the computer system includes a CPU 101, a main storage device 102, an external storage device 103, an output device 104 such as a display device, and an input device 105 such as a keyboard.
  • a source program 106, sample data 107, and a generation parameter 108 which are performance evaluation targets are input from an input device and stored.
  • An external storage device 103 in which the source program 106, sample data 107, and generation parameters 108 are stored may be connected to be accessible from the CPU 101 via an interface.
  • the main memory 102 holds a test data generation program 109, a compiler 110, a profiler 111, a program executor 112, an execution code 113, intermediate information 114, execution frequency information 115, and test data 116.
  • the test data generation process is performed by the CPU 101 executing software stored in the main storage device 102.
  • the keyboard 105 is used to give a command from the user to the test data generation program 109.
  • the display device 104 notifies the user of the end of test data generation.
  • Fig. 2 is a flowchart showing the flow of test data generation processing.
  • step 201 the CPU 101 executes the compiler 110, and as a result, the execution code 113 is generated from the source program 106.
  • step 201 the compiler first generates a basic block graph from the program.
  • a basic block graph is a graph having a basic block (a sequence of statements without a branch) as a node, and is generally used in a compiler to simplify the generation of executable code.
  • a method for generating a basic block graph is shown in Non-Patent Document 1.
  • the statements in the basic block are executed in order from the top, and after execution of all the statements, the subsequent basic block of that basic block (the basic block corresponding to the end point of the directed edge starting from that basic block) is executed. Move.
  • Fig. 13 shows an example of a basic block graph for the program (a) shown in Fig. 4.
  • Symbols such as B1 and B2 at the head in each node represent basic block numbers.
  • the numbers of the basic block B and the sentence numbers included in the basic block B are represented by ID (B) and STMT (B), respectively.
  • the compiler inserts a statement “printf (“ ID (B), ”);” that outputs the basic block number ID (B) as intermediate information 114 at the top of each basic block B.
  • the compiler displays the basic block number corresponding to the entry node of the basic block graph of the main function (B1 in FIG. 13), a sequence of the basic block numbers of all the basic blocks and the sentence numbers of the statements constituting the basic block. Is output as intermediate information 114.
  • the compiler generates the execution code 113 from the basic block graph in which the printf statement is inserted based on the processing of a normal compiler.
  • the execution code 113 when executed, the relationship between the basic block number and the corresponding sentence number column, and the executed basic block number column are recorded as the intermediate information 114.
  • the method shown here is an example of a method for acquiring execution frequency information, and has a feature that profile processing can be simplified.
  • step 202 the execution code 113 is executed on the sample data 107 by the program executor 112 to generate the intermediate information 114.
  • the sample data is input data described in a format that can be processed by the program.
  • An example of sample data is data (b) shown in FIG. This example includes three numerical data elements and a terminal symbol (-1) and can be processed by the program (a) shown in FIG.
  • FIG. 8 shows intermediate information 114 obtained by executing the execution code 113 obtained from the program (a) shown in FIG. 4 on the data (b) shown in FIG.
  • a sequence of basic block numbers and sentence numbers of the sentences making up the basic block is represented for each basic block number by delimiting with a “:” symbol.
  • the sentence number columns corresponding to the basic block number B13 are 13,14.
  • the last line is a column of executed basic block numbers. This indicates that the basic blocks are executed in the order described from the basic block number B1.
  • the profiler 111 generates the execution frequency information 115 from the intermediate information 114.
  • the execution frequency information is obtained by arranging the program statement numbers in the order in which the statements are executed.
  • An example of the execution frequency information is shown in FIG.
  • This example is execution frequency information 115 generated from intermediate information 114 obtained by executing execution code 113 obtained from program (a) shown in FIG. 4 on data (b) shown in FIG. is there.
  • the first five in the column are [1,2,3,7,8], which means that the program was executed in the order of statement 1, statement 2, statement 3, statement 7, and statement 8. Represents that.
  • the generation of the execution frequency information 115 is performed by replacing the sequence of basic block numbers recorded in the intermediate information 114 with the sequence of statement numbers of the sentences constituting each basic block.
  • the execution frequency information 115 in FIG. 5 is generated from the intermediate information 114 in FIG.
  • a general profiler has various statistical processing functions such as a function for displaying the number of executions of a function and a function for displaying the number of executions for each statement.
  • the present invention requires a statement execution order. It is only a function to obtain a column.
  • the test data generation program 109 generates test data 116 for performance evaluation from the source program 106, the generation parameter 108, and the execution frequency information 115.
  • the generation parameter is a parameter used to specify the size of the test data to be generated.
  • the test data generation program 109 generates test data having a size (size) that is twice the generation parameter of the sample data size.
  • FIG. 3 is a flowchart illustrating in detail the flow of processing performed by the CPU 101 executing the test data generation program 109 in step 204.
  • a set of all loops is obtained from the source program 106 (referred to as LS).
  • the loop is composed of a header that is a sentence for determining an end condition and a main body that is a set of sentences that perform repetition processing. Such information can be obtained using the loop analysis method of Non-Patent Document 1.
  • step 302 it is checked whether or not an unprocessed loop remains in the loop set LS. If it remains, the process proceeds to step 304, and one loop is extracted (the extracted loop is L, the L header is H, L Let the body be B).
  • step 305 the number of executions of B is obtained based on the execution frequency information 115 (assumed to be N).
  • step 306 based on the execution frequency information 115, all paths (program execution paths) in B and the number of times each path is executed are obtained.
  • Let PF be the set of paths and their number of executions.
  • the path in B can be obtained by taking out the partial sequence sandwiched by the loop header H from the execution frequency information 115, excluding the sentence other than B from each partial sequence, and further eliminating the duplication. For example, in the execution frequency information 115 of FIG.
  • step 307 the number of expansions is obtained as the product of the generation parameter and N (denoted as PN).
  • step 308 the variable X that holds the sentence string is initialized to empty.
  • step 309 it is determined whether the processing in steps 310 to 312 has been executed PN times (whether the repetition has reached PN times). If so, go to Step 313, otherwise go to Step 310.
  • step 310 H is duplicated, and the last iteration judgment sentence of the duplicated H is converted into an assert sentence that guarantees that the iteration is established, and added to the end of X.
  • step 311 select one path from PF (P).
  • the selection is made based on the number of executions of each pass. That is, a multiple set is created by duplicating each path of the PF as many times as the number of executions, and is randomly selected therefrom. For example, if PF includes three paths p1, p2, and p3, and the number of executions is 1, 2, and 3, respectively, create a multiple set ⁇ p1, p2, p2, p3, p3, p3 ⁇ Then, the elements are selected randomly from there. As a result, each path is selected in proportion to the number of executions.
  • step 312 duplicate P, convert the conditional branch statement in the duplicated P into an assert statement, and add it to the end of X.
  • step 313 L in the source program is replaced with X.
  • the result of replacement is PR. Thereafter, the process returns to step 302, and the process moves to an unprocessed loop.
  • step 314 input data that passes through all statements of X in PR is generated as test data.
  • the generation can be performed using the method of Non-Patent Document 2.
  • the generation method is based on the symbol execution method.
  • a condition for executing a specified path is obtained while a program is virtually executed using a logical expression expression of an execution state called a symbol state.
  • the symbol state is composed of memory contents (such as variable values) and path execution conditions.
  • the memory content in the initial state is a logical expression indicating that the value of a variable whose initial value is explicitly specified in the program is equal to the specified value, and the execution condition is true.
  • the state is updated based on the meaning of the sentence while sequentially processing the specified path (sentence string). For example, in the case of an assignment statement, a logical expression representing the value on the right side is calculated based on the current state, and the value on the left side is replaced with that expression.
  • a logical expression representing the content of the specified condition based on the current state is calculated and added to the execution condition.
  • the function defined in the program moves to the beginning of the function and continues execution. For a function defined outside the program, such as a function for obtaining input data, the result is expressed by introducing a new logical variable.
  • the final test data is a column in which the values of logical variables representing the results of the input data acquisition function are arranged in the order of appearance.
  • the input data has a structure and is composed of repetition of data elements and terminal symbols, and that there is a dependency determined by the structure of the program between the data elements.
  • the flow of program execution changes greatly between when the program is executed using test data generated by simply copying sample data and when the program is executed using sample data. Therefore, appropriate performance evaluation cannot be performed. Therefore, the use of test data generated by the method shown in FIGS. 2 and 3 is important for the performance evaluation of an appropriate program.
  • sentences (line numbers) 1 to 5 are loops that sequentially process input data.
  • sample data (b) in FIG. 4 ⁇ 1 is a terminal symbol indicating the end of data.
  • the execution frequency information 114 shown in FIG. 5 is generated as a result of step 203 in FIG.
  • test data is generated based on the structure of the source program.
  • step 301 a loop set is obtained from the source program.
  • ⁇ (2, [3,4,5]) ⁇ is obtained as the loop set LS.
  • the loop (2, [3,4,5]) which is an element of LS is composed of a set of a header 2 and a main body [3,4,5].
  • step 302 it is checked whether an unprocessed loop remains in the loop set LS, and the process proceeds to step 304, and one unprocessed loop is taken out.
  • (2, [3,4, 5]) is extracted as the loop L.
  • the header H is 2, and the main body B is [3,4,5].
  • step 305 the number of executions N of B is obtained based on the execution frequency information. Since the first sentence of B (statement 3) is always executed every time B is executed, the number of executions of B is equal to the number of executions of sentence 3. From the execution frequency information shown in FIG. 5, 3 should be obtained as N.
  • step 306 a set PF of a set of all paths in B and the number of executions thereof is obtained based on the execution frequency information. From the information in FIG. 5, ⁇ ([3,4,5], 2), ([3,5], 1) ⁇ is obtained as the PF.
  • ⁇ ([3,4,5], 2), ([3,5], 1) ⁇ is obtained as the PF.
  • step 307 the product PN of the generation parameter and N is obtained. Since the generation parameter (c) shown in FIG. 4 is now “2”, 6 is obtained as the PN.
  • step 308 L is expanded 6 times.
  • step 308 the variable X holding the sentence string is initialized to empty. Subsequently, steps 310 to 312 are repeated 6 times.
  • step 311 one path is selected from the PF based on the execution frequency of each path.
  • P [3,4,5] is selected as the path.
  • step 312 duplicate P, convert the conditional branch statement in P to an assert statement, and add it to the end of X.
  • step 313 L in the source program 106 is replaced with X.
  • the main function as a result of the replacement is shown in FIG.
  • Step 303 the process returns to Step 302, and since there is no unprocessed loop remaining in the LS, the process proceeds to Step 303.
  • step 303 input data that passes through all sentences corresponding to X in the program of FIG. 6 is generated as test data.
  • test data as shown in FIG. 7 can be obtained.
  • Explain that the test data in Fig. 7 reflects the trend of sample data.
  • the sample data (a) in Fig. 4 consists of three elements (1, 1, 2) and a terminal symbol (-1). If you run the program with this as input, the first element (1) and the third element (2) are inserted (insert () is called), but the second element (1) is already the same Not inserted because the value is inserted. That is, it contains data for which insert () is called and data for which it is not, in a ratio of 2: 1.
  • the first (3), third (4), fourth (5), and sixth (6) elements are inserted, and the second (3) And the fifth (3) element is not inserted. That is, like sample data, it contains data for which insert () is called and data that is not so at a ratio of 2: 1.
  • the sample data and the generated test data have the same execution frequency of the source program (that is, the ratio of the number of executions of the source program).
  • the sample data is simply duplicated and doubled, it will be duplicated to the terminal symbol -1, so the amount of data to be processed will not double. If the terminal symbol is specially processed manually, the data obtained is “1 1 2 1 1 2 ⁇ 1”. If the program is executed with this as input, the first (1), third (2) elements are inserted, and the second (1), fourth (1), fifth (1) and sixth (2) The element of is not inserted. That is, unlike the sample data, the data for which insert () is called and the data that is not so are included at a ratio of 1: 2, so the execution frequency is significantly different from the trend of the sample data. ------- Application 2 ------- The source program (a) shown in FIG. 4 used in Application Example 1 has only one input processing loop.
  • each sentence (execution instruction) in the source program (a) is indicated by using the line number of the source program (a) shown in FIG.
  • sentences (line numbers) 2 to 5 and 7 to 9 are loops for sequentially processing input data.
  • sample data (b) of FIG. 9 are markers indicating the end of data.
  • the execution frequency information shown in FIG. 10 is generated.
  • step 204 test data is generated based on the structure of the source program.
  • step 301 a loop set is obtained from the source program.
  • ⁇ (2, [3,4,5]), (7, [8,9]) ⁇ is obtained as the loop set LS.
  • the loops (2, [3,4, 5]) and (7, [8, 9]), which are elements of the LS, are a set of a header and a main body, respectively.
  • step 302 it is checked whether an unprocessed loop remains in the loop set LS, and the process proceeds to step 304, and one unprocessed loop is taken out.
  • (2, [3,4, 5]) is extracted as the loop L.
  • the header H is 2, and the main body B is [3,4,5].
  • step 305 to step 313 The processing from step 305 to step 313 is the same as in the first application example.
  • step 302 the process returns to step 302 to check whether an unprocessed loop remains in the LS.
  • the process proceeds to step 304, and one unprocessed loop is taken out.
  • (7, [8, 9]) is extracted as the loop L.
  • the header H is 7, and the main body B is [8, 9].
  • step 305 the number of executions N of B is obtained based on the execution frequency information. It should be possible to obtain 2 as N from the execution frequency information shown in FIG.
  • step 306 a set PF of a set of all paths in B and the number of executions thereof is obtained based on the execution frequency information. From the information shown in FIG. 5, ⁇ ([8,9], 2) ⁇ is obtained as the PF.
  • step 307 the product PN of the generation parameter and N is obtained. Since the generation parameter is now “2” from the information in FIG. 4C, 4 is obtained as the PN.
  • step 308 L is expanded 4 times.
  • step 308 the variable X holding the sentence string is initialized to empty. Subsequently, steps 310 to 312 are repeated 6 times.
  • step 311 one path is selected from the PF based on the execution frequency of each path.
  • P [8,9] is selected as the path.
  • step 312 duplicate P, convert the conditional branch statement in P to an assert statement, and add it to the end of X.
  • step 313 L in the source program 106 is replaced with X.
  • FIG. 11 shows the main function as a result of the replacement.
  • Step 303 the process returns to Step 302, and since there is no unprocessed loop remaining in the LS, the process proceeds to Step 303.
  • step 303 input data that passes through all statements corresponding to X in the program of FIG. 11 is generated as test data.
  • test data as shown in FIG. 12 is obtained.
  • this invention is not limited to the above-mentioned Example, Various modifications are included.
  • the above-described embodiments have been described in detail for easy understanding of the present invention, and are not necessarily limited to those having all the configurations described.
  • a part of the configuration of a certain embodiment can be replaced with another configuration, and another configuration can be added to the configuration of a certain embodiment.
  • each of the above-described configurations, functions, processing units, processing means, and the like may be realized by hardware by designing a part or all of them with, for example, an integrated circuit.
  • Each of the above-described configurations, functions, and the like may be realized by software by interpreting and executing a program that realizes each function by the processor.
  • Information such as programs and files for realizing each function can be stored in a memory, a hard disk, a recording device such as an SSD (Solid State Drive), or a recording medium such as an IC card, an SD card, or a DVD.

Abstract

プログラムの性能評価に用いられるテストデータを生成する。 まず性能評価対象のソースプログラムと、サンプルデータと、生成されるテストデータのサイズを決めるために用いられる生成パラメータとを入力装置から受け取る。そして、プロセッサがサンプルデータを用いてソースプログラムを実行し、当該ソースプログラム中の複数の文各々について、実行回数を取得する。更に、サンプルデータサイズの生成パラメータ倍のサイズを有するテストデータであって、ソースプログラム中の複数の文各々についての実行頻度が、サンプルデータを用いてソースプログラムを実行した際の当該複数の分各々についての実行頻度と同じとなるテストデータを、取得された実行回数に基いてプロセッサが生成する。

Description

プログラムの実行性能評価のためのテストデータ生成方法
 計算機で実行されるプログラムの実行性能を評価する際に用いられるテストデータの生成に関する。
 プログラムのテスト工程のひとつに実行性能の評価がある。これは開発したプログラムが、実稼動時に、顧客から要求された処理性能基準を達成できることを確認するために行われる。
 プログラムの実稼動時の実行性能を正確に評価するためには、実稼働時に入力されるデータと類似したテストデータを準備して、テストデータを用いてプログラムを実行する必要がある。そのため、性能評価テスト用のテストデータを生成する技術が求められている。
 性能評価用のテストデータを生成する従来技術として、特許文献1が存在する。この技術により、データベースのスキーマ情報およびデータ生成ルールを与えてテストデータを生成することができる。
 また特許文献2では、性能評価用のテストデータを生成するために用いられるプログラムを生成する方法を示している。 
特開2000-20529 特開2009-134662
Steven Muchnick。 Advanced Compiler Design and Implementation。 Morgan  Kaufmann、 pp。169-216、 1997。
Cristian Cadar、 Daniel Dunbar、 Dawson Engler。 Klee: Unassisted and Automatic Generation of High-Coverage Tests for Complex Systems Programs。 In Proceedings of Operating System Design and Implementation、 pp。209-224、 2008。
 従来技術の問題は2つある。第1の問題は、テストデータの生成方法をユーザが指定する必要がある点である。そのため、性能評価対象プログラムの振る舞いが実稼動時と類似したものになるようテストデータを生成するためには、ユーザがソースプログラムを調査し、適切なテストデータ生成ルールあるいはパターンを考案する必要がある。しかしながら、ソースプログラムからそのプログラムの振る舞いを把握し、テストデータ生成方法を考案するのは困難で時間のかかる作業である。また、指定できるテストデータの生成方法は限られているため、どのようなテストデータを生成すればよいかが判明しても、適切なテストデータの生成方法を指定できない場合もある。
 第2の問題は、従来技術がデータベース用のテストデータを生成する技術であり、データベース用プログラムの性能評価にしか利用できない点である。
 まず性能評価対象のソースプログラムと、サンプルデータと、生成されるテストデータのサイズを決めるために用いられる生成パラメータとを入力装置から受け取る。
 そして、プロセッサがサンプルデータを用いてソースプログラムを実行し、当該ソースプログラム中の複数の文各々について、実行回数を取得する。更に、サンプルデータサイズの生成パラメータ倍のサイズを有するテストデータであって、ソースプログラム中の複数の文各々についての実行頻度が、サンプルデータを用いてソースプログラムを実行した際の当該複数の分各々についての実行頻度と同じとなるテストデータを、取得された実行回数に基いてプロセッサが生成する。
 ユーザは、実稼働時に入力されるデータの傾向を反映した小規模のサンプルデータを用意するだけで、サンプルデータと実行特性に関する共通性を持つ任意の大きさのテストデータを得ることができる。これにより、プログラムの性能評価に要する開発工数を削減できる。
テストデータ生成装置が稼動する計算機システムの構成例を示す図である。 データ生成処理の一例を示す図である。 データ生成処理の詳細例を示す図である。 テストデータ生成プログラムの実行に用いられる入力データの一例を示す図である。 実行頻度情報の一例を示す図である。 ソースプログラムの展開例を示す図である。 テストデータ生成プログラムによって生成されるテストデータの一例を示す図である。 中間情報の例を示す図である。 テストデータ生成プログラムの実行に用いられる入力データの一例を示す図である。 実行頻度情報の一例を示す図である。 ソースプログラムの展開例を示す図である。 テストデータ生成プログラムによって生成されるテストデータの一例を示す図である。 基本ブロックグラフの一例を示す図である。 printf文挿入後の基本ブロックグラフの一例を示す図である。
 以下、図面を用いて発明の実施形態の一例を説明する。
 図1はテストデータ生成装置が稼動する計算機システムの構成例を示す図である。
 図示するように、計算機システムはCPU101、主記憶装置102、外部記憶装置103、ディスプレイ装置などの出力装置104、キーボードなどの入力装置105より構成されている。外部記憶装置103には性能評価対象であるソースプログラム106、サンプルデータ107、生成パラメータ108が、入力装置から入力されて格納される。ソースプログラム106、サンプルデータ107、生成パラメータ108が格納された外部記憶装置103がインタフェースを介してCPU101からアクセス可能に接続されても良い。主記憶装置102には、テストデータ生成プログラム109、コンパイラ110、プロファイラ111、プログラム実行器112、実行コード113、中間情報114、実行頻度情報115、テストデータ116が保持される。テストデータ生成処理はCPU101が主記憶装置102に格納されたソフトウェアを実行することにより行われる。キーボード105はユーザからのコマンドをテストデータ生成プログラム109に与えるのに用いる。ディスプレイ装置104はテストデータ生成の終了をユーザに知らせる。
 図2はテストデータ生成処理の流れを示したフローチャートである。
 最初にステップ201で、CPU101によりコンパイラ110が実行され、この結果ソースプログラム106から実行コード113が生成される。
 このステップ201においてコンパイラは、最初にプログラムから、基本ブロックグラフを生成する。基本ブロックグラフは基本ブロック(分岐のない文の列)をノードとするグラフであり、コンパイラにおいて、実行コードの生成を単純化するために一般的に用いられている。基本ブロックグラフの生成方法は非特許文献1に示されている。
 基本ブロック内の文は上から順に実行され、すべての文の実行終了後は、その基本ブロックの後続基本ブロック(その基本ブロックを始点とする有向エッジの終点に相当する基本ブロック)の実行に移る。
 図4に示すプログラム(a)に対する基本ブロックグラフの例を図13に示す。各ノード内の先頭のB1、B2等の記号は基本ブロック番号を表す。以降では、基本ブロックBの番号とそれに含まれる文番号の列をそれぞれID(B)、STMT(B)で表す。
 次にコンパイラは、各基本ブロックBの先頭に、その基本ブロックの番号ID(B)を中間情報114として出力する文「printf("ID(B),");」を挿入する。更にコンパイラは、main関数の基本ブロックグラフの入口ノードに相当する基本ブロック(図13ではB1)に、すべての基本ブロックの基本ブロック番号と、その基本ブロックを構成している文の文番号の列を中間情報114として出力する文「printf("ID(B1): STMT(B1)\n"); ...; printf("ID(Bn): STMT(Bn)\n\n";」を挿入する。図13の基本ブロックにこの処理を適用した結果を図14に示す。
 最後にコンパイラは、通常のコンパイラの処理にもとづいて、printf文が挿入された基本ブロックグラフから実行コード113を生成する。
 これにより、実行コード113が実行されたとき、基本ブロック番号と対応する文番号の列の関係、および実行された基本ブロック番号の列が中間情報114として記録される。なお、ここで示した方法は実行頻度情報を取得する方法の一例であり、プロファイル処理を単純化できるという特徴を持っている。
 次にステップ202で、プログラム実行器112により実行コード113をサンプルデータ107に対して実行し、中間情報114を生成する 。サンプルデータは、プログラムが処理可能な形式で記述した入力データである。サンプルデータの例としては図4に示すデータ(b)がある。この例は3つの数値データ要素および終端記号(-1)を含んでおり、図4に示すプログラム(a)で処理可能である。
 図4に示すプログラム(a)から得られた実行コード113を、図4に示すデータ(b)に対して実行して得られる中間情報114を図8に示す。基本ブロック番号とその基本ブロックを構成している文の文番号の列は、基本ブロック番号ごとに、「:」記号で区切って表される。たとえば、基本ブロック番号B13に対対応する文番号の列は13,14である。最終行は、実行された基本ブロック番号の列である。これは、基本ブロック番号B1から記された順に基本ブロックが実行が行われたことを表している。
 次にステップ203で、プロファイラ111により中間情報114から実行頻度情報115を生成する 。実行頻度情報は、プログラムの文番号をその文が実行された順に並べたものである。実行頻度情報の例を図5に示す。この例は図4に示すプログラム(a)から得られた実行コード113を、図4に示すデータ(b)に対して実行して得られた中間情報114から生成された、実行頻度情報115である。たとえば、列の最初の5つは[1,2,3,7,8]であるが、これは、プログラムの実行が文1、文2、文3、文7、文8の順に行われたことを表している。
 実行頻度情報115の生成は、中間情報114に記録されている基本ブロック番号の列を、各基本ブロックを構成している文の文番号の列に置き換えることで行う。この処理により、図8の中間情報114から図5の実行頻度情報115が生成される。なお、一般的なプロファイラは、関数の実行回数を表示する機能、文ごとにその実行回数を表示する機能等の各種の統計処理機能を備えているが、本発明に必要なのは、文の実行順序列を得る機能のみである。
 最後にステップ204で、テストデータ生成プログラム109によりソースプログラム106、生成パラメータ108、および実行頻度情報115から性能評価用のテストデータ116を生成する。ここで生成パラメータは、生成されるテストデータのサイズを指定するために用いられるパラメータである。具体的には、テストデータ生成プログラム109はサンプルデータサイズの生成パラメータ倍の大きさ(サイズ)を有するテストデータを生成する。
 図3は、ステップ204でCPU101がテストデータ生成プログラム109を実行することにより行う処理の流れを詳しく例示したフローチャートである。
 最初にステップ301で、ソースプログラム106から、すべてのループの集合を求める(LSとする)。ループは終了条件を判定する文であるヘッダおよび繰り返し処理を行う文の集合である本体によって構成される。これらの情報は、非特許文献1のループ解析方法を用いて求めることができる。
 次にステップ302で、ループ集合LSに未処理のループが残っているかを調べ、残っていれば、ステップ304へ進み、ひとつループを取り出す(取り出したループをL、LのヘッダをH、Lの本体をBとする)。
 次にステップ305で、実行頻度情報115をもとにBの実行回数を求める(Nとする)。 
 次にステップ306で、実行頻度情報115をもとにB内のすべてのパス(プログラムの実行経路)と各パスの実行回数を求める。パスとその実行回数の組の集合をPFとする。尚、B内のパスは、実行頻度情報115から、ループヘッダHではさまれた部分列を取り出し、各部分列からBの文以外を除き、さらに重複を除くことで得られる。たとえば図5の実行頻度情報115においては、ループヘッダである文2ではさまれた部分列は[3,7,8,12,4,13,14,5]、[3,7,8,9,10,5]、[3,7,8,9.11,8,9,11,8,12,4,13,14,5]の3つである。ここからBの文以外を除くと[3,4,5]、[3,5]、[3,4,5]となり、重複を除くと[3,4,5]および[3,5]の2つのパスが得られる。各パスの実行回数は上記で重複を除く前の出現回数となる。先ほどの例ではパス[3,4,5]の実行回数は2回、パス[3,5]の実行回数は1回となる。
 次にステップ307で、展開回数を生成パラメータとNの積として求める(PNとする)。
 次にステップ308~312で、LをPN倍に展開する。
 まずステップ308で、文列を保持する変数Xを空に初期化する。
 次に、ステップ309で、ステップ310~312の処理をPN回実行したか(繰り返しがPN回に到達したか)の判定を行う。到達していればステップ313へ、そうでなければステップ310へ進む。
 ステップ310で、Hを複製し、複製されたHの最後の繰り返し判定文を繰り返しが成立することを保証するassert文に変換した上で、Xの末尾に追加する。
 ステップ311で、PFのなかからパスを1つ選択する(Pとする)。選択は、各パスの実行回数にもとづいて行う。即ちPFの各パスをそれぞれ実行回数だけ複製した多重集合を作成し、そこからランダムに選択していく。たとえばPFが3つのパスp1、p2、p3を含んでおり、それぞれの実行回数が1回,2回,3回の場合、{p1, p2, p2, p3, p3, p3}という多重集合を作成し、そこから要素をランダムに選択していく。これにより、各パスが実行回数に比例した割合で選択される。
 ステップ312で、Pを複製し、複製されたP内の条件分岐文をassert文に変換した上で、Xの末尾に追加する。
 ステップ313では、ソースプログラム内のLをXに置き換える。置き換えた結果をPRとする。その後、ステップ302へ戻り、未処理のループの処理に移る。
 最後にステップ314で、PR内のXのすべての文を通るような入力データをテストデータとして生成する。生成は、非特許文献2の方法を用いて行うことができる 。生成方法は記号実行法にもとづくものである。記号実行法では、記号状態という実行状態の論理式表現を用いて、プログラムを仮想的に実行しながら、指定されたパスを実行するための条件を求める。記号状態は、メモリ内容(変数の値など)およびパスの実行条件で構成される。初期状態におけるメモリ内容はプログラム内で明示的に初期値が指定されている変数の値がその指定値に等しいことを表す論理式であり、実行条件は真である。
 記号実行法では、初期状態から開始し、指定されたパス(文の列)を順に処理しながら、文の意味にもとづいて状態を更新していく。たとえば、代入文の場合、現在の状態にもとづいて右辺の値を表す論理式を計算し、左辺の値をその式に置き換える。また、assert文の場合、パスの実行を継続するためにはassert文で指定された条件を満たす必要がある。そのため、現在の状態にもとづいて指定された条件の内容を表す論理式を計算し、実行条件に追加する。関数呼び出し文の場合、プログラム内部で定義されている関数については、その関数の先頭に移動し、実行を継続する。入力データを取得する関数のようにプログラム外部で定義されている関数については、その結果を新しい論理変数を導入して表現する。
 与えられたパスを最後まで実行した後、求めた実行条件を満たすために論理変数が取るべき値を計算する。これはSatisfiability Modulo Theories Solver等の制約解消系ツールを用いて計算することができる。最終的なテストデータは、入力データ取得関数の結果を表す論理変数の値を出現順に並べた列である。
 続いて、本実施例の適用例を具体的に示す。
 適用例の特徴は、入力データが構造を持っており、データ要素の繰り返しと終端記号によって構成されていること、およびデータ要素間にプログラムの構造によって決まる依存関係があることである。このような場合、単純にサンプルデータを複製して生成されたテストデータを用いてプログラムを実行した場合と、サンプルデータを用いてプログラムを実行した場合とではプログラムの実行の流れが大きく変化してしまうため、適切な性能評価を行うことができない。従って図2、3に示す方法で生成されるテストデータを用いることが、適切なプログラムの性能評価にとって重要となる。
 ------- 適用例1 -------
 本適用例では、入力データとして、図4に示すソースプログラム(a)、サンプルデータ(b)、および生成パラメータ(c)を用いる。
尚、本適用例では、ソースプログラム(a)の行番号を用いて、ソースプログラム内の各文(実行命令)を示す。
 図4のソースプログラム(a)において、文(行番号)1~5が入力データを順次処理するループである。図4のサンプルデータ(b)において、-1はデータの終了を表す終端記号である。
 上述の様に、図2のステップ203の結果、図5に示す実行頻度情報114が生成される。
 次にステップ204で、ソースプログラムの構造にもとづくテストデータ生成を行う。
 ステップ204を詳しく説明した図3に従って説明すると、最初にステップ301で、ソースプログラムからループ集合を求める。ループ解析の結果、ループ集合LSとして{ (2, [3,4,5]) }が得られる。ここで、LSの要素であるループ(2, [3,4,5])はヘッダ2と本体[3,4,5]の組で構成されている。
 次にステップ302で、ループ集合LSに未処理のループが残っているか調べ、ステップ304へ進み、未処理のループをひとつ取り出す。ここではループLとして(2,[3,4,5])が取り出される。ヘッダHは2、本体Bは[3,4,5]となる。
 次にステップ305で、実行頻度情報をもとにBの実行回数Nを求める。Bの最初の文(文3)はBを実行するたびに必ず実行されるため、Bの実行回数は文3の実行回数に等しくなる。図5に示す実行頻度情報から、Nとして3が得られる 。
 次にステップ306で、実行頻度情報をもとにB内のすべてのパスとその実行回数の組の集合PFを求める。図5の情報から、PFとして{ ([3,4,5],2), ([3,5],1) }が得られる。ここで、[]内に記載されているが各行番号で示す分を通過するパスであり、()内に[]の後に記載されている数字が当該パスの実行回数である。
 次にステップ307で、生成パラメータとNの積PNを求める。図4に示す生成パラメータ(c)は今“2”であるので、PNとして6が得られる。
 次にステップ308~312で、Lを6倍に展開する。ステップ308で、文列を保持する変数Xを空に初期化する。続いてステップ310~312を6回繰り返す。
 ステップ310で、H(2)を複製し、繰り返し判定文である文2を繰り返しが成立することを保証するassert文に変換しXの末尾に追加する。これによりXは[assert(x != -1)]となる。
 ステップ311で、PFのなかから各パスの実行頻度にもとづいてパスを1つ選択する。ここではパスとしてP = [3,4,5]が選択されたとする。
 ステップ312で、Pを複製し、P内の条件分岐文をassert文に変換した上で、Xの末尾に追加する。これによりXは[assert(x != -1), assert(!find(x)), insert(x), x = in()]となる。
 以後、同様に処理を進めることで、ステップ310~312の繰り返し終了時にはXは[assert(x != -1), assert(!find(x)), insert(x), x = in(), assert(x != -1), assert(find(x)), x = in(), assert(x != -1), assert(!find(x)), insert(x), x = in(), assert(x != -1), assert(!find(x)), insert(x), x = in(), assert(x != -1), assert(find(x)), x = in(), assert(x != -1), assert(!find(x)), insert(x), x = in(), assert(x == -1)]となる。
 次にステップ313で、ソースプログラム106内のLをXに置き換える。置き換えた結果のmain関数を図6に示す。
 次にステップ302へ戻り、LSに残っている未処理ループがないため、ステップ303へ進む。
 最後にステップ303で、図6のプログラムのXに対応するすべての文を通るような入力データをテストデータとして生成する。非特許文献2の方法を用いることで、図7のようなテストデータが得られる。 図7のテストデータが、サンプルデータの傾向を反映していることを説明する。
 図4のサンプルデータ(a)は、3つの要素(1, 1, 2)と終端記号(-1)によって構成されている。これを入力としてプログラムを実行した場合、1番目の要素(1)および3番目の要素(2)は挿入される(insert()が呼び出される)が、2番目の要素(1)は、すでに同じ値が挿入されているため挿入されない。すなわちinsert()が呼び出されるデータとそうでないデータを2:1の割合で含んでいる。
 生成した図7のテストデータを入力としてプログラムを実行した場合、1番目(3)、3番目(4)、4番目(5)、6番目(6)の要素が挿入され、2番目(3)および5番目(3)の要素は挿入されない。すなわちサンプルデータと同じように、insert()が呼び出されるデータとそうでないデータを2:1の割合で含んでいる。この様に、サンプルデータと生成されたテストデータとでは、ソースプログラムの各分の実行頻度(即ちソースプログラムの各分の実行回数の比)が同じに保たれていることが分かる。
 これに対して単純にサンプルデータを複製して2倍にした場合、終端記号である-1まで複製されてしまうため、処理されるデータの量が2倍にならない。仮に、終端記号を人手によって特別に処理した場合、得られるデータは「1 1 2 1 1 2 -1」となる。これを入力としてプログラムを実行した場合、1番目(1)、3番目(2)の要素が挿入され、2番目(1)、4番目(1)、5番目(1)および6番目(2)の要素は挿入されない。すなわちサンプルデータと異なり、insert()が呼び出されるデータとそうでないデータを1:2の割合で含んでいるため、実行頻度はサンプルデータの傾向とは大きく異なったものになってしまう。 ------- 適用例2 -------
 適用例1で使用した図4に示すソースプログラム(a)は入力処理ループが1つしか存在しなかった。そこで適用例2として、入力処理ループが複数存在する場合を示す。本適用例では、入力データとして、図9に示すソースプログラム(a)、 サンプルデータ(b)、および生成パラメータ(c)を用いる。尚、本適用例では、図9に示すソースプログラム(a)の行番号を用いて、ソースプログラム(a)内の各文(実行命令)を示す。
 図9のソースプログラム(a)において、文(行番号)2~5および7~9が入力データを順次処理するループである。図9のサンプルデータ(b)において、-1および-2はデータの終了を表すマーカーである。
  図2のステップ203の結果、図10に示す実行頻度情報が生成される。 
 次にステップ204で、ソースプログラムの構造にもとづくテストデータ生成を行う。
 ステップ204を詳しく説明した図3に従って説明すると、最初にステップ301で、ソースプログラムからループ集合を求める。ループ解析の結果、ループ集合LSとして{ (2, [3,4,5]), (7, [8,9]) }が得られる。ここで、LSの要素であるループ(2, [3,4,5])および(7, [8,9])は各々ヘッダと本体の組である。
 次にステップ302で、ループ集合LSに未処理のループが残っているか調べ、ステップ304へ進み、未処理のループをひとつ取り出す。ここではループLとして(2,[3,4,5])が取り出される。ヘッダHは2、本体Bは[3,4,5]となる。
 ステップ305からステップ313までの処理は先ほどの適用例1と同じである。
 次にステップ302へ戻り、LSに未処理のループが残っているかを調べ、ステップ304へ進み、未処理のループをひとつ取り出す。ここではループLとして(7,[8,9])が取り出される。ヘッダHは7、本体Bは[8,9]となる。
 次にステップ305で、実行頻度情報をもとにBの実行回数Nを求める。図5に示す実行頻度情報から、Nとして2が得られる 。
 次にステップ306で、実行頻度情報をもとにB内のすべてのパスとその実行回数の組の集合PFを求める。図5の情報から、PFとして{ ([8,9],2) }が得られる。
 次にステップ307で、生成パラメータとNの積PNを求める。図4(c)の情報から生成パラメータは今“2”であるので、PNとして4が得られる。
 次にステップ308~312で、Lを4倍に展開する。ステップ308で、文列を保持する変数Xを空に初期化する。続いてステップ310~312を6回繰り返す。
 ステップ310で、H(2)を複製し、繰り返し判定文である文7を繰り返しが成立することを保証するassert文に変換しXの末尾に追加する。これによりXは[assert(z != -2)]となる。
 ステップ311で、PFのなかから各パスの実行頻度にもとづいてパスを1つ選択する。パスとしてP = [8,9]が選択される。
 ステップ312で、Pを複製し、P内の条件分岐文をassert文に変換した上で、Xの末尾に追加する。これによりXは[assert(z != -2), insert(z), z = in()]となる。
 以後、同様に処理を進めることで、ステップ310~312の繰り返し終了時にはXは[assert(z != -2), insert(z), z = in(), assert(z != -2), insert(z), z = in(), assert(z != -2), insert(z), z = in(), assert(z != 2), insert(z), z = in(), assert(z == -2)]となる。
 次にステップ313で、ソースプログラム106内のLをXに置き換える。置き換えた結果のmain関数を図11に示す。
 次にステップ302へ戻り、LSに残っている未処理ループがないため、ステップ303へ進む。
 最後にステップ303で、図11のプログラムのXに対応するすべての文を通るような入力データをテストデータとして生成する。非特許文献2の方法を用いることで、図12のようなテストデータが得られる。
 なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。たとえば、上記した実施例は本発明をわかりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の構成に置き換えることが可能であり、また、ある実施例の構成に他の構成を加えることも可能である。また、実施例の構成の一部について、他の構成の追加・削除・置換をすることが可能である。
 また、上記の各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、ICカード、SDカード、DVD等の記録媒体に置くことができる。
101 CPU
102 主記憶装置
103 外部記憶装置
104 ディスプレイ装置
105 キーボード
106 ソースプログラム
107 サンプルデータ
108 生成パラメータ
109 テストデータ生成プログラム
110 コンパイラ
111 プロファイラ
112 プログラム実行器
113 中間情報
114 実行頻度情報

Claims (12)

  1.  プログラムの性能評価に用いられるテストデータを生成する方法であって、
     性能評価対象のソースプログラムと、サンプルデータと、生成されるテストデータのサイズを決めるために用いられる生成パラメータとを入力装置から受け取る入力ステップと、
     プロセッサが前記サンプルデータを用いて前記ソースプログラムを実行し、当該ソースプログラム中の複数の文各々について、実行回数を取得する実行回数取得ステップと、
     前記サンプルデータのサイズの前記生成パラメータ倍のサイズを有するテストデータであって、前記ソースプログラム中の前記複数の文各々についての実行頻度が、前記サンプルデータを用いて前記ソースプログラムを実行した際の当該複数の分各々についての実行頻度と同じとなるテストデータを、取得された前記実行回数に基いて前記プロセッサが生成するテストデータ生成ステップとを有することを特徴とするテストデータ生成方法。
  2.  請求項1記載のテストデータ生成方法であって、前記実行頻度とは、前記ソースプログラムの各文の実行回数の比であることを特徴とするテストデータ生成方法。
  3.  請求項1記載のテストデータ生成方法であって、
     前記実行回数取得ステップは、
     前記ソースプログラムから当該ソースプログラムを構成する複数の基本ブロックを有する基本ブロックグラフを生成するステップと、
     前記複数の基本ブロックの各々について当該基本ブロックの基本ブロック番号と当該基本ブロックに含まれる一以上の文各々の文番号とを出力するための第一の命令を前記基本ブロックグラフに挿入するステップと、
     前記複数の基本ブロックの各々について、当該基本ブロック中に当該基本ブロックの基本ブロック番号を出力するための第二の命令を挿入するステップと、
     前記第一の命令および一以上の前記第二の命令が挿入された基本ブロックグラフをコンパイルして実行コードを生成するステップと、
     前記サンプルデータを用いて前記実行コードを実行することにより、前記第一の命令および一以上の前記第二の命令によって出力される情報を中間情報として得るステップと、
     前記中間情報から、前記ソースプログラム中の複数の文各々についての、前記実行回数を取得するステップを有することを特徴とするテストデータ生成方法。
  4.  請求項3記載のテストデータ生成方法であって、
     前記テストデータ生成ステップは、
     前記ソースプログラムをループ解析して、当該ソースプログラムに含まれる一以上のループを抽出するループ解析ステップと、
     前記実行回数に基いて、前記一以上のループ各々について、当該ループの実行回数であるループ実行回数を取得するステップと、
     前記一以上のループ各々について、当該ループ内のプログラム実行経路である一以上のパスと当該パスの実行回数であるパス実行回数を取得するステップと、
     前記一以上のループ各々について、当該ループを前記生成パラメータと当該ループのループ実行回数の積の値倍に展開するループ展開ステップと、
     ループ展開後のソースプログラムに含まれる全ての文を通るような入力データを生成するデータ生成ステップとを有することを特徴とするテストデータ生成方法。
  5.  請求項4記載のテストデータ生成方法であって、
     前記データ生成ステップは、記号実行法を用いて前記ループ展開後のソースプログラムに含まれる全ての文を通るような入力データを生成することを特徴とするテストデータ生成方法。
  6.  請求項4記載のテストデータ生成方法であって、
     前記ループ展開ステップは、前記一以上のループ各々について、当該ループに含まれる各パスのパス実行回数に基いて、当該ループを展開することを特徴とするテストデータ生成方法。
  7.  プログラムの性能評価に用いられるテストデータを生成するための計算機であって、
     性能評価対象のソースプログラムと、サンプルデータと、生成されるテストデータのサイズを決めるために用いられる生成パラメータとを受け付ける入力装置と、
     前記サンプルデータを用いて前記ソースプログラムを実行し、当該ソースプログラム中の複数の文各々について、実行回数を取得する実行回数取得ステップと、
     前記サンプルデータのサイズの前記生成パラメータ倍のサイズを有するテストデータであって、前記ソースプログラム中の前記複数の文各々についての実行頻度が、前記サンプルデータを用いて前記ソースプログラムを実行した際の当該複数の分各々についての実行頻度と同じとなるテストデータを、取得された前記実行回数に基いて生成するテストデータ生成ステップとを実行するプロセッサを有する計算機。
  8.  請求項7記載の計算機であって、
     前記実行回数取得ステップにおいて前記プロセッサは、
     前記ソースプログラムから当該ソースプログラムを構成する複数の基本ブロックを有する基本ブロックグラフを生成し、
     前記複数の基本ブロックの各々について当該基本ブロックの基本ブロック番号と当該基本ブロックに含まれる一以上の文各々の文番号とを出力するための第一の命令を前記基本ブロックグラフに挿入し、
     前記複数の基本ブロックの各々について、当該基本ブロック中に当該基本ブロックの基本ブロック番号を出力するための第二の命令を挿入し、
     前記第一の命令および一以上の前記第二の命令が挿入された基本ブロックグラフをコンパイルして実行コードを生成し、
     前記サンプルデータを用いて前記実行コードを実行することにより、前記第一の命令および一以上の前記第二の命令によって出力される情報を中間情報として取得し、
     前記中間情報から、前記ソースプログラム中の複数の文各々についての、前記実行回数を取得することを特徴とする計算機。
  9.  請求項8記載の計算機であって、
     前記テストデータ生成ステップにおいて前記プロセッサは、
     前記ソースプログラムをループ解析して、当該ソースプログラムに含まれる一以上のループを抽出し、
     前記実行回数に基いて、前記一以上のループ各々について、当該ループの実行回数であるループ実行回数を取得し、
     前記一以上のループ各々について、当該ループ内のプログラム実行経路である一以上のパスと当該パスの実行回数であるパス実行回数を取得し、
     前記一以上のループ各々について、当該ループに含まれる各パスのパス実行回数に基いて、前記生成パラメータと当該ループのループ実行回数の積の値倍に当該ループを展開し、
     ループ展開後のソースプログラムに含まれる全ての文を通るような入力データを生成することを特徴とする計算機。
  10.  プログラムの性能評価に用いられるテストデータを生成するたに計算機で実行されるプログラムを記録した記録媒体であって、
     性能評価対象のソースプログラムと、サンプルデータと、生成されるテストデータのサイズを決めるために用いられる生成パラメータとを受け付けるためのコードと、
     前記サンプルデータを用いて前記ソースプログラムを実行し、当該ソースプログラム中の複数の文各々について、実行回数を取得する実行回数取得ステップを実行するためのコードと、
     前記サンプルデータのサイズの前記生成パラメータ倍のサイズを有するテストデータであって、前記ソースプログラム中の前記複数の文各々についての実行頻度が、前記サンプルデータを用いて前記ソースプログラムを実行した際の当該複数の分各々についての実行頻度と同じとなるテストデータを、取得された前記実行回数に基いて生成するテストデータ生成ステップを実行するためのコードとを有するプログラムを記録した記録媒体。
  11.  請求項10記載の記録媒体であって、
     前記実行回数取得ステップを実行するためのコードは、
     前記ソースプログラムから当該ソースプログラムを構成する複数の基本ブロックを有する基本ブロックグラフを生成し、
     前記複数の基本ブロックの各々について当該基本ブロックの基本ブロック番号と当該基本ブロックに含まれる一以上の文各々の文番号とを出力するための第一の命令を前記基本ブロックグラフに挿入し、
     前記複数の基本ブロックの各々について、当該基本ブロック中に当該基本ブロックの基本ブロック番号を出力するための第二の命令を挿入し、
     前記第一の命令および一以上の前記第二の命令が挿入された基本ブロックグラフをコンパイルして実行コードを生成し、
     前記サンプルデータを用いて前記実行コードを実行することにより、前記第一の命令および一以上の前記第二の命令によって出力される情報を中間情報として取得し、
     前記中間情報から、前記ソースプログラム中の複数の文各々についての、前記実行回数を取得するためのコードを有することを特徴とする記録媒体。
  12.  請求項11記載の記録媒体であって、
     前記テストデータ生成ステップを実行するためにおいて前記プロセッサは、
     前記ソースプログラムをループ解析して、当該ソースプログラムに含まれる一以上のループを抽出し、
     前記実行回数に基いて、前記一以上のループ各々について、当該ループの実行回数であるループ実行回数を取得し、
     前記一以上のループ各々について、当該ループ内のプログラム実行経路である一以上のパスと当該パスの実行回数であるパス実行回数を取得し、
     前記一以上のループ各々について、当該ループに含まれる各パスのパス実行回数に基いて、前記生成パラメータと当該ループのループ実行回数の積の値倍に当該ループを展開し、
     ループ展開後のソースプログラムに含まれる全ての文を通るような入力データを生成するためのコードを有することを特徴とする記録媒体。
PCT/JP2011/000556 2011-02-02 2011-02-02 プログラムの実行性能評価のためのテストデータ生成方法 WO2012104907A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2011/000556 WO2012104907A1 (ja) 2011-02-02 2011-02-02 プログラムの実行性能評価のためのテストデータ生成方法
US13/880,464 US9092577B2 (en) 2011-02-02 2011-02-02 Method for generating test data for evaluating program execution performance
JP2012555559A JP5450840B2 (ja) 2011-02-02 2011-02-02 プログラムの実行性能評価のためのテストデータ生成方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2011/000556 WO2012104907A1 (ja) 2011-02-02 2011-02-02 プログラムの実行性能評価のためのテストデータ生成方法

Publications (1)

Publication Number Publication Date
WO2012104907A1 true WO2012104907A1 (ja) 2012-08-09

Family

ID=46602161

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/000556 WO2012104907A1 (ja) 2011-02-02 2011-02-02 プログラムの実行性能評価のためのテストデータ生成方法

Country Status (3)

Country Link
US (1) US9092577B2 (ja)
JP (1) JP5450840B2 (ja)
WO (1) WO2012104907A1 (ja)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103218297A (zh) * 2013-05-15 2013-07-24 百度在线网络技术(北京)有限公司 测试数据的筛选方法及装置
JP2015153323A (ja) * 2014-02-18 2015-08-24 富士通株式会社 シンボリック実行プログラム、シンボリック実行方法及びシンボリック実行装置
JP2017500646A (ja) * 2013-12-18 2017-01-05 アビニシオ テクノロジー エルエルシー データ生成
CN110659208A (zh) * 2019-09-17 2020-01-07 北京声智科技有限公司 测试数据集的更新方法和装置

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9336115B1 (en) * 2014-02-24 2016-05-10 The Mathworks, Inc. User interface driven real-time performance evaluation of program code
US9916187B2 (en) 2014-10-27 2018-03-13 Oracle International Corporation Graph database system that dynamically compiles and executes custom graph analytic programs written in high-level, imperative programming language
US10506016B2 (en) 2016-05-19 2019-12-10 Oracle International Corporation Graph analytic engine that implements efficient transparent remote access over representational state transfer
US11907099B2 (en) 2020-09-22 2024-02-20 International Business Machines Corporation Performance evaluation method using simulated probe data mapping

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03244043A (ja) * 1990-02-21 1991-10-30 Nec Corp テストデータ生成装置
JPH09259006A (ja) * 1996-03-26 1997-10-03 Mitsubishi Electric Corp プログラム評価システム

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6173440B1 (en) * 1998-05-27 2001-01-09 Mcdonnell Douglas Corporation Method and apparatus for debugging, verifying and validating computer software
JP3366257B2 (ja) 1998-07-07 2003-01-14 エヌイーシーシステムテクノロジー株式会社 データウェアハウステストデータ作成装置
US6959431B1 (en) * 1999-05-13 2005-10-25 Compuware Corporation System and method to measure and report on effectiveness of software program testing
JP2003216454A (ja) * 2002-01-28 2003-07-31 Mitsubishi Electric Corp 試験手順生成装置及び試験手順生成方法及び試験手順生成プログラム及び記録媒体
US7290048B1 (en) * 2002-03-29 2007-10-30 Hyperformix, Inc. Method of semi-automatic data collection, data analysis, and model generation for the performance analysis of enterprise applications
US7873945B2 (en) * 2007-06-29 2011-01-18 Microsoft Corporation Automatically generating test cases for binary code
US8473915B2 (en) * 2007-08-03 2013-06-25 International Business Machines Corporation Coverage analysis tool for testing database-aware software applications
JP2009134662A (ja) 2007-12-03 2009-06-18 Hitachi Ltd 性能テストデータ構築ツール

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03244043A (ja) * 1990-02-21 1991-10-30 Nec Corp テストデータ生成装置
JPH09259006A (ja) * 1996-03-26 1997-10-03 Mitsubishi Electric Corp プログラム評価システム

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103218297A (zh) * 2013-05-15 2013-07-24 百度在线网络技术(北京)有限公司 测试数据的筛选方法及装置
CN103218297B (zh) * 2013-05-15 2018-05-04 百度在线网络技术(北京)有限公司 测试数据的筛选方法及装置
JP2017500646A (ja) * 2013-12-18 2017-01-05 アビニシオ テクノロジー エルエルシー データ生成
US10185641B2 (en) 2013-12-18 2019-01-22 Ab Initio Technology Llc Data generation
US10437701B2 (en) 2013-12-18 2019-10-08 Ab Initio Technology Llc Data generation
JP2015153323A (ja) * 2014-02-18 2015-08-24 富士通株式会社 シンボリック実行プログラム、シンボリック実行方法及びシンボリック実行装置
CN110659208A (zh) * 2019-09-17 2020-01-07 北京声智科技有限公司 测试数据集的更新方法和装置

Also Published As

Publication number Publication date
US9092577B2 (en) 2015-07-28
US20130305095A1 (en) 2013-11-14
JP5450840B2 (ja) 2014-03-26
JPWO2012104907A1 (ja) 2014-07-03

Similar Documents

Publication Publication Date Title
JP5450840B2 (ja) プログラムの実行性能評価のためのテストデータ生成方法
JP2007528059A (ja) ソフトウェアのモデル化、抽象、および分析のためのシステムと方法
US20130318504A1 (en) Execution Breakpoints in an Integrated Development Environment for Debugging Dataflow Progrrams
US9524366B1 (en) Annotations to identify objects in design generated by high level synthesis (HLS)
US7523029B2 (en) Logic verification and logic cone extraction technique
US9626468B2 (en) Assertion extraction from design and its signal traces
US10592703B1 (en) Method and system for processing verification tests for testing a design under test
Jaffar et al. A path-sensitively sliced control flow graph
JP2010267209A (ja) 検証支援プログラム、検証支援装置および検証支援方法
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test
JP6790921B2 (ja) プログラム分析装置、プログラム分析方法及びプログラム分析プログラム
DeOrio et al. Inferno: Streamlining verification with inferred semantics
JP2013065258A (ja) 情報処理装置、情報処理方法及び情報処理プログラム
JP6002507B2 (ja) ソフトウェア検証用プログラムおよびソフトウェア検証システム
JP6437396B2 (ja) トレース情報管理システム、方法、及びプログラム
JP5120103B2 (ja) デバッグ方法およびデバッグプログラム
JP6279750B2 (ja) ソースコード等価性検証装置
JP6081144B2 (ja) ソースコード解析装置
Thacker et al. A new verification method for embedded systems
JP5875607B2 (ja) 性能モデル検査装置、方法およびプログラム
Saddler et al. EventFlowSlicer: Goal based test generation for graphical user interfaces
JP2015069400A (ja) ソフトウェアテストシステム
KR20120009991A (ko) 테스트 스윗 생성 장치 및 방법
JP2018190219A (ja) ソフトウェア仕様分析装置、及びソフトウェア仕様分析方法
GB2539961A (en) Code hotspot encapsulation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11857785

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2012555559

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 13880464

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11857785

Country of ref document: EP

Kind code of ref document: A1