Test case generation device, and test case generation method

JP2024147158A5Pending Publication Date: 2026-02-24HITACHI LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023059995
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing methods for generating test cases using the Pairwise method struggle to handle array-type factors, leading to inefficiencies in discovering defects that occur only when arrays have multiple elements.

Method used

A test case generation device and method that includes a factor level generation unit to handle array-type factors by generating factors and levels for each element, and a pairwise generation unit to create test cases covering specified coverage levels, even for software with variable array sizes.

Benefits of technology

Enables the automatic generation of test cases that comprehensively cover specifications, including array-type factors, reducing the number of test cases required to detect defects effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To provide a test case generation device and a test case generation method for automatically generating a test case that widely covers specifications even over software including array type elements.SOLUTION: A test case generation device includes a first generation part (a factor standard generation part 300) for generating factors of a software test and their standard, and a second generation part (a Pairwise generation part 500) for selecting factors from the generated factors and their standard to generate a test case about a combination of respective standard belonging to each selected factor. The first generation part generates factor standard information 400 corresponding to the number of respective array elements by generating factors of each element and their standard about an array type factor having the prescribed number of elements. The second generation part generates a test case 800 of n factor coverages of a coverage degree n set in generation parameter setting information 12 by a Pairwise method on the basis of the factor standard information 400.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a test case generation device and a test case generation method. [Background technology]

[0002] In order to find software defects and improve its quality, it is necessary to verify the software by conducting tests on it. As the number of software test cases increases, the time and computing resources required to conduct the tests also increase, so it is desirable to prepare test cases that can find defects efficiently with a small number of cases. However, when there are multiple factors that make up a test case, there is a problem that the number of test cases increases exponentially if test cases are generated that cover all combinations of the level values ​​that the factors can take.

[0003] To solve such problems, the Pairwise method (All-Pair method) is known as a technique for generating test cases that efficiently find defects. A method for generating test cases using the Pairwise method is disclosed in Patent Document 1.

[0004] The Pairwise method is a technique for generating test cases with n-factor coverage for a specified coverage level n. n-factor coverage means that the generated test cases execute tests at least once for each level of n factors included in any combination of n factors of the factors to be verified.

[0005] By conducting testing using test cases generated by the Pairwise method, it is possible to reduce the number of test cases compared to generating test cases that cover all combinations of factors, and it is also possible to discover defects that only occur when multiple factors are combined.

[0006] Non-Patent Document 1 discloses a technique for automatically generating test cases using the Pairwise method (referred to as Covering Array in Non-Patent Document 1) from an interface specification described using OpenAPI, which is one of the specification description languages ​​for APIs (Application Programming Interfaces). Non-Patent Document 1 discloses that the Pairwise method is used to generate test cases that efficiently cover all combinations of WebAPI parameters defined in the interface specification. [Prior art documents] [Patent documents]

[0007] [Patent Document 1] Patent No. 2882687 [Non-patent literature]

[0008] [Non-Patent Document 1] Huayao Wu, Lixin Xu, Changhai Nie, “Combinatorial testing of RESTful APIs”, Proceedings of 44th International Conference on Software Engineering, May 2022, pp.426-437. Summary of the Invention [Problem to be solved by the invention]

[0009] The generation method using the Pairwise method disclosed in Patent Document 1 is based on the premise that the data type of each factor is a primitive type such as a numeric type, a string type, or an enumeration type, and has the problem that it cannot handle array-type factors with an arbitrary number of elements.

[0010] In the technology disclosed in Non-Patent Document 1, factors used in the Pairwise method are extracted from an interface specification described in OpenAPI. In OpenAPI, it is possible to specify an array type. In the method disclosed in Non-Patent Document 1, the Pairwise method is applied to factors specified as an array type in the same manner as when they are specified as a primitive type, and a test case is generated as an array with one element. Therefore, when test cases are generated by the method disclosed in Non-Patent Document 1, there is a problem that it is not possible to find defects that occur only when an array has multiple elements.

[0011] The present invention has been made in consideration of the above circumstances, and an object of the present invention is to provide a test case generation device and a test case generation method that are capable of automatically generating test cases that widely cover specifications, even for software that includes array-type factors. [Means for solving the problem]

[0012] One of the present inventions for solving the above problems is a test case generation device comprising: a first generation unit having a processor and a memory, and generating factors and their levels for software testing; and a second generation unit selecting factors from the generated factors and their levels, and generating test cases for combinations of levels of each selected factor, wherein the first generation unit generates factors and their levels for each element for an array-type factor having a predetermined number of elements. Effect of the Invention

[0013] According to the present invention, test cases that widely cover specifications can be automatically generated even for software that includes factors with a variable number of elements. Configurations and effects other than those described above will become apparent from the following description of the embodiments. [Brief description of the drawings]

[0014] [Figure 1]1 is a diagram illustrating an example of the configuration of a test case generation device according to a first exemplary embodiment of the present invention. [Diagram 2] FIG. 4 is a diagram illustrating an example of software specification information. [Diagram 3] FIG. 11 is a diagram illustrating an example of generation parameter setting information. [Figure 4] 2 is a diagram illustrating a flow of processing performed by the test case generation device in the first embodiment of the present invention. FIG. [Diagram 5] FIG. 2 is a diagram for explaining a method for generating factor level information in the first embodiment of the present invention. [Figure 6] FIG. 2 is a diagram illustrating an example of a test case generated by the test case generation device in the first exemplary embodiment of the present invention. [Figure 7] FIG. 11 is a diagram illustrating an example of the configuration of a test case generation device according to a second exemplary embodiment of the present invention. [Figure 8] FIG. 11 is a diagram illustrating a flow of processing performed by a test case generation device in the second embodiment of the present invention. [Figure 9] FIG. 11 is a diagram for explaining a method for generating information on levels of factors outside an array and information on levels of factors within an array in the second embodiment of the present invention. [Figure 10] 13 is a flowchart illustrating an example of an external array factor level generation process executed by an external array factor level generation unit. [Figure 11] 13 is a flowchart illustrating an example of an intra-array factor level generation process executed by an intra-array factor level generation unit. [Figure 12] 11 is a flowchart illustrating an example of a test case synthesis process executed by a test case synthesis unit. [Figure 13] FIG. 11 is a diagram for explaining a method of synthesizing an internal test case with an external test case. [Figure 14] 11 is a graph comparing the number of test cases generated using a first method disclosed in the first embodiment and a second method disclosed in the second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0015] Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. The following description and drawings are examples for explaining the present invention, and appropriate omissions and simplifications are made for clarity of explanation. The present invention can be implemented in various other forms. Unless otherwise specified, each component may be singular or plural. In order to facilitate understanding of the invention, the position, size, shape, range, etc. of each component shown in the drawings may not represent the actual position, size, shape, range, etc. Therefore, the present invention is not necessarily limited to the position, size, shape, range, etc. disclosed in the drawings. In the following explanation, various information may be explained using expressions such as "table," "list," and "queue," but the various information may be expressed in other data structures. To indicate independence of data structure, "XX table," "XX list," and the like may be referred to as "XX information." When explaining identification information, expressions such as "identification information," "identifier," "name," "ID," and "number" are used, but these are interchangeable. When there are multiple components having the same or similar functions, they may be described by using the same reference numerals with different subscripts. However, when there is no need to distinguish between these multiple components, the subscripts may be omitted. In addition, in the following description, processing performed by executing a program may be described, but the program is executed by a processor (e.g., CPU, GPU) to perform a defined process using storage resources (e.g., memory) and / or interface devices (e.g., communication ports) as appropriate, so the subject of the processing may be the processor. Similarly, the subject of the processing performed by executing a program may be a controller, device, system, computer, or node having a processor. The subject of the processing performed by executing a program may be a calculation unit, and may include a dedicated circuit (e.g., FPGA or ASIC) that performs a specific process. A program may be installed in a device such as a computer from a program source. The program source may be, for example, a program distribution server or a computer-readable storage medium. When the program source is a program distribution server, the program distribution server may include a processor and a storage resource for storing a program to be distributed, and the processor of the program distribution server may distribute the program to be distributed to other computers. In the following description, two or more programs may be realized as one program, and one program may be realized as two or more programs.

[0016] [First embodiment] First, a test case generation device and a test case generation method according to a first embodiment of the present invention will be described.

[0017] FIG. 1 is a diagram illustrating an example of the configuration of a test case generation device 100 according to the first embodiment of the present invention. The test case generation device 100 is an information processing device arranged in a test environment for software to be verified by testing (hereinafter, referred to as "target software"). The test case generation device 100 automatically generates efficient test cases required for testing the target software. The test case generation device 100 is configured by one or more computers. The test case generation device 100 is realized by an information processing device that performs the above-mentioned operations. The test case generation device 100 may have a user interface in its own device, or may use a user terminal connected via an appropriate network as the user interface. In this case, the user terminal is a terminal device operated by a user such as a software developer or tester. Specifically, this user terminal is a personal computer, a smartphone, a tablet terminal, or the like.

[0018] As shown in the figure, the test case generation device 100 includes a storage device 200, an arithmetic device 250, a memory 260, and an input / output device 270. The storage device 200, the arithmetic device 250, the memory 260, and the input / output device 270 are communicatively connected to each other via a bus.

[0019] The arithmetic device 250 is a CPU (Central Processing Unit) that reads out the program 210 held in the storage device 200 into a memory 260 and executes the program, performs overall control of the device itself, and performs various types of judgment, calculation, and control processing. The memory 260 is composed of a volatile storage element such as a random access memory (RAM) or a read only memory (ROM).

[0020] The input / output device 270 is a device that receives key input or voice input from the user and outputs processing data. For example, the input / output device 270 is composed of input devices such as a keyboard, a mouse, a touch panel, a microphone, etc., and a display device such as a liquid crystal display (LCD) or an organic EL (Electro-Luminescence) display, or a print output device such as a printer. Alternatively, the input / output device 270 may include a network interface card that is connected to an appropriate network and handles communication processing with a user terminal.

[0021] The storage device 200 is composed of an appropriate non-volatile storage element such as a solid state drive (SSD) or a hard disk drive. In addition to a program 210 for implementing each function required for the test case generation device 100 of this embodiment, the storage device 200 stores factor level information 400, which is intermediate data related to the generation of test cases, and test cases 800, which are output data. Details of the factor level information 400 and the test cases 800 will be described later.

[0022] The input to the test case generation device 100 includes software specification information 11 of the target software and generation parameter setting information 12 .

[0023] The software specification information 11 is specification information that includes information necessary to generate factors and levels used in testing the target software. Factors are the types of parameters and elements to be tested for the software. Furthermore, levels are values ​​or representative values ​​that are permitted to be input to the factor. For example, the software specification information 11 can be information in which factors and levels are directly described, or, in the case of a web service, a specification description based on the OpenAPI specification description.

[0024] FIG. 2 is a diagram showing an example of the software specification information 11. In the software specification information 11 shown in the diagram, a vehicle_deliveries type structure is defined. The vehicle_deliveries type has enumeration type elements of vehicle, vehicle_size, and weather (hereinafter, the elements (members) of the structure are referred to as "properties"). The vehicle has two level values ​​(EV, Diesel), the vehicle_size has three level values ​​(Small, Medium, Large), and the weather has three level values ​​(Sunny, Cloudy, Rainy). Furthermore, the vehicle The le_deliveries type has a property called deliveries, which is an array of type deliveries. The deliveries property takes an array of type deliveries. The ry type has enumeration properties called time and weight. Time has four levels (AM, PM1, PM2, Night), and weight has six levels (5, 10, 15, 20, 25, 30).

[0025] The generation parameter setting information 12 is information on the setting values ​​of each parameter related to the generation of test cases by the Pairwise method. The generation parameter setting information 12 may include a setting value of the coverage in the Pairwise method. Furthermore, when the software specification information 11 includes an array-type factor, the generation parameter setting information 12 may include settings related to the minimum and maximum numbers of elements in the array. The information set in the generation parameter setting information 12 may be included in the software specification information 11.

[0026] 3 is a diagram showing an example of generation parameter setting information 12. In the illustrated generation parameter setting information 12, a coverage level of "2" and an array element count of "0-3" (the minimum and maximum values ​​of the array element count are "0" and "3") are set.

[0027] Next, as shown in FIG. 1, the program 210 includes programs for realizing a factor level generating unit 300 (first generating unit) and a Pairwise generating unit 500 (second generating unit).

[0028] The factor level generation unit 300 generates factor level information 400 used for software testing from the software specification information 11. At this time, the factor level generation unit 300 executes a first generation process to generate factors and levels of each element for an array type factor having a predetermined number of elements. The method for generating factors and levels from the OpenAPI specification description can be the method disclosed in Non-Patent Document 1.

[0029] The Pairwise generation unit 500 selects factors from the generated factors and their levels based on the factor level information 400 generated by the factor level generation unit 300, and generates test cases for combinations of the levels of each selected factor. Specifically, the Pairwise generation unit 500 executes a second generation process to generate test cases 800 with n-factor coverage for coverage level n by the Pairwise method. n-factor coverage means that a test is performed at least once for each level of n factors included in any n-factor combination of factors to be verified by the test case group to be generated. For example, one-factor coverage means that a test is performed at least once for the level of each factor to be tested by the test case group to be executed. Similarly, two-factor coverage means that a test is performed at least once for each level of two factors included in a two-factor combination of factors to be verified by the test case group to be executed. As a method of generating test cases using the Pairwise method, the method disclosed in Patent Document 1 or the like can be used. For example, the pairwise generation unit 500 generates test cases by a method such as listing test cases for each relationship between factors and combining test cases for different relationships into a single test case.

[0030] The test case generation device 100 realizes each function of the factor level generation unit 300 and the pairwise generation unit 500 by the calculation device 250 loading the program 210 stored in advance in the storage device 200 into the memory 260 and executing it.

[0031] In addition to a configuration example in which each of the constituent functions of the test case generation device 100 is arranged within a single information processing device, the functions may be distributed and arranged across multiple information processing devices connected via a network, or across computing resources on the cloud.

[0032] FIG. 4 shows a process performed by the test case generation device 100 according to the first embodiment of the present invention. 1 is a diagram for explaining the flow of. As shown in the figure, first, the factor level generation unit 300 generates factors and their levels to be used in software testing based on the software specification information 11 and the generation parameter setting information 12, and generates factor level information 400 (S11). Note that this process is started, for example, when a predetermined input is made to the test case generation device 100 by the user, or at a predetermined timing (for example, a predetermined time, a predetermined time interval), etc. For example, the factor level generation unit 300 may start this process when the user specifies the software specification information 11 and the generation parameter setting information 12 of the target software and causes the test case generation device 100 to read them.

[0033] 5 is a diagram for explaining a method for generating factor level information 400 in the first embodiment of the present invention. With reference to this figure, a method for generating factor level information 400 in a case where an array type parameter or variable is included in the software specification information 11 will be specifically explained. Hereinafter, a specific explanation will be given by taking as an example a case where the factor level generating unit 300 generates a test case for a vehicle_deliveries type.

[0034] First, as described above, the number of array elements is specified as 0 to 3 in the generation parameter setting information 12. Therefore, the factor level generation section 300 generates factors and their levels corresponding to the number of array elements of 0, 1, 2, and 3, respectively.

[0035] Specifically, when the number of array elements is 0, deliveries can only take an empty array, so the factor level generation unit 300 uses properties other than deliveries to generate factors to be used in the test case and the levels of each factor (see reference numeral 1000). Also, when the number of array elements is 1, the factor level generation unit 300 generates a deliveries[0].time factor and a deliveries[0].weight factor corresponding to the only array element (see reference numeral 1001).

[0036] Furthermore, when the number of array elements is 2, the factor level generation unit 300 generates factors corresponding to the array elements of deliveries[0] and deliveries[1] (see reference numeral 1002). When the number of array elements is 3, the factor level generation unit 300 generates factors and levels in the same manner, thereby generating factor level information 400 according to each number of array elements, as shown in FIG. 5 (see reference numeral 1003).

[0037] Next, the Pairwise generation unit 500 generates n-factor coverage test cases 800 with the coverage level n set in the generation parameter setting information 12 by the Pairwise method based on the factor level information 400 (S12).

[0038] 6 is a diagram showing an example of a test case 800 generated by the test case generation device 100 in the first embodiment of the present invention. With the above method, it is possible to generate a test case 800 in a manner similar to that used for generating test cases using the Pairwise method, with 3 factors when the number of array elements is 0, 5 factors when the number of array elements is 1, 7 factors when the number of array elements is 2, and 9 factors when the number of array elements is 3.

[0039] As described above, the test case generation device 100 of this embodiment includes the factor level generation unit 300 that generates factors and their levels for software testing, and the pairwise generation unit 500 that selects factors from the generated factors and their levels and generates test cases for combinations of the levels of each selected factor. The factor level generation unit 300 generates factors and their levels for each element of an array-type factor having a predetermined number of elements.

[0040] That is, the test case generation device 100 of the present embodiment can generate test cases that cover all factors for each element of an array type factor having a predetermined number of elements. It is possible to perform tests on factors of array types with any number of elements, making it possible to discover bugs that occur only when an array has multiple elements.

[0041] [Second embodiment] Next, a test case generation device and a test case generation method according to a second embodiment of the present invention will be described.

[0042] The first method disclosed in the first embodiment realizes the generation of test cases that cover a wide range of specifications, even for software that has an array type. However, when the number of elements in an array is large, the number of factors generated increases, and the number of test cases generated also becomes enormous. Therefore, in this embodiment, a method is disclosed for generating test cases that cover a wide range of specifications while preventing the number of test cases generated from becoming enormous, even when the number of elements in an array is large.

[0043] Here, the reason for using an array type for a parameter is that there are cases where data is to be passed to software as a variable number of sets. In such cases, the order of elements in the array is often not important. Also, there are many defects that depend only on the number of elements, not on the data set in the array. In order to efficiently find defects of such a nature, in this embodiment, the number of elements of the array and factors other than the array (hereinafter referred to as "factors outside the array") are covered, and for factors outside the array and factors included in the array (hereinafter referred to as "factors within the array"), it is sufficient to cover any element position in the array. By relaxing the coverage compared to the method shown in the first embodiment, specifications are widely covered with fewer test cases.

[0044] 7 is a diagram showing an example of the configuration of a test case generation device 100A according to the second embodiment of the present invention. In this figure, the same components as those of the test case generation device 100 according to the first embodiment shown in FIG. 1 are denoted by the same reference numerals, and the description thereof will be omitted.

[0045] The storage device 200 of the test case generation device 100A in this embodiment stores a program 210A that realizes each of the out-of-array factor level generation unit 310, the in-array factor level generation unit 320, the Pairwise generation unit 500, and the test case synthesis unit 700. The out-of-array factor level generation unit 310 and the in-array factor level generation unit 320 correspond to a first generation unit, and the Pairwise generation unit 500 and the test case synthesis unit 700 correspond to a second generation unit.

[0046] The external array factor level generating unit 310 generates external array factor level information 410 representing an array type factor having a variable number of elements and its level based on the software specification information 11.

[0047] The intra-array factor level generating unit 320 generates intra-array factor level information 420 representing factors of elements of an array type factor having a variable number of elements and their levels, based on the software specification information 11.

[0048] The Pairwise generation unit 500 generates external test cases 610 (described later) with n-factor coverage by the Pairwise method based on the external array factor level information 410, using the coverage n defined in the generation parameter setting information 12. The Pairwise generation unit 500 also generates internal test cases 620 (described later) with n-factor coverage by the Pairwise method based on the internal array factor level information 420, using the coverage n defined in the generation parameter setting information 12.

[0049] The test case synthesis unit 700 synthesizes the external test cases 610 and the internal test cases 620. The synthesis is performed and a test case 800 for use in testing is output.

[0050] Further, the storage device 200 stores the external factor level information 410, the internal factor level information 420, the external test case 610, the internal test case 620, and the test case 800, which is output data, which are intermediate data related to test case generation. The external factor level information 410, the internal factor level information 420, the external test case 610, and the internal test case 620 will be described in detail later.

[0051] FIG. 8 is a diagram for explaining the flow of processing performed by the test case generation device 100A in the second embodiment of the present invention. As shown in the figure, first, the out-of-array factor level generation unit 310 generates out-of-array factor level information 410 based on the software specification information 11 (S310). Details of the processing for generating the out-of-array factor level information 410 will be described later. Note that this processing is started, for example, when a predetermined input is made to the test case generation device 100 by the user, or at a predetermined timing (for example, a predetermined time, a predetermined time interval), etc. For example, the factor level generation unit 300 may start this processing when the user specifies the software specification information 11 and generation parameter setting information 12 of the target software and causes the test case generation device 100 to read them.

[0052] On the other hand, the intra-array factor level generating unit 320 generates intra-array factor level information 420 (S320) based on the software specification information 11. The process of generating the intra-array factor level information 420 will be described later in detail.

[0053] The Pairwise generation unit 500 generates an external test case 610 with n-factor coverage by the Pairwise method based on the external array factor level information 410 using the coverage n defined in the generation parameter setting information 12 (S500). The Pairwise generation unit 500 also generates an internal test case 620 with n-factor coverage by the Pairwise method based on the internal array factor level information 420 using the coverage n defined in the generation parameter setting information 12.

[0054] The test case synthesis unit 700 synthesizes the external test case 610 and the internal test case 620, and outputs the test case 800 to be used in the test (S700). The process of synthesizing the external test case 610 and the internal test case 620 will be described in detail later.

[0055] Next, each process executed by the test case generation device 100A will be described in detail.

[0056] 9 is a diagram for explaining a method for generating the external factor level information 410 and the internal factor level information 420 in the second embodiment of the present invention. Hereinafter, the external factor level generating process for generating the external factor level information 410 and the internal factor level generating process for generating the internal factor level information 420 will be specifically explained using the example shown in this figure.

[0057] <Outside array factor level generation process> FIG. 10 is a flowchart for explaining an example of the external array factor level generation process S310 executed by the external array factor level generation unit 310.

[0058] First, the external array factor level generating unit 310 reads the data structure of the test case to be generated from the software specification information 11, and generates factors and levels in the same manner as in the first embodiment (S311).

[0059] Next, the non-array factor level generation unit 310 determines whether or not the generated factors include a factor having an array type (S312).

[0060] If no factor having an array type is included (S312: No), the outside-array factor level generation unit 310 proceeds to the process of step S315 and outputs the factors and levels generated in S311 as outside-array factor level information 410 as they are.

[0061] On the other hand, if factors having an array type are included (S312: Yes), the non-array factor level generation unit 310 selects one from among them (S313).

[0062] Then, the external factor level generating unit 310 replaces the selected factor with a factor that represents the number of array elements of the factor (having the value of the number of array elements as the level) (S314). The external factor level generating unit 310 also refers to the generation parameter setting information 12 and sets a value that can be taken as the number of array elements as the level of the replaced factor.

[0063] 9, the external array factor level generation unit 310 replaces the deliveries factor having an array type with a deliveries_length factor indicating the number of array elements (see reference numeral 2000). In addition, since the number of array elements is defined to be between 0 and 3 in the generation parameter setting information 12, the external array factor level generation unit 310 sets four levels, 0, 1, 2, and 3, as the level of the deliveries_length factor (see reference numeral 2001).

[0064] After the process of S314, the external array factor level generating unit 310 returns to the process of S312. That is, the external array factor level generating unit 310 performs the process of S314 for all array type factors, thereby generating external array factor level information 410 that does not include array type factors (array type factors are replaced with factors that represent the number of array elements). When the external array factor level generating unit 310 executes the process of S314 for all array type factors (S312: No), it outputs the generated external array factor level information 410 (S315). After that, the external array factor level generating unit 310 ends the process of this external array factor level generating process S310.

[0065] <Generating factor levels within an array> FIG. 11 is a flowchart for explaining an example of the intra-array factor level generation process S320 executed by the intra-array factor level generation unit 320.

[0066] First, the intra-array factor level generation unit 320 reads the data structure of the test case to be generated from the software specification information 11, and generates factors and levels in the same manner as in the first embodiment (S332).

[0067] Next, the intra-array factor level generation unit 320 determines whether or not the generated factors include a factor having an array type (S322).

[0068] If a factor having an array type is not included (S322: No), the intra-array factor level generation unit 320 does not generate intra-array factor level information 420 and ends this intra-array factor level generation process.

[0069] On the other hand, if factors having an array type are included (S322: Yes), the intra-array factor level generation unit 320 selects one from among them (S323).

[0070] Then, for the selected factor, the intra-array factor level generation unit 320 outputs information on the factor and level for the type of the element of the array as intra-array factor level information 420 (S324).

[0071] In the example shown in FIG. 9, the intra-array factor level generating unit 320 generates a delivery For the es factor, the factor time and factor weight, which are factors of the element type, are treated as in-array factor level information 420 together with their respective levels.

[0072] After the process of S324, the intra-array factor level generating unit 320 returns to the process of S322. That is, the intra-array factor level generating unit 320 performs the process of S324 for all array type factors, and finally outputs the same number of intra-array factor level information 420 as the number of array type factors. In the example shown in FIG. 9, only one deliveries factor has an array type, so the intra-array factor level generating unit 320 outputs one intra-array factor level information 420.

[0073] <Test case synthesis process> FIG. 12 is a flowchart illustrating an example of the test case synthesis process S700 executed by the test case synthesis unit 700.

[0074] The test case synthesis unit 700 generates a test case by synthesizing the internal test case 620 for each of the multiple external test cases 610. The test case synthesis unit 700 repeats the processes of S701 to S704 (described later) until synthesis for all of the external test cases 610 is completed.

[0075] First, the test case synthesis unit 700 determines whether or not all the external test cases 610 have been synthesized with the internal test cases 620 (S701).

[0076] If all the external test cases 610 have not been synthesized (S701: No), the test case synthesis unit 700 selects one external test case 610 that has not yet been synthesized with an internal test case 620 (S702).

[0077] Next, the test case synthesis unit 700 determines whether or not a factor representing the number of array elements is set in the selected external test case 610 (S703). If a factor representing the number of array elements is not set in the selected external test case 610 (S703: No), the test case synthesis unit 700 returns to the process of S701.

[0078] On the other hand, if a factor representing the number of array elements is set in the selected external test case 610 (S703: Yes), the test case synthesis unit 700 selects element values ​​from the internal test cases 620 for the number of array element values ​​represented by the factor (level value) and replaces them as elements of the array (S704). At this time, the test case synthesis unit 700 selects element values ​​to be replaced from the internal test cases 620 so as to avoid duplication as much as possible. In other words, the test case synthesis unit 700 synthesizes internal test cases 620 that have not been used in the synthesis into the external test case 610 in priority to internal test cases 620 that have been used in the synthesis. However, if all internal test cases 620 have already been used at least once, the test case synthesis unit 700 may use them duplicated.

[0079] After that, the test case synthesis unit 700 returns to the process of S703. That is, the test case synthesis unit 700 executes the process of S704 for all factors representing the number of array elements included in the external test case 610. In other words, when the external test case 610 has multiple factors representing the number of array elements, the test case synthesis unit 700 performs the replacement of element values ​​of S704 for each of the factors representing the number of array elements. At that time, the test case synthesis unit 700 can increase the comprehensiveness by selecting elements to be replaced so that the combination of elements between different arrays is a combination that has not been realized in the already synthesized test case 800.

[0080] The test case synthesis unit 700 calculates the number of all array elements in all external test cases 610. When the replacement of the values ​​of the factors representing the test cases 800 is completed (S701: Yes), it is determined whether or not all the values ​​of the elements of the array in the internal test cases 620 have been used in the replacement (S705, S706). In other words, the test case synthesis unit 700 determines whether or not all the internal test cases 620 have been used in the synthesized test case 800.

[0081] If there is a value in the internal test case 620 that is not used for replacement (S706: No), the test case synthesis unit 700 adds an external test case 610, and uses all values ​​of the internal test case 620 for replacement by using the unused value to replace the added external test case 610 (S707). The test case synthesis unit 700 may reuse a part of an existing external test case 610 as the external test case 610 to be added. Alternatively, the test case synthesis unit 700 may newly generate another external test case 610 in the Pairwise generation unit 500 by increasing the coverage.

[0082] If all values ​​of the internal test cases 620 have been used for replacement (S706: Yes), the test case synthesis unit 700 ends this test case synthesis process.

[0083] 13 is a diagram for explaining a method for synthesizing an external test case 610 with an internal test case 620. Hereinafter, the test case synthesis process for synthesizing an external test case 610 with an internal test case 620 will be specifically explained using the example shown in this diagram.

[0084] This figure illustrates internal test cases 620 generated using the in-array factor level information 420 illustrated in Fig. 9, and a part (external test cases 611-613) of external test cases 611 generated using the out-array factor level information 410. In this example, the Pairwise generation unit 500 generates 24 internal test cases 620 by combining a factor time with four levels and a factor weight with six levels.

[0085] For example, since the value of deliveries_length indicating the number of array elements is 0 for the external test case 611, the test case synthesis unit 700 generates a test case 811 by replacing deliveries_length with an empty array deliveries[].

[0086] Furthermore, for external test case 612, the value of deliveries_length is 1, so the test case synthesis unit 700 selects one array element value {time:AM,weight:5} from internal test case 620. Then, the test case synthesis unit 700 generates test case 812 in which deliveries_length is replaced with an array deliveries[{time:AM,weight:5}] whose element is {time:AM,weight:5}.

[0087] Furthermore, for external test case 613, the value of deliveries_length is 2, so the test case synthesis unit 700 selects two array element values ​​{time:AM,weight:10}, {time:PM1,weight:5} from internal test case 620. Then, the test case synthesis unit 700 generates test case 813 by replacing deliveries_length with an array [{time:AM,weight:10}, {time:PM1,weight:5}] with two array elements and having {time:AM,weight:10}, {time:PM1,weight:5} as elements. The test case synthesis unit 700 generates a set of test cases 800 by executing the same process for all external test cases 610.

[0088] In this example, the test case synthesis unit 700 does not add any additional external test cases because all 24 internal test cases 620 are used as elements of the array (synthesized into the external test case 610). Test cases 610 are not generated.

[0089] So far, we have explained an example in which the type of an element of an array type does not have an array type, but in reality, there are cases in which an element of an array has an array type. In such cases, by recursively executing the procedure of this embodiment when generating internal test cases, it is possible to generate test cases even when an array is included in an array.

[0090] By using the second method disclosed in this embodiment, it is possible to generate comprehensive test cases for specifications including arrays with a smaller number of test cases than by the first method disclosed in the first embodiment.

[0091] FIG. 14 is a graph comparing the number of test cases generated by using the first method disclosed in the first embodiment and the second method disclosed in the second embodiment. The horizontal axis of the graph shown in this figure indicates the maximum value (upper limit value) of the number of array elements, and the vertical axis is a logarithmic axis indicating the number of generated test cases. In the graph shown in this figure, the number of test cases generated when the coverage is set to 2 and test cases are generated from the software specification information 11 exemplified in FIG. 2 is compared. For example, when the maximum value of the number of array elements is set to 50, 4129 test cases are generated by the first method disclosed in the first embodiment, whereas the number of test cases can be reduced to 153 by the second method disclosed in the second embodiment. As shown in the figure, the greater the number of array elements, the greater the effect of reducing the number of test cases.

[0092] As described above, the test case generation device 100A of this embodiment generates extra-array factor level information representing factors other than array-type factors and their levels, and intra-array factor level information representing factors of elements of array-type factors and their levels, generates external test cases based on the extra-array factor level information and internal test cases based on the intra-array factor level information, and generates test cases that combine the external test cases with the internal test cases.

[0093] That is, the test case generation device 100A of this embodiment can generate test cases covering all factors for combinations of factors other than array-type factors and the number of elements of array-type factors. This makes it possible to efficiently detect defects that depend only on the number of elements of an array with a smaller number of test cases than the first method disclosed in the first embodiment. In other words, it is possible to widely cover specifications with a smaller number of test cases.

[0094] In addition, the test case generation device 100A of this embodiment generates external factor level information in which an array-type factor is replaced with a factor having the number of elements in the array as its level, and replaces a value representing the number of elements in an array in an external test case with an array having internal test cases with that number of elements as its elements.

[0095] With this configuration, the internal test cases are inserted into the elements of the array of the external test case, so that the external test cases and the internal test cases can be efficiently synthesized.

[0096] Furthermore, the test case generation device 100A of this embodiment synthesizes internal test cases for all external test cases having a value indicating the number of elements in an array.

[0097] With this configuration, test cases using all external test cases can be generated, so that test cases for factor coverage testing can be generated for factors other than array-type factors. Therefore, test cases that cover a wide range of specifications can be generated.

[0098] In addition, the test case generation device 100A of the present embodiment synthesizes all the internal test cases. to generate test cases.

[0099] This configuration allows test cases to be generated for each level of each factor in an array of factor elements, so that test cases can be generated that efficiently cover all possible combinations of values ​​for factor combinations in the array.

[0100] Furthermore, the test case generation device 100A of this embodiment synthesizes internal test cases that have not been used in the synthesis into an external test case with a higher priority than internal test cases that have been used in the synthesis.

[0101] This configuration makes it possible to suppress overlapping of internal test cases between test cases, thereby making it possible to efficiently generate test cases that broadly cover the specifications with a smaller number of test cases.

[0102] The present invention is not limited to the above-described embodiment, and can be implemented using any components without departing from the scope of the present invention. The above-described embodiments and modifications are merely examples, and the present invention is not limited to these contents as long as the features of the invention are not impaired. In addition, although various embodiments and modifications have been described above, the present invention is not limited to these contents. Other aspects conceivable within the scope of the technical idea of ​​the present invention are also included in the scope of the present invention.

[0103] For example, part of the hardware included in each device of this embodiment may be provided in another device.

[0104] Furthermore, each program of the test case generation device may be provided in another device, a certain program may be made up of multiple programs, or multiple programs may be integrated into one program.

[0105] In the above-described embodiment, the factor level generating unit 300 and the external array factor level generating unit 310 read the number of array elements from the generation parameter setting information 12. However, this is not limited to this. If the number of array elements is defined in the software specification information 11, the number of array elements may be read from the software specification information 11. [Explanation of symbols]

[0106] 11 Software specification information 12 Generation parameter setting information 100,100A test case generator 200 Storage device 210,210A Program 250 Arithmetic equipment 260 Memory 270 I / O Devices 300 Factor level generator 310 Non-array factor level generator 320 Array factor level generator 400 Factor level information 410 Extra-array factor level information 420 Factor level information within an array 500 Pairwise generator 610 External Test Cases 620 Internal Test Cases 700 Test Case Synthesis Unit 800 Test Cases

Claims

1. a processor and a memory; a first generation unit that generates factors and their levels for each element of an array-type factor having a predetermined number of elements in a software test; a second generation unit that selects factors from the generated factors and their levels and generates test cases for combinations of levels of each selected factor; Equipped with the first generation unit generates extra-array factor level information representing factors other than the array-type factor and their levels, and intra-array factor level information representing factors of elements of the array-type factor and their levels, the second generation unit generates an external test case based on the external factor level information and an internal test case based on the internal factor level information, and generates a test case by combining the external test case with the internal test case. Test case generator.

2. the first generation unit generates the non-array factor level information by replacing the array-type factor with a factor having a value equal to the number of elements of the array as a level; the second generation unit synthesizes the internal test case with the external test case by replacing a value representing the number of elements of an array in the external test case with an array having the internal test cases as elements of the same number of elements; The test case generation device according to claim 1 .

3. the second generation unit synthesizes the internal test cases for all the external test cases having a value representing the number of elements in an array; The test case generation device according to claim 2 .

4. the second generation unit generates the test case by using all of the internal test cases in the synthesis. The test case generation device according to claim 1 .

5. the second generation unit synthesizes the internal test cases that have not been used in synthesis into the external test cases in priority to the internal test cases that have been used in synthesis; The test case generation device according to claim 1 .

6. The information processing device a first generation process for generating factors and their levels for each element of an array-type factor having a predetermined number of elements in a software test; a second generation process of selecting factors from the generated factors and their levels, and generating test cases for combinations of the levels of each selected factor; In the first generation process, extra-array factor level information representing factors other than the array-type factors and their levels, and intra-array factor level information representing factors of elements of the array-type factors and their levels are generated, In the second generation process, an external test case based on the external factor level information and an internal test case based on the internal factor level information are generated, and a test case is generated by combining the external test case with the internal test case. Test case generation method.

7. The information processing device, In the first generation process, the array-type factors are replaced with factors having a value equal to the number of elements of the array as a level, and the levels of the factors are generated to generate the non-array factor level information; In the second generation process, the internal test case is synthesized into the external test case by replacing a value representing the number of elements of an array in the external test case with an array having the internal test cases of the same number of elements as elements. The test case generation method according to claim 6.

8. The information processing device, In the second generation process, the internal test cases are synthesized for all the external test cases having a value representing the number of elements of an array. The test case generation method according to claim 7.

9. The information processing device, In the second generation process, all of the internal test cases are used in the synthesis to generate the test cases.

7. The test case generation method according to claim 6.

10. The information processing device, In the second generation process, the internal test cases that have not been used for synthesis are synthesized into the external test cases in priority to the internal test cases that have been used for synthesis. The test case generation method according to claim 6.