Test case generating apparatus, method thereof, and program therefor

JP2025032610APending Publication Date: 2025-03-12ASTEMO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023137979
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2025-03-12

AI Technical Summary

Benefits of technology

【0009】 本発明によれば、結合テストのテストケースを容易に作成することができる。上記した以外の課題、構成及び効果は、以下の実施形態の説明により明らかにされる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025032610000001_ABST
    Figure 2025032610000001_ABST
Patent Text Reader

Abstract

To provide a test case generating apparatus and so on which can easily generate a test case for an integration test.SOLUTION: A processor (processor unit 100) of a test case generating apparatus reads out a first test case (test case 200) formed of a first input x to a first task (task 1) and a first output y to the first task. The processor reads out a second test case (test case 201) formed of a second input v to a second task (task 2) and a second output w from an expected second task. The processor reads out a table (inter-task connection information table 202) for storing correspondence between the first output y and the second input v in a test of coupling the first task and the second task. The processor generates a test case of a coupling test from the first input x, the second output w, and the correspondence.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, method, and program. [Background technology]

[0002] Control software for embedded devices such as automotive devices often implements processes called periodic tasks that run at regular intervals, and processes called event tasks that run when a specific event occurs. These periodic tasks and event tasks are collectively called software components.

[0003] Code reviews and testing are conducted to verify that the processing implemented as software components is appropriate. In testing, test cases are created to check whether the expected output is obtained when certain conditions are input to the test subject. Testing is often carried out in stages. First, single-function testing is carried out to check whether the expected output parameters are obtained when input parameters are given to a single software component, and then software component integration testing is carried out to check whether input and output parameters are passed between components as expected when multiple software components are combined.

[0004] In testing the combination of multiple software components, if there are many components to be combined, many input / output parameters for each component, or the components have different operating cycles, creating test cases manually is time-consuming and prone to errors such as missing combinations. To reduce the risk of missing input / output combinations in test cases, there is a method for organizing input / output using a decision table defined in JIS X0125:1986. In this method, the input and output parameters of software components are organized in a table format to clearly show parameter combinations. [Prior art documents] [Non-patent literature]

[0005] [Non-Patent Document 1] JIS X0125:1986 decision table Summary of the Invention [Problem to be solved by the invention]

[0006] It is desirable to reduce the time required to create test cases for integration testing between software components and to reduce the introduction of errors due to manual work. The method of organizing input / output parameters using a decision table in Non-Patent Document 1 visualizes input / output parameters and their combinations, but it is not a method specialized for testing software components, and does not provide a method for extracting input / output parameters for each task or for assigning input values ​​that take into account the operating cycle of the component.

[0007] An object of the present invention is to provide a test case generation device, method, and program that can easily create test cases for an integration test. [Means for solving the problem]

[0008] In order to achieve the above-mentioned object, one example of a test case generation device of the present invention includes a processor that reads a first test case consisting of a first input to a first task and an expected first output from the first task, a second test case consisting of a second input to a second task and an expected second output from the second task, and a table that stores a correspondence between the first output and the second input in an integration test of the first task and the second task, and generates a test case for the integration test from the first input, the second output, and the correspondence. Effect of the Invention

[0009] According to the present invention, test cases for integration testing can be easily created. Problems, configurations, and effects other than those described above will become apparent from the following description of the embodiments. [Brief description of the drawings]

[0010] [Figure 1] FIG. 1 is a block diagram of a method for automatically generating periodic task coupling test case information. [Diagram 2] This is a diagram showing the combined test case of task 1 and task 2 output by this method. [Figure 3A] FIG. 1 is a block diagram of task 2. [Figure 3B] FIG. 13 illustrates a test case for task 2. [Figure 3C] FIG. 13 is a flow diagram of the test case reading part of task 2. [Figure 4A] FIG. 1 is a block diagram showing the combination of task 1 and task 2. [Figure 4B] FIG. 13 illustrates a connection information table. [Figure 4C] FIG. 13 is a flow diagram of a connection information table reading unit. [Figure 5A] FIG. 2 is a block diagram showing inputs and outputs of task 1 and task 2. [Figure 5B] FIG. 1 illustrates a test case for task 1. [Figure 5C] FIG. 1 is a flow diagram of the test case reading part of task 1. [Figure 6A] This is a diagram showing an integration test case of task 1 and task 2. [Figure 6B] FIG. 13 is a flow diagram of an inter-task coupling test case information generating unit. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] Hereinafter, an embodiment for carrying out the present invention will be described. This embodiment relates to a method for creating software component integration test cases for a software program having multiple software components. This embodiment aims to automatically derive necessary input / output parameters and input values ​​that take into account periodicity, and to support the creation of test cases for software component integration tests. Here, it is assumed that all software components are periodic tasks.

[0012] FIG. 1 is a block diagram of a method for automatically generating periodic task coupling test case information (test case generation device).

[0013] For the test cases of task 1, the test cases of task 2, and the inter-task connection information table, the processing unit 100 is made up of a test case reading unit 101 for task 2, a connection information table reading unit 102, a test case reading unit 103 for task 1, and an inter-task connection test case information generating unit 104.

[0014] The test case generation device is, for example, a personal computer, and is composed of a processor (processing unit 100) such as a CPU (Central Processing Unit), a memory, a storage device such as an HDD (Hard Disk Drive), an input device such as a mouse and a keyboard, a communication device such as a network card, etc. The processor executes a program stored in the storage device to realize various functions as shown below.

[0015] Test case 200 of task 1 has input variables x1~ x i (i>0) and output variables y1~ y j With information (j>0), for each (T+1) time in the p interval from time = 0 to time = Tp (T>0, T: integer), the variable x i Input value val at time (i,time) Other values ​​are optional.

[0016] Test case 201 in task 2 has input variables v1~ v m (m>0) and output variables w1~ w n Contains information on (n>0). The value is arbitrary.

[0017] The task connection information table 202 contains the input variables v1 to v k The output variables y1~ y of task 1 correspond to k Here, k satisfies j >= k and m >= k.

[0018] FIG. 2 shows an integrated test case 300 of task 1 and task 2 output by this method. The greatest common divisor of the period p of task 1 and the period q of task 2 is d, and the value of p÷d is e. The integrated test case has input variables x1 to x i (i>0) and v k+1 ~ v m (m>=k>0) information and output variables w1~ w n (n>0) information. For each (T+1)e time in the d interval from time = 0 to time = Tp (T>0), the variable x i Input value val at time (i,time) Here, for the column from time = ted to time = ((t+1)e-1)d (0 <= t <= T, t: integer), the input value is val in the test case of task 1. (i,t) is entered. All other values ​​are left blank.

[0019] 3A to 3C are diagrams for explaining the flow of the test case reading unit 101 for task 2. FIG.

[0020] According to the flow processing order, the period q and input variables v1 to v m (m>0) and output variables w1~ w n Read and store information (n>0).

[0021] 4A to 4C are diagrams for explaining the flow of the connection information table reading unit 102.

[0022] According to the flow processing order, input variables v1 to v2 of Task 2 are retrieved from the connection information table. k The output variables y1~ y of task 1 correspond to k The information is read and stored.

[0023] 5A to 5C are diagrams for explaining the flow of test case reading unit 103 for task 1. FIG.

[0024] According to the flow processing order, the period p and input variables x1 to x from the test case of task 1 are i (i>0) and output variables y1~ y j Read and store the information for (j>0). Also, the variable x i Input value val at time (i,time) The information is read and stored.

[0025] 6A to 6B are diagrams for explaining the flow of the inter-task coupling test case information generating unit 104. FIG. According to the flow processing order, the input variables x1 to x of the test case i (i>0) and v k+1 ~ v m (m>=k>0) information and output variables w1~ w n Write the information of (n>0) to the test case. Furthermore, the variable x i Input value val at time (i,time) Write the information.

[0026] The main features of this embodiment can be summarized as follows.

[0027] As shown in FIG. 1, a processor (processing unit 100) of the test case generation device reads a first test case (test case 200) consisting of a first input x to a first task (task 1) and an expected first output y from the first task. The processor reads a second test case (test case 201) consisting of a second input v to a second task (task 2) and an expected second output w from the second task. The processor reads a table (inter-task connection information table 202) that stores the correspondence between the first output y and the second input v in the integration test of the first task and the second task. The processor generates a test case (integration test case 300) for the integration test from the first input x, the second output w, and the correspondence.

[0028] By reducing the amount of manual input and output settings required by the user for integration testing, the introduction of errors is suppressed and the man-hours required for creating integration testing cases are reduced. In other words, integration testing test cases can be created easily.

[0029] The processor may read the first test case (test case 200), the second test case (test case 201), and the table (inter-task connection information table 202) in any order.

[0030] The first task (task 1) and the second task (task 2) are periodic tasks that execute processes at fixed periods p and q, respectively.

[0031] The first task and the second task each execute a process at a constant cycle, thereby making it possible to efficiently utilize hardware resources (CPU, memory, etc.), for example.

[0032] As shown in FIG. 2, when the first period p of the first task (Task 1) and the second period q of the second task (Task 2) are different from each other, the processor (processing unit 100) sets the first input x of the test case of the combined test at the timing that is an integer multiple of the period of the greatest common divisor d of the first period p and the second period q.

[0033] By setting the first input x of the test case of the combined test at the timing that is an integer multiple of the period of the greatest common divisor d, it is possible to easily perform the combined test of the first task and the second task having different periods from each other.

[0034] Specifically, the processor (processing unit 100) holds the first input (val (i,0) , val (i,p) , …) at the start of each period (for example, 0 ≦ time < p, p ≦ time < 2p, …) of the first period p. The processor sets the held first input (val (i,0) , val (i,p) , …) to the first input x of the test case of the combined test at the timing that is an integer multiple of the period of the greatest common divisor d in each period of the first period p.

[0035] Thereby, it is possible to complement the input lacking due to the difference in the periods of the tasks.

[0036] The processor (processing unit 100) may generate a first test case (test case 200) from at least one or more combinations of the first input x and the expected first output y.

[0037] Thereby, it is possible to easily create a test case for the combined test using the values in the first decision table.

[0038] The first decision table includes a combination of a first input x and a normal first output y, and a combination of another first input x and an abnormal first output y. For example, when the first input x is within a predetermined range (e.g., -10≦x≦10), the first output y expected as a return value of a predetermined function is normal, and when the first input x is outside the predetermined range, the first output y expected as a predetermined return value indicating an error (e.g., -100) is abnormal. That is, normal means, for example, a value expected for an input within a predetermined range for which an output is required, and abnormal means, for example, a value indicating an error expected for an input outside the predetermined range for which an output is required.

[0039] This allows integration testing to be performed using normal and abnormal values ​​for the first task.

[0040] The processor (processing unit 100) may generate a second test case (test case 201) from a second decision table consisting of at least one combination of a second input v and an expected second output w.

[0041] This makes it possible to easily create test cases for integration testing using the values ​​of the second decision table.

[0042] The second decision table includes combinations of the second input v and the normal second output w, and combinations of other second inputs v and the abnormal second output w.

[0043] This allows integration testing to be performed using normal and abnormal values ​​for the second task.

[0044] As shown in FIG. 2, the processor (processing unit 100) receives first inputs x1 to x i and the second input v1~ v m First output y1~y k The second input v1~ v k Input v excluding k+1 ~ v m and the second output w1~ wn Generate integration test cases from the above.

[0045] This reduces the burden on the user to set the input and output of the test cases for the integration test.

[0046] In this embodiment, the first task (task 1) is a first software component for controlling an in-vehicle device, and the second task (task 2) is a second software component for controlling an in-vehicle device.

[0047] This makes it possible to easily create test cases for integration testing of software components for controlling in-vehicle devices.

[0048] The present invention is not limited to the above-described embodiment, but includes various modified examples. For example, the above-described embodiment has been described in detail to clearly explain the present invention, and is not necessarily limited to an embodiment having all of the configurations described. In addition, it is possible to add, delete, or replace part of the configuration of the embodiment with other configurations.

[0049] Furthermore, the above-described configurations, functions, etc. may be realized in part or in whole by hardware, for example, by designing them as integrated circuits.

[0050] The embodiment of the present invention may have the following aspects.

[0051] (1) A method for automatically generating integration test cases for two software components, comprising: a first software component that receives a first input and outputs a first output through internal calculation processing; and a second software component that receives a second input and outputs a second output through internal calculation processing, the method including: combining the first software component and the second software component based on integration information (connection information) including information for inputting the first output as the second input; and generating integration test case information for determining the validity of the second output output by calculation processing in the first software component and the second software component in response to the first input.

[0052] (2) Regarding the above software components, the two software components are periodic tasks that execute processes at regular intervals, and execute and output arithmetic processing at each interval using values ​​given at each interval as input values.

[0053] (3) Regarding the integration test case and the periodic task, when the periods of the first periodic task and the second periodic task are different, the integration test case has a value at a period that is the greatest common divisor of the periods of the first periodic task and the second periodic task.

[0054] (4) Regarding the integrated test cases and periodic tasks, when the periods of the first periodic task and the second periodic task are different, the value of the integrated test case that is missing due to the difference in the periods retains the value of the previous period.

[0055] (5) A decision table is provided that stores a plurality of combinations of values ​​that are valid as a first output for a first input of the first software component.

[0056] (6) A decision table is provided that stores a plurality of combinations of valid values ​​as a first output for a first input of a first software component, the decision table including combinations that output a normal value for a given input and combinations that output an abnormal value for another input.

[0057] That is, the test case generation device automatically derives input / output parameters required for software component integration testing from information on input / output parameters indicated in the software component single function test case and integration information (connection information) that connects the input / output parameters between the software components. Also, the test case generation device determines input values ​​for software component integration testing from input values ​​of input parameters indicated in the software component single function test case. In particular, when the software component is a periodic task, the test case generation device determines input values ​​for periodic task integration testing that take into account differences in periodicity among multiple periodic tasks.

[0058] The test cases for the software component integration test configured as above can be used as test cases for verifying basic functions of the components. The above (1) to (6) facilitate the creation of such test cases, shorten the time required for creating test cases, and reduce the introduction of errors. [Explanation of symbols]

[0059] 100... Processing section 101…Test case reading part of task 2 102...Connection information table reading unit 103…Test case reading part of task 1 104...Inter-task integration test case information generation unit 200…Test cases for task 1 201…Test case for task 2 202...Task connection information table 300…Task 1 and Task 2 integration test cases

Claims

1. a first test case consisting of a first input to a first task and a first expected output from the first task; a second test case consisting of a second input to a second task and a second expected output from the second task; a table storing a correspondence relationship between the first output and the second input in a combination test of the first task and the second task; a test case generation device comprising: a processor that generates a test case for the integration test from the first input, the second output, and the correspondence relationship.

2. 2. The test case generation device according to claim 1, The first task and the second task are each a periodic task that executes a process at a fixed period. A test case generation device comprising:

3. 3. The test case generation device according to claim 2, The processor, When a first period of the first task and a second period of the second task are different from each other, the first input of a test case of the integration test is set at a timing that is an integer multiple of a period that is a greatest common divisor of the first period and the second period. A test case generation device comprising:

4. 4. The test case generation device according to claim 3, The processor, holding the first input at a start of each period of the first cycle; The held first input is set to the first input of the test case of the integration test at a timing that is an integer multiple of the greatest common divisor period during each period of the first cycle. A test case generation device comprising:

5. 4. The test case generation device according to claim 3, The processor, generating the first test case from a first decision table consisting of at least one combination of the first input and the first expected output; A test case generation device comprising:

6. 6. The test case generation device according to claim 5, The first decision table comprises: A combination of the first input and the first output that is normal; and and a combination of another of the first inputs and an abnormal first output. A test case generation device comprising:

7. 6. The test case generation device according to claim 5, The processor, generating the second test case from a second decision table consisting of at least one combination of the second input and the second expected output; A test case generation device comprising:

8. 8. The test case generation device according to claim 7, The second decision table comprises: A combination of the second input and the second output that is normal; and and a combination of another of the second inputs and an abnormal second output. A test case generation device comprising:

9. 2. The test case generation device according to claim 1, The processor, A test case of the integration test is generated from the first input, the second input excluding the second input corresponding to the first output from the second input, and the second output. A test case generation device comprising:

10. 2. The test case generation device according to claim 1, the first task is a first software component for controlling an in-vehicle device; The second task is a second software component for controlling the in-vehicle device. A test case generation device comprising:

11. A method executed by the test case generator of claim 1, comprising: reading the first test case, the first test case consisting of the first input to the first task and the first expected output from the first task; reading the second test case, the second test case consisting of the second input to the second task and the expected second output from the second task; reading the table storing a correspondence between the first output and the second input in a combination test of the first task and the second task; generating a test case for the integration test from the first input, the second output, and the correspondence relationship; The method includes:

12. A program for a test case generation device according to claim 1, reading the first test case, the first test case consisting of the first input to the first task and the first expected output from the first task; reading the second test case, the second test case consisting of the second input to the second task and the expected second output from the second task; reading the table storing a correspondence between the first output and the second input in a combination test of the first task and the second task; generating a test case for the integration test from the first input, the second output, and the correspondence relationship; A program for causing the processor to execute the above.