Test case generation device and test case generation method
By analyzing the parameter categories and waveforms in the test requirements document, test case documents are automatically generated, solving the problem of complex generation processes in existing technologies and improving the efficiency of test case document generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ASTEMO LTD
- Filing Date
- 2024-08-28
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies require generating test models based on design specifications to automatically generate test case documents, a process that is complex and not convenient enough.
By reading in the parameter categories and waveforms from the test requirements document, analyzing parameter values and timing changes, selecting functions, setting test steps and judgment criteria, and automatically generating test case documents.
It enables the easy and automatic generation of test case documents during product development, thus improving testing efficiency.
Smart Images

Figure CN121866547A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a test case generation apparatus and a test case generation method. Background Technology
[0002] During product development, tests are performed to verify product actions according to the steps described in the test case documentation. To reduce the time required for such testing, techniques have been proposed to automate test execution, result determination, and test report output. Additionally, techniques for automatically generating manually created test cases have been previously proposed.
[0003] Prior technology documents
[0004] Patent documents
[0005] Patent Document 1: Japanese Patent Application Publication No. 2015-49659 Summary of the Invention
[0006] The problem that the invention aims to solve
[0007] However, in the above technical example, in order to automatically generate test case documents, it is first necessary to generate a test model based on the design specifications, and then use the test model to generate test case documents.
[0008] Therefore, the object of the present invention is to automatically generate test case books used in tests performed by verification devices in product development processes, etc., with a simpler process than before.
[0009] Methods for solving problems
[0010] One aspect of the present invention relates to a test case generation method, which generates a test case book defining the steps for performing tests in a verification device and the judgment criteria for the results of the tests performed according to the steps. The method includes: reading a test requirement book including categories of parameters used in the test and waveforms representing the time-varying values of the parameters; and analyzing the values of the parameters and the timing of the value changes. Furthermore, the method includes: for parameters identified as input values of the test according to the categories, selecting a function to set the value of the parameter, and determining the steps for executing the function based on the timing of the parameter value changes. Moreover, the method includes: for parameters identified as output values of the test according to the categories, selecting a function to determine whether the value of the parameter is an expected value, and determining the judgment criteria for using the function. Further, the method includes generating a test case book including the determined steps and the judgment criteria.
[0011] Invention Effects
[0012] According to one aspect of the present invention, test case books can be automatically generated in a simpler process than ever before, for tests performed by verification devices in product development processes, etc. Attached Figure Description
[0013] Figure 1 This is a schematic diagram illustrating an example of a system for testing electronic control devices.
[0014] Figure 2 This is a block diagram illustrating an example of the functional structure of a test case generation device.
[0015] Figure 3 This is an illustrative diagram representing an example of a test requirements document (test specifications document).
[0016] Figure 4 This is an explanatory diagram representing an example of a test case document (data setting and retrieval functions).
[0017] Figure 5 This is an illustration diagram representing an example of a test case document (Action 0).
[0018] Figure 6 This is an illustration diagram representing an example of a test case document (Action 1).
[0019] Figure 7 This is an illustration diagram representing an example of a test case document (Action 2).
[0020] Figure 8 This is an illustration diagram representing an example of a test case document (Action 3).
[0021] Figure 9 This is a flowchart illustrating an example of test case generation processing (overall processing).
[0022] Figure 10 This is a flowchart illustrating an example of test case generation processing (data acquisition department setting processing).
[0023] Figure 11 This is a flowchart illustrating an example of test case generation processing (operation step setting processing).
[0024] Figure 12 This is a flowchart illustrating an example of test case generation processing (operation step setting processing).
[0025] Figure 13 This is a flowchart illustrating an example of test case generation processing (judgment benchmark setting processing).
[0026] Figure 14This is a flowchart illustrating an example of test case generation processing (judgment benchmark setting processing).
[0027] Figure 15 It is an explanatory diagram that explicitly shows the time elapsed in the expected waveform diagram of the test requirements document.
[0028] Figure 16 This is a block diagram illustrating an example of the hardware structure of a test case generation device. Detailed Implementation
[0029] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. Furthermore, the present invention is not limited to the embodiments described in this specification, and different embodiments and their variations can be appropriately combined.
[0030] [System Overview]
[0031] Figure 1 An example of a test execution system 1 is shown, which performs tests to verify the operation of electronic control devices mounted in vehicles, etc. Furthermore, the system using this invention is not limited to such electronic control devices mounted in vehicles, etc.; for example, it can also test the functionality of electronic control devices mounted in industrial equipment, etc.
[0032] Figure 1 The test execution system 1 shown includes a test case generation device 100, a HILS (Hardware In the Loop Simulation) 200, and an electronic control unit 300. The HILS 200 is a verification device that quantifies the engine functions and behaviors of a vehicle, an example of the controlled object of the electronic control unit 300, and can simulate the actual vehicle. The HILS 200 tests the functionality of the electronic control unit 300 according to a test requirement document 10 that defines the test requirements of the electronic control unit 300 and describes the test content in functional form (ATP (Auto Test Procedure)). In this embodiment, the test case generation device 100 automatically generates the test cases 20 used in the testing of the electronic control unit 300 based on the test requirement document 10. Both the test case generation device 100 and the HILS 200 can be constructed from a general-purpose computer with a processor and memory.
[0033] The HILS200, following the test case sheet 20 generated by the test case generation device 100, receives control signals from the electronic control device 300 and executes the simulation corresponding to those control signals. Then, it outputs the system status as a result to the electronic control device 300. Furthermore, the HILS200 and the electronic control device 300 sequentially exchange control signals and system statuses to test whether the electronic control device 300 can perform the required functions. Finally, the HILS200 outputs a test report 30 including the test results.
[0034] This invention relates to a test case generation apparatus 100, particularly in this system. Hereinafter, the structure of the test case generation apparatus 100 and the processes performed by it will be described in detail.
[0035] [Structure of the test case generation device]
[0036] Figure 2 This is a functional block diagram of the test case generation device 100. The test case generation device 100 has a control unit 110, which performs its functions by loading and executing a program stored in a storage device by a processor. The control unit 110 includes an analysis unit 111 and a generation unit 112.
[0037] The analysis department 111 reads in the data from the test requirements document 10 and scans it to analyze its contents.
[0038] Based on the content of the test requirements document 10 analyzed by the analysis unit 111, the generation unit 112 determines the content of the test case document 20. Then, the generation unit 112 outputs data of the test case document 20 including the determined content.
[0039] The structure of the test requirements document 10 and the test case document 20, as well as the details of the processing performed by the analysis unit 111 and the generation unit 112, are described in detail below.
[0040] [Structure of Test Requirement]
[0041] Figure 3 This is an example of a part in Test Requirements Document 10 that is associated with the description of this embodiment.
[0042] Test Requirement Document 10 has "Type" and "Variable Name" columns. Furthermore, Test Requirement Document 10 includes expected waveform graphs associated with the parameters represented by the variable names. The expected waveform graph is a chart showing the change in parameter values over time, with the horizontal axis representing the time axis. Additionally, in this specification, when only described as "value," it represents at least one of a string or a numerical value. The length of the time axis of the expected waveform graph is divided into blocks at specified time intervals (in...). Figure 3In order to facilitate observation of the parameter values within the expected waveform, only the upper part is shown as an example. As an example, in... Figure 3 In the expected waveform diagram, one block represents 0.5 seconds. The length of elapsed time in the expected waveform diagram can be identified by the number of blocks corresponding to its length along the time axis.
[0043] A category indicates the nature of a parameter, at least enough to identify whether it is an input or output value for the test. Categories include, for example, "HILS," indicating that the parameter is an input value used in a function executed during the test. Categories also include "RAM," indicating that the parameter is a variable that outputs a test result, and "FLX (BUS)," indicating communication data. Furthermore, there is a category called "Diag," where a parameter can be either an input or output value for the test. As an example within the "Diag" category, the values of parameters indicating whether fault code clearing is enabled (ON) or disabled (OFF) before test execution, and the values of parameters subsequently used to confirm that a specified value has been set for that fault code, are shown.
[0044] In the variable name field, record the information required for the test according to the parameter category. For example, if the category is "HILS", you can record the name of the parameter that sets the input value of the function executed in the test. If the category is "Diag", you can record the name of the function itself. If the category is "RAM" or "FLX", you can record the name of the parameter that sets the output value of the test result.
[0045] To the right of each variable name is a corresponding graph representing the change in parameter values over time, known as the expected waveform. The expected waveform is divided into multiple phases based on a defined benchmark, with each phase representing an action. For example, actions are divided according to benchmarks such as the start and end timings of an operation in a test, and the elapsed time after the operation ends. During testing, the output value of each action is evaluated to determine if it is normal. By dividing the test phase into multiple actions, the output value can be evaluated multiple times in a series of tests.
[0046] When the waveform is expected to represent the time-varying change of a parameter that sets the input value to a function executed in the test, the value set for that parameter should be recorded at the location indicating the timing at which that value should be set. For example, when from... Figure 3The expected waveform diagram for the second category "HILS" at the top of the expected waveform diagram shows that the parameter for "IGNSW" should be set to "1" in Action 0 at the start of the test. After further time has elapsed, the parameter is set to "0" in Action 2. Subsequently, in the same Action 2, it indicates that the parameter should be set to "1" again.
[0047] Furthermore, the values of the ramp function's parameters can be recorded as the values to be set in the parameters. In this case, the four parameters used by the ramp function are recorded (values before and after the change, the magnitude of the change, and the time of change). For example, when starting from... Figure 3 The expected waveform diagram for the third category "HILS" starting at the top of the expected waveform diagram shows that the parameter "Current_High" is set to "2.5" at the start of the test. Then, when it transitions to Action 1, the parameter is set to "2.5, 5, 0.1, 0.1" as the parameter of the ramp function.
[0048] On the other hand, when the expected waveform represents the time-varying value of a parameter that sets the output value of the test result, the expected value that should be set for that parameter is recorded. If the expected value changes midway, the changed value is recorded at the time position indicating the occurrence of the change. For example, in Figure 3 The expected waveform diagram for the seventh category from the top, "RAM," shows that the parameter "vx_PWM_OUT" should be set to "3" in Action 0 at the start of the test. After time elapses, the value of this parameter changes in Action 1, indicating that it should be set to "1." Then, Action 2 shows that the value of this parameter changes again, indicating that it should be set to "3."
[0049] Additionally, in the case of the category "Diag", for example, the expected waveform can be described as follows. (Regarding the waveform from...) Figure 3 The expected waveform diagram for the fourth category "Diag" from the top, shown above, illustrates the execution of the "Clear_DTC" function (changing from OFF to ON) in Action 0. Furthermore, in the expected waveform diagram for the fifth category "Diag" from the top, during Action 1, it is shown that the fault code should be "44171".
[0050] Additionally, in the expected waveform diagram, the parameters of the response time determination function are sometimes also recorded. This function determines whether the response time is normal until the values of other parameters change with the value of a certain parameter. In this case, the string indicating the parameter (Debounce Time) used for this function is included in the parameters. For example, in... Figure 3 The expected waveform diagram shown, associated with the sixth category from the top, "RAM," displays the parameter setting for "vx_High_AD_OUT" as "4.81, Debounce Time, 80, 1" in the response time determination function. This indicates whether the response time (below 80 ms) is normal (from the time the value of the "vx_High_AD_OUT" parameter rises to "4.81" until the value of the next recorded parameter of "vx_High_AD_OUT," namely "vx_PWM_OUT," becomes "1."
[0051] [Structure of Test Case Definition Document]
[0052] Figures 4-8 It shows the basis of the above Figure 3 The test requirement document 10 shown is an example of test case 20 generated by the test case generation device 100. For example... Figure 4 As shown, test case 20 includes a data acquisition section, which is configured to retrieve the value of a parameter (e.g., "Monitor") before the specific steps of the test are executed. The data acquisition section consists of at least one row associated with a sequence number, the function that retrieves the value of the parameter, and a variable name representing the name of the parameter of the function.
[0053] And, as Figures 5-8As shown, test case 20 includes the functions executed in the test using HILS200, the parameters used in those functions, and the operational steps described in the order of execution of each function. Furthermore, test case 20 includes expected results, which includes information on whether the values of the parameters used to determine the results of the test are normal. Test case 20 is also divided into units based on test requirements 10, using actions as the unit. The lines recorded from the header line representing the action (lines containing Action 0, Action 1, etc.) to the next header line for "Expected results" are the operational steps included in the action recorded in the header line. Then, the lines recorded from the header line for "Expected results" to the header line for the next action are the evaluation criteria based on the results of performing the operational steps in the aforementioned action. Figure 5 This represents Action 0. Figure 6 This represents Action 1. Figure 7 This indicates Action2. Figure 8 This represents the row for Action 3. Actually, these rows from Action 0 to Action 3 are generated consecutively, but for ease of illustration, the diagram is divided according to each action. Additionally, in... Figures 4-8 In the text, the header row in test case 20 is highlighted with a shading.
[0054] The operation steps consist of at least one line that establishes an association with the sequence number, the function used for the operation, the variable name (Variable_Name) representing the name of the function's parameter, and the value to be set for that parameter. Furthermore, the variable name and value are set only as needed for the function that uses them. Examples of functions that serve as operation steps include "Set" for setting a parameter value, "Ramp" for changing the parameter in a ramp response based on the value, "Clear_DTC" for clearing a fault code (DTC), and "Wait" for a specified standby time. Additionally, the sequence number of the operation steps generally indicates the order of processing, but consecutive lines without a "Wait" function do not necessarily need to be processed in the sequence number order of test case 20.
[0055] The judgment criterion consists of at least one row that establishes an association between a sequence number, the function used in the value judgment, a variable name (Variable_Name) indicating the name of the parameter that is the object of judgment, and the value that should be set for that parameter. Examples of functions used for the judgment criterion include "Check_Values" which confirms that a parameter has reached a specified value, and "Check_Accuracy_Action" which confirms that the parameter's accuracy (value has not changed). Other examples of judgment criterion functions include "Check_DTC" which confirms that a fault code has been cleared, and "Check_DTC_Others_OR" which confirms that a fault code has reached a predetermined value. Furthermore, other examples of judgment criterion functions include "Compare Transition" which is a response time judgment function. Additionally, since the judgment criterion represents the judgment criteria for the test results of each action, unlike operation steps, the row sequence number does not necessarily represent the time sequence in which the judgment is performed.
[0056] [Test Case Generation Processing] The following refers to... Figures 9-14 This describes the test case generation process performed by the test case generation device 100. Each step of this test case generation process is implemented by loading and executing a program that describes the commands for test case generation.
[0057] Figure 9 This shows the overall process of test case generation.
[0058] In step 1001 (represented as S1001 in the figure, the same below), the control unit 110 reads the data from the test requirement document 10.
[0059] In step 1002, the control unit 110 executes the sub-module of the data acquisition unit setting process.
[0060] In step 1003, the control unit 110 executes the sub-module for setting the operation steps.
[0061] In step 1004, the control unit 110 executes a submodule for setting the determination criteria.
[0062] In step 1005, the control unit 110 advances the processing to the next action recorded in the test requirement document 10. Specifically, this processing scans the actions recorded in the expected waveform diagram of the test requirement document 10 along the time axis, and the right side of the next detected string "Action" is taken as the processing object of the expected waveform diagram.
[0063] In step 1006, the control unit 110 determines whether all actions have been processed. This determination can be made based on whether the string "End" is detected after sequentially scanning and processing the actions recorded in the expected waveform diagram of the test requirement document 10 along the time axis. If all actions have been processed, the entire process ends (Yes); otherwise, the process returns to step 1003 (No).
[0064] Figure 10 This refers to the processing of the data acquisition unit setting submodule executed in step 1002 of the overall processing. This processing generates the aforementioned... Figure 4 The data acquisition section shown is used for processing rows.
[0065] In step 1011, the analysis unit 111 scans the categories of the test requirement document 10 and determines whether the string "RAM" or "FLX" is identified. If the string "RAM" or "FLX" is identified, proceed to step 1012 (yes); otherwise, proceed to step 1013 (no).
[0066] In step 1012, the generation unit 112 selects the "Monitor" function as the function set in the function column of test case 20. Then, the generation unit 112 adds the row indicating the execution of the "Monitor" function to the decision criteria in the currently processed action. Specifically, the generation unit 112 adds a row with the "Monitor" function set in the function column and adds a row with variable names corresponding to the categories identified in step 1011 in the test requirements document 10 to the variable name column.
[0067] In step 1013, the analysis unit 111 determines whether the "Monitor" function has been selected in all "RAM" or "FLX" categories in the expected waveform. If selected, the data acquisition unit setting process ends (Yes); otherwise, it returns to step 1011 (No).
[0068] Figure 11 and Figure 12The process of the submodule performing the operation step setting process in step 1003 of the overall processing is shown. Furthermore, as the initial setting for this process, the scan position in the time axis direction of the expected waveform of the test requirement document 10 is set to the left end of the range of Actions that are the processing targets. Moreover, in the following description of the operation step setting process, when scanning the expected waveform, this scan position and the range to the right of that position in the time axis direction of the expected waveform become the targets. Additionally, values already identified among the parameter values recorded in the expected waveform are not considered for subsequent scans.
[0069] In step 1021, the analysis unit 111 scans the categories of the test requirement document 10. Then, it determines whether the string "HILS" is recognized. If the string "HILS" is recognized, proceed to step 1022 (Yes); otherwise, proceed to step 1026 (No).
[0070] In step 1022, the analysis unit 111 scans the range of currently processed actions in the expected waveform diagram associated with the category of the string "HILS" identified in step 1021 of the test requirements document 10. Then, the analysis unit 111 determines whether a value (not a value used for the Ramp response, such as a single-unit value) is identified within this range. If a value is identified, the process proceeds to step 1023 (Yes); otherwise, it proceeds to step 1026 (No).
[0071] In step 1023, the generation unit 112 selects the "Set" function as the function set in the function column of test case 20. Then, the generation unit 112 adds the row indicating the execution of the "Set" function to the operation steps of the currently processed action. Specifically, the generation unit 112 adds a row setting the "Set" function to the function column, adds a row setting the variable name associated with the category of the string "HILS" identified in step 1021 of the test requirements document 10 to the variable name column, and adds a row setting the value identified in step 1022 to the value column.
[0072] In step 1024, the analysis unit 111 determines whether a value for a parameter used for the Ramp response is identified within the range of the currently processed action in the expected waveform scanned in step 1022. This determination, for example, can be made if the parameter has four values, indicating that a value for the parameter used for the Ramp response has been identified. If a value for the Ramp response is identified, the process proceeds to step 1025 (Yes); otherwise, it proceeds to step 1026 (No).
[0073] In step 1025, the generation unit 112 selects the "Ramp" function as the function set in the function column of test case 20. Then, the generation unit 112 adds the row indicating the execution of the "Ramp" function to the operation steps in the currently processed action. Specifically, the generation unit 112 adds a row setting the "Ramp" function to the function column, adds a row setting the variable name associated with the category of the string "HILS" identified in step 1021 of the test requirements document 10 to the variable name column, and adds a row setting the value identified in step 1024 to the value column.
[0074] In step 1026, the analysis unit 111 determines whether the string "Diag" is identified in the categories of the test requirement document 10. If the string "Diag" is identified, proceed to step 1027 (Yes); otherwise, proceed to step 1029 (No).
[0075] In step 1027, the analysis unit 111 scans the range of currently processed actions in the expected waveform diagram associated with the category of the string "Diag" identified in step 1026, as specified in the test requirements document 10. Then, the analysis unit 111 determines whether a value is recorded within that range. If a value is recorded, it proceeds to step 1028 (Yes); otherwise, it proceeds to step 1029 (No). Furthermore, it is possible to set a value outside the target object (e.g., the string "OFF").
[0076] In step 1028, the generation unit 112 selects a function (e.g., "Clear_DTC") from the column of variable names in the test requirements document 10 that corresponds to the category of the string "Diag" identified in step 1026, as a function defined in the function column of test case 20. Then, the generation unit 112 adds a row instructing the execution of the selected function to the operation steps of the currently processed action. Specifically, the generation unit 112 appends the selected function to the function column and appends rows to the variable name column and value column, where appropriate values are set as needed, corresponding to the selected function.
[0077] In step 1029, the analysis unit 111 scans the categories of the test requirement document 10, scanning the range of currently processed actions in the expected waveform diagram associated with the categories where the strings "HILS" or "Diag" are identified. Then, if the analysis unit 111 identifies a value within this range, it moves the scan position in the time axis direction to the block containing that value (the block to the left of the value if the value is recorded across multiple blocks). If no such value is identified, the analysis unit 111 moves the scan position to the block containing the next string "Action" or "End". In this step 1029, the analysis unit 111 counts the number of blocks moved to the right in the time axis direction of the expected waveform diagram. Furthermore, if a value is identified at the same position in the time axis direction in the expected waveform diagrams of multiple parameters, this count is 0.
[0078] In step 1030, the generation unit 112 selects the "Wait" function as the function to be set in the function column of test case 20. Then, the generation unit 112 adds the row indicating the execution of the "Wait" function to the operation steps in the currently processed action. Specifically, the generation unit 112 adds a row setting the "Wait" function to the function column and adds a row setting the elapsed time based on the number of blocks moved to the right, which was counted in step 1029, to the value column. This elapsed time can be calculated by "the number of blocks moved to the right × the time per block". In addition, if the number of blocks counted in step 1029 is 0, that is, if the operation using multiple parameters is recorded at the same position on the time axis of the expected waveform, the "Wait" function is not set.
[0079] In step 1031, the analysis unit 111 determines whether the scan position in the time axis direction of the expected waveform has reached the block where the string "Action" or "End" is located; that is, whether the analysis unit 111 has scanned to the right end of the region of the currently processed action. If the block has been reached, proceed to step 1032 (Yes); otherwise, return to step 1021 (No).
[0080] In step 1032, the analysis unit 111 moves the scan position of the expected waveform in the time axis direction to the left block of the currently processed action.
[0081] Figure 13 and Figure 14 This indicates the processing of the sub-module of the determination criterion setting process executed in step 1004 of the overall processing.
[0082] In step 1041, the analysis unit 111 scans the categories of the test requirement document 10. Then, it determines whether the string "RAM" or "FLX" is identified in the category. If the string "RAM" or "FLX" is identified, proceed to step 1042 (yes); otherwise, proceed to step 1045 (no).
[0083] In step 1042, the analysis unit 111 scans the range of currently processed actions in the expected waveform diagram associated with the category of the string "RAM" or "FLX" identified in step 1041 of the test requirements document 10. Then, the analysis unit 111 determines whether a value is identified within that range. If a value is identified, it proceeds to step 1043 (Yes); otherwise, it proceeds to step 1044 (No).
[0084] In step 1043, the generation unit 112 selects the function (Check_Values) of the final decision value of the action as the function set in the function column of test case 20. Then, the generation unit 112 adds the row indicating the execution of the "Check_Values" function to the decision criteria in the currently processed action. Specifically, the generation unit 112 adds the row setting the "Check_Values" function to the function column, adds the row setting the variable name corresponding to the category of the string "RAM" or "FLX" identified in step 1041 to the variable name column, and adds the row setting the value identified in step 1042 to the value column.
[0085] In step 1044, the generation unit 112 selects a function (Check_Accuracy_Action) whose value does not change in the overall decision action as the function set in the function column of test case 20. Then, the generation unit 112 adds the row indicating the execution of the "Check_Accuracy_Action" function to the decision criteria in the currently processed action. Specifically, the generation unit 112 adds the row of the "Check_Accuracy_Action" function to the function column, adds the row of variable names associated with the category of the string "RAM" or "FLX" identified in step 1041 in the test requirements document 10 to the variable name column, and adds the row of values to the value column, which is the most recently identified value in the range of actions preceding the currently processed action in the expected waveform diagram associated with that variable name.
[0086] In step 1045, the analysis unit 111 determines whether a parameter including the string "Debounce Time" is identified in the scan of the expected waveform associated with this type. "Debounce Time" indicates the use of a response time determination function within the scope of the currently processed action. If the parameter is identified, proceed to step 1046 (Yes); otherwise, proceed to step 1047 (No).
[0087] In step 1046, the generation unit 112 selects the response time determination function (Compare Transition) as the function set in the function column of test case 20. Then, the generation unit 112 adds a row indicating the execution of the function to the determination criteria of the action in the current process. Specifically, the generation unit 112 adds a row with the "Compare Transition" function set in the function column, adds a variable name corresponding to the category of the string "RAM" or "FLX" identified in step 1041 of the test requirements document 10 and a variable name corresponding to the next category in the variable name column, and adds a row based on the value of the parameter identified in step 1045 (the variable name of the parameter of the processing object, the variable name of the next parameter, and the response time) in the value column. In addition, the response time may not be set in the value column, but in a separate column.
[0088] In step 1047, the analysis unit 111 determines whether the string "Diag" is identified in the categories of the test requirement document 10. If the string "Diag" is identified, proceed to step 1048 (yes); otherwise, proceed to step 1053 (no).
[0089] In step 1048, the analysis unit 111 scans the range of currently processed actions in the expected waveform diagram associated with the category of the string "Diag" identified in step 1047 in the test requirements document 10. Then, the analysis unit 111 determines whether a value is identified within that range. If a value is identified, proceed to step 1049 (Yes); otherwise, proceed to step 1053 (No).
[0090] In step 1049, the analysis unit 111 determines whether "Clear_DTC" is recorded in the variable name associated with the category of the string "Diag" identified in step 1047 in the test requirements document 10. If "Clear_DTC" is recorded, proceed to step 1050 (Yes); otherwise, proceed to step 1051 (No).
[0091] In step 1050, the generation unit 112 selects the function (Check_DTC) that confirms the fault code has been cleared as the function set in the function column of test case 20. Then, the generation unit 112 adds a row indicating that the function has been executed to the decision criteria of the action in the current process. Specifically, the generation unit 112 adds a row with the "Check_DTC" function set in the function column and adds a row with "NA" indicating that the value has been cleared in the value column.
[0092] In step 1051, the analysis unit 111 determines whether "Read_DTC_Pcode" is recorded in the variable name associated with the category of the string "Diag" identified in step 1047 in the test requirements document 10. If "Read_DTC_Pcode" is recorded, proceed to step 1052 (Yes); otherwise, proceed to step 1053 (No).
[0093] In step 1052, the generation unit 112 selects the function (Check_DTC_Others_OR) that confirms the fault code as a specified value as the function set in the function column of test case 20. Then, the generation unit 112 adds the row indicating the execution of the function to the operation steps of the action in the current process. Specifically, the generation unit 112 adds a row setting the "Check_DTC_Others_OR" function to the function column and adds a row setting the value identified by the scan in step 1048 to the value column.
[0094] In step 1053, the analysis unit 111 determines whether a determination function has been selected in all categories of "RAM", "FLX", or "Diag" in the expected waveform diagram. If selected, the determination criterion setting process ends (Yes); otherwise, it returns to step 1041 (No).
[0095] [Specific examples of test case generation and processing]
[0096] Here, a specific example is given to illustrate how to generate test case book 20 based on the expected waveform diagram of test requirement book 10, particularly the operation step setting process and the judgment benchmark setting process in the above test case generation process.
[0097] Figure 15 It is aimed at Figure 3 The test requirement document 10, exemplified as Action 0 and Action 1, explicitly shows the blocks for each specified time and the elapsed time within the expected waveform diagram. The following is a specific example of the test case generation process. Figure 11 Test Requirements Document 10 and Figure 5 and Figure 6The following explanation will be based on Action 0 and Action 1 from Test Case Book 20.
[0098] <Action 0 Operation Step Setting Processing>
[0099] First of all, Figure 11 In the test requirement document 10 shown, the value of the parameter for the first category "HILS" from the top is recorded as "12" in the first block of the expected waveform diagram. Therefore, the generation unit 112 sets the function to "Set", the variable name to "Battery_Vol", and the value to "12", and generates... Figure 5 The first line of the operation steps in test case 20.
[0100] Next, in Test Requirements 10, the value of the parameter for the second category "HILS" from the top is recorded as "1" in the first block of the expected waveform. Therefore, Generation Unit 112 sets the function to "Set", the variable name to "IGNSW", and the value to "1", and generates... Figure 5 The second line of the operation steps for test case 20.
[0101] Next, in Test Requirements 10, the value of the parameter for the third category from the top, "HILS," is recorded as "2.5" in the first block of the expected waveform diagram. Therefore, Generation Unit 112 sets the function to "Set," the variable name to "Current_High," and the value to "2.5," and generates... Figure 5 The third line of the operation steps for test case 20.
[0102] Next, in test requirement 10, the value of the parameter for the fourth category "Diag" from the top is recorded as "ON" in the fourth block of the expected waveform diagram. Here, in this expected waveform diagram, one block corresponds to 0.5 seconds. Therefore, generation unit 112 first sets the function to "Wait" and the value to "2" (0.5 seconds × 4 blocks), generating... Figure 5 The fourth line of the operation steps for test case 20. Based on this, since the variable name in the fourth category from the top, "Diag", is recorded as "Clear_DTC", the generation unit 112 sets the function to "Clear_DTC" and generates... Figure 5 The fifth line of the operation steps for test case 20. Furthermore, in the expected waveform diagram, there are eight blocks from the execution of "Clear_DTC" to the end of Action 0, without recording the values of other parameters. Therefore, the generation unit 112 sets the function to "Wait" and the value to "4" (0.5 seconds × 8 blocks), generating... Figure 5 The sixth line of the operation steps for test case 20.
[0103] <Decision Criteria Setting and Processing for Action 0>
[0104] In Test Requirements 10, the value of the parameter in the sixth category from the top, "RAM," is recorded as "2.5" in Action0 of the expected waveform. Therefore, Generation Unit 112 sets the function to "Check_Values," the variable name to "vx_High_AD_OUT," and the value to "2.5," and generates... Figure 5 The first line of the decision criteria for test case 20.
[0105] Next, in the test requirement document 10, the value of the parameter in the seventh category from the top, "RAM," is recorded as "3" in Action 0 of the expected waveform. Therefore, the generation unit 112 sets the function to "Check_Values," the variable name to "vx_PWM_OUT," and the value to "3," and generates... Figure 5 The second row of the decision criteria for test case 20.
[0106] Next, in test requirement 10, the value of the parameter for the eighth category from the top, "FLX," is recorded as "3" in Action 0 of the expected waveform. Therefore, generation unit 112 sets the function to "Check_Values," the variable name to "State_Number_Output," and the value to "3," and generates... Figure 5 The third line of the decision criteria for test case 20.
[0107] Here, in Test Requirements 10, the value of the parameter for the fourth category from the top, "Diag," is recorded as "ON" in the fourth block of the expected waveform diagram, and as "Clear_DTC" in the variable name column. Therefore, Generation Unit 112 sets the function to "Check_DTC," sets the value to "NA," and generates... Figure 5 The fourth line of the decision criteria for test case 20.
[0108] <Action 1 Operation Step Setting Processing>
[0109] In Test Requirements 10, the values of the parameters for the third category from the top, "HILS," are recorded as "2.5, 5, 0.1, 0.1" in the first block of the expected waveform diagram. Therefore, Generation Unit 112 sets the function to "Ramp," the variable name to "Current_High," and the values to "2.5, 5, 0.1, 0.1," and generates... Figure 6 The first line of the operation steps in test case 20.
[0110] Next, in test requirement 10, the value of the parameter for the fifth category from the top, "Diag," is recorded as "44171" in the fourth block of the expected waveform diagram starting from the execution of the Ramp function. Therefore, generation unit 112 first sets the function to "Wait," sets the value to "2" (0.5 seconds × 4 blocks), and generates... Figure 5 The second line of the operation steps for test case 20. Based on this, since the variable name in the fifth category from the top, "Diag", is recorded as "Read_DTC_Pcode", the generation unit 112 sets the function to "Read_DTC_Pcode" and generates... Figure 6 The third line of the operation steps for test case 20. Furthermore, in the expected waveform diagram, there are four blocks from the execution of "Read_DTC_Pcode" to the end of Action1, without recording the values of other parameters. Therefore, the generation unit 112 sets the function to "Wait" and the value to "2" (0.5 seconds × 4 blocks), generating... Figure 6 The fourth line of the operation steps for test case 20.
[0111] <Setting the Judgment Criteria for Action 1>
[0112] In test requirement 10, the value of the parameter in the seventh category from the top, "RAM," is recorded as "1" in Action 1 of the expected waveform. Therefore, generation unit 112 sets the function to "Check_Values," the variable name to "vx_PWM_OUT," and the value to "1," generating... Figure 6 The first line of the decision criteria for test case 20.
[0113] Next, in test requirement 10, the value of the parameter for the eighth category from the top, "FLX," is recorded as "5" in Action 1 of the expected waveform. Therefore, generation unit 112 sets the function to "Check_Values," the variable name to "State_Number_Output," and the value to "5," and generates... Figure 6 The second row of the decision criteria for test case 20.
[0114] Next, in test requirement 10, the value of the parameter for the fifth category from the top, "Diag," is recorded as "44171" in Action 1 of the expected waveform. Then, since the variable name for this category "Diag" is recorded as "Read_DTC_Pcode," the generation unit 112 sets the function to "Check_DTC_Others_OR," sets the value to "44171," and generates... Figure 6 The third line of the decision criteria for test case 20.
[0115] Furthermore, in Action 1, the expected waveform diagram of the parameters in the sixth category from the top, "RAM," records the value of "4.81, Debounce Time, 80, 1," which is a parameter used as the response time determination function. Therefore, the generation unit 112 sets the function to "Compare Transition," sets the variable names to "vx_High_AD_OUT, vx_PWM_OUT," and sets the value to "4.81, 1 80 (ms)," generating... Figure 6 The fourth line of the decision criteria for test case 20.
[0116] Regarding Action 1 and Action 2, the specific examples are omitted, but like the specific examples above, the processing can be set through operation steps and judgment criteria, and test case book 20 can be generated according to test requirement book 10.
[0117] [Effects, variations, etc. of this embodiment]
[0118] In the product development process, the testing of product operation to verify its functionality has become increasingly demanding due to the increased number of test items resulting from system complexity in recent years. This has led to a tendency for increased testing workload and longer overall testing time. Against this backdrop, according to this embodiment, in the testing of the electronic control device 300 performed by the HILS200, a test case book 20 is automatically generated based on information recorded in the expected waveform diagram of the test requirements document 10. Therefore, the time required for designers to create the test case book 20 based on the test requirements document 10 is significantly reduced. As a result, the overall testing time is also shortened.
[0119] Furthermore, according to this embodiment, compared to manually creating the test case book 20 based on the test requirements document 10, human error can be reduced. Therefore, the accuracy of the test cases 20 can also be improved.
[0120] Furthermore, according to this embodiment, even when the test is divided into multiple actions, test cases 20 that can verify the test results for each action can be generated. Additionally, while the above embodiment describes the generation of a test case book 20 that includes multiple actions, conversely, it is also possible to generate a test case book 20 that includes only one action.
[0121] Furthermore, according to this embodiment, even when the test content includes a ramp function or a response time determination function, test cases 20 that appropriately describe the steps and determination criteria are generated. Moreover, as in the example of the "Diag" category, even when performing both the operation to clear fault codes and the subsequent verification of setting expected values for those fault codes, test cases 20 that describe both the sequence and determination criteria are generated.
[0122] Furthermore, in this embodiment, the elapsed time in the time axis direction is determined based on the number of blocks divided at predetermined time intervals. However, this method is merely one example; even if the waveform is not expected to be divided into blocks, the elapsed time can still be determined based on the length in the time axis direction.
[0123] Furthermore, when selecting functions to be used in the operation steps or in the judgment criteria, the generation unit 112 may refer to a library that associates the functions to be selected with conditions such as the type of parameters, information recorded in the variable names, and the presence or absence of values in the expected waveform. Data from such a library can be stored, for example, in a storage unit provided by the test case generation device 100 or in an external storage unit accessible from the test case generation device 100.
[0124] Furthermore, while illustrations and explanations are omitted in this embodiment, if the test requirement document 10 includes information indicating the unit of each parameter's value, the unit information may also be included in the line corresponding to that parameter in the test case document 20. Additionally, the unit of the parameter's value may, for example, be seconds or microseconds (representing time), or volts (V) (representing voltage), depending on the nature of the parameter's value.
[0125] Furthermore, the functions listed in the category and variable name columns of Test Requirements Document 10 are not limited to those exemplified in the above description. In the data acquisition unit setting process, operation step setting process, and judgment criterion setting process described in this embodiment, the following further processing can be performed: conditions based on the category, variable name, and values within the expected waveform are further set, and a predetermined function is set when these conditions are met.
[0126] [Hardware structure of the test case generation device]
[0127] Figure 16 An example of the hardware structure of the computer constituting the test case generation apparatus 100 in this embodiment is shown. The test case generation apparatus 100 includes a processor 910, a memory 920, a memory 930, a removable storage medium drive 940, an input / output device 950, and a communication interface 960.
[0128] The processor 910 includes a control unit, an arithmetic unit, and a command decoder. The execution unit, following the commands interpreted by the command decoder and based on control signals output by the control unit, uses the arithmetic unit to perform arithmetic / logical operations. The processor 910 includes a control register for storing various control information and a cache for temporarily storing accessed memory 920. Alternatively, the processor 910 may also have a structure with multiple CPU (Central Processing Unit) cores.
[0129] The memory 920 is a storage device such as RAM (Random Access Memory), which is the main memory that loads the program executed by the processor 910 and stores the data used in the processing of the processor 910. The memory 930 is a storage device such as HDD (Hard Disk Drive) or flash memory, which stores programs and various data. The removable storage medium drive 940 is a device for reading data and programs stored in the removable storage medium 970. The removable storage medium 970 is, for example, a magnetic disk, optical disk, optical disc, or flash memory. Furthermore, the processor 910 cooperates with the memory 920 and the memory 930 to execute the program stored in the memory 930 and the removable storage medium 970. Additionally, the program executed by the processor 910 and the data accessed can also be stored in other devices capable of communicating with this information processing device. For example, the test requirement document 10 and the test case document 20 can be stored in the memory 930 provided by the test case generation device 100. On the other hand, the test requirement document 10 and the test case document 20 can also be stored in the memory of other devices. In this case, the data can be accessed from the test case generation device 100 via communication. Furthermore, the test requirements document 10 and the test case document 20 can also be stored on the removable storage medium 970.
[0130] The input / output device 950, such as a touch panel, keyboard, or display, is an input unit that receives action commands based on user operations and outputs the processing results from the information processing device. The communication interface 960, in addition to a communication module and a LAN (local area network) card, includes a radio frequency receiver and transmitter, as well as an optical receiver and transmitter, enabling data communication with external devices. All components of the aforementioned information processing device are connected via a bus 980.
[0131] Furthermore, those skilled in the art can readily understand that new implementation methods can be generated by omitting a part of the technical ideas of the various embodiments described above, appropriately combining a part of the technical ideas, or replacing a part of the technical ideas with known technologies.
[0132] Explanation of reference numerals in the attached figures
[0133] 10: Test Requirements Document; 20: Test Case Document; 100: Test Case Generation Device; 200: HILS (Verification Device); 111: Analysis Department; 112: Generation Department.
Claims
1. A test case generation apparatus for generating a test case book, the test case book defining the steps for performing tests in a verification apparatus and the criteria for judging the results of tests performed according to the steps, the test case generation apparatus comprising: The analysis unit reads in the test requirements document, which includes the categories of parameters used in the test and waveforms representing the time-varying values of those parameters; and analyzes the values of those parameters and the timing of their changes; and The generation unit selects a function to set the value of a parameter that is identified as an input value of the test according to the category, and determines the step of executing the function based on the timing of the parameter's value change. On the other hand, for a parameter that is identified as an output value of the test according to the category, it selects a function to determine whether the value of the parameter is the expected value, determines the determination criterion for which the function is used, and generates a test case book including the determined steps and the determination criterion.
2. The test case generation device according to claim 1, wherein, In the waveform diagram, at the position corresponding to the timing of the parameter's value change along the time axis, a string or numerical value representing the parameter's value is recorded. The analysis unit analyzes the timing of changes in the parameter value based on the position of the string or numerical value identified in the waveform diagram.
3. The test case generation device according to claim 1, wherein, The waveform is divided into multiple stages according to a specified benchmark. The analysis unit analyzes the value of the parameter and the timing of its changes for each stage. The generation unit generates a test case book that sets the steps and the judgment criteria for each stage.
4. The test case generation device according to claim 1, wherein, In the waveform diagram, at the timing point where the ramp function should be executed, four values are recorded: the value of the parameter before and after the change, the magnitude of the change, and the time of the change. When the parameter set in the waveform diagram has four values, the generation unit selects a ramp function.
5. The test case generation device according to claim 1, wherein, In the waveform diagram, at the timing position where the response time determination function should be executed, a string representing the response time determination function is recorded. This function determines whether a response time is normal until the values of other variables change along with the value of a certain variable. When the value of the parameter set in the waveform diagram includes a string representing the response time determination function, the generation unit selects the response time determination function.
6. The test case generation apparatus according to claim 1, wherein, The waveform is divided into blocks at regular intervals, at least along the time axis. The analysis unit identifies the time during which the parameter value is maintained or the time until the parameter value changes, based on the number of blocks along the time axis of the waveform.
7. The test case generation apparatus according to claim 1, wherein, The verification device verifies the operation of the electronic control devices mounted on the vehicle. The waveform diagram represents the time-varying values of parameters assuming the vehicle is in a faulty state.
8. A test case generation method, comprising generating a test case book, wherein the test case book defines the steps for performing tests in a verification device and the criteria for judging the results of the tests performed according to the steps, and the method comprises executing the following steps by a computer: The process of reading in a test requirement document that includes the categories of parameters used in the test and waveforms showing the time-varying values of those parameters, and analyzing the values of those parameters and the timing of their changes; For a parameter that is identified as an input value of the test according to the category, a function is selected to set the value of the parameter, and the step of executing the function is determined based on the timing of the change in the value of the parameter. On the other hand, for a parameter that is identified as an output value of the test according to the category, a function is selected to determine whether the value of the parameter is the expected value, the determination criterion for using the function is determined, and a test case book including the determined steps and the determination criterion is generated.
Citation Information
Patent Citations
Test execution system, test execution device, test execution method, and test execution program
JP2015049659A