Test case generation method, device and system and storage medium
By extracting signal information and assignment rules from the requirements document and automatically generating test cases, the problem of long and high cost of writing test cases in the existing technology is solved, and the effect of improving the efficiency of writing test cases is achieved.
Patent Information
- Application Number
- CN202310944405.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, the test cases for vehicle control performance have a long cycle and high cost, making it difficult to improve the efficiency of test cases.
By obtaining the requirements document containing vehicle control requirements, extracting the conditional expressions and action expressions in the assignment rules, the signal value intervals are automatically extracted, and the target test cases are generated.
No need for developers to manually write test cases, directly obtain information from the requirements document and automatically generate test cases, shortening the test case writing cycle and improving writing efficiency.
Smart Images

Figure CN119441014A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle control technology, and in particular to a test case generation method, device, system and storage medium. Background Art
[0002] With the development of vehicle automation, vehicle control performance is becoming more and more important, which not only affects the user experience, but also affects the safety of vehicle operation. At present, the test of vehicle control performance is usually tested by using test cases. Among them, a test case is a test model of a set of test inputs and expected results compiled for a special goal under specific execution conditions, so as to realize the test function of whether the operation result obtained by a certain input information meets the expected result under the set execution conditions. Existing test cases often require testers to write vehicle control requirement documents, and then specialized developers write corresponding test cases based on the requirement documents, resulting in a long test case writing cycle and high cost.
[0003] Therefore, how to provide a test case generation method to improve the efficiency of test case writing has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a test case generation method, device, system and storage medium to improve the efficiency of test case writing.
[0005] The present application provides a test case generation method, comprising:
[0006] Obtain requirements document containing vehicle control requirements;
[0007] Acquire signal information corresponding to the vehicle control requirement from the requirement document, and acquire an assignment rule corresponding to the vehicle control requirement from the requirement document, wherein the assignment rule includes a conditional expression and an action expression;
[0008] Extracting the signal value interval of the signal information corresponding to the vehicle control demand through the conditional expression and the action expression in the assignment rule;
[0009] Generate a target test case containing the signal value interval.
[0010] The beneficial effects of the present application are: obtaining a requirement document containing vehicle control requirements; obtaining the signal information corresponding to the vehicle control requirements and the corresponding assignment rules from the requirement document, wherein the assignment rules contain conditional expressions and action expressions; then, extracting the signal value interval of the signal information corresponding to the vehicle control requirements through the conditional expressions and action expressions in the assignment rules; and then automatically generating a target test case containing the signal value interval. Since the signal information and the corresponding assignment rules can be directly obtained from the vehicle control requirement document, and the signal value interval can be automatically extracted to generate a test case, there is no need for developers to manually write test cases, which shortens the test case writing cycle and improves the test case writing efficiency.
[0011] In one embodiment, the acquiring signal information corresponding to the vehicle control requirement from the requirement document includes:
[0012] Extracting first signal information contained in the requirement document;
[0013] Converting characters in the first signal information into characters in a preset format to obtain second signal information;
[0014] Obtain at least one of the following attribute items in the second signal information:
[0015] Signal statement, signal name, signal enumeration value, signal domain value;
[0016] The attribute items are combined into signal information corresponding to the vehicle control requirement.
[0017] In one embodiment, the step of obtaining the assignment rule corresponding to the vehicle control requirement from the requirement document includes:
[0018] Obtaining the original assignment rule in the requirement document;
[0019] The original assignment rules in the requirement document are converted into assignment rules corresponding to the vehicle control requirements.
[0020] In one embodiment, converting the original assignment rule in the requirement document into an assignment rule corresponding to the vehicle control requirement includes:
[0021] Standardizing the original assignment rule;
[0022] Extract the conditional expressions and action expressions in the standardized original assignment rules;
[0023] Generate an assignment rule corresponding to the vehicle control demand including the conditional expression and the action expression.
[0024] In one embodiment, the standardizing the original assignment rule includes:
[0025] The special characters in the original assignment rules are standardized, the logical relationship words in the original assignment rules are converted into preset words with the same meaning as the logical relationship words, and the Chinese operators in the original assignment rules are converted into standard operators.
[0026] In one embodiment, the signal information includes information of an input signal and information of an output signal, and the signal value interval of the signal information corresponding to the vehicle control requirement is extracted through a conditional expression and an action expression in an assignment rule, including:
[0027] When the signal information is an input signal, and the signal domain value defined by the input signal is a discrete value, a traversal operation is performed on the discrete value through a conditional expression in an assignment rule;
[0028] A value among the discrete values that matches the conditional expression is determined as a signal value interval of the signal information corresponding to the vehicle control requirement.
[0029] In one embodiment, the method further comprises:
[0030] Get the target test case;
[0031] Generate a configuration file containing the target test cases.
[0032] The present application also provides a test case generation device, comprising:
[0033] A first acquisition module is used to acquire a requirement document including vehicle control requirements;
[0034] A second acquisition module is used to acquire signal information corresponding to the vehicle control requirement from the requirement document, and acquire an assignment rule corresponding to the vehicle control requirement from the requirement document, wherein the assignment rule includes a conditional expression and an action expression;
[0035] An extraction module, used to extract the signal value interval of the signal information corresponding to the vehicle control demand through the conditional expression and the action expression in the assignment rule;
[0036] A generation module is used to generate a target test case containing the signal value interval.
[0037] In one embodiment, the second acquisition module includes:
[0038] An extraction submodule, used to extract the first signal information contained in the requirement document;
[0039] A first conversion submodule, used for converting characters in the first signal information into characters in a preset format to obtain second signal information;
[0040] The first acquisition submodule is configured to acquire at least one of the following attribute items in the second signal information:
[0041] Signal statement, signal name, signal enumeration value, signal domain value;
[0042] The combining submodule is used to combine the attribute items into signal information corresponding to the vehicle control demand.
[0043] In one embodiment, the second acquisition module includes:
[0044] A second acquisition submodule is used to acquire the original assignment rules in the requirement document;
[0045] The second conversion submodule is used to convert the original assignment rules in the requirement document into assignment rules corresponding to the vehicle control requirements.
[0046] In one embodiment, the second conversion submodule is further used for:
[0047] Standardizing the original assignment rule;
[0048] Extract the conditional expressions and action expressions in the standardized original assignment rules;
[0049] Generate an assignment rule corresponding to the vehicle control demand including the conditional expression and the action expression.
[0050] In one embodiment, the standardizing the original assignment rule includes:
[0051] The special characters in the original assignment rules are standardized, the logical relationship words in the original assignment rules are converted into preset words with the same meaning as the logical relationship words, and the Chinese operators in the original assignment rules are converted into standard operators.
[0052] In one embodiment, the signal information includes information of input signals and information of output signals, and the extraction module includes:
[0053] When the signal information is an input signal, and the signal domain value defined by the input signal is a discrete value, a traversal operation is performed on the discrete value through a conditional expression in an assignment rule;
[0054] A value among the discrete values that matches the conditional expression is determined as a signal value interval of the signal information corresponding to the vehicle control requirement.
[0055] In one embodiment, the apparatus further comprises:
[0056] The third acquisition module is used to acquire the target test case;
[0057] The generation module is also used to generate a configuration file containing the target test case.
[0058] The present application also provides a test case generation system, comprising:
[0059] at least one processor; and,
[0060] a memory communicatively connected to the at least one processor; wherein,
[0061] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the test case generation method recorded in any of the above embodiments.
[0062] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the test case generation system, the test case generation system can implement the test case generation method recorded in any of the above embodiments.
[0063] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0064] The technical solution of the present application is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0066] Figure 1 A flowchart of a test case generation method in one embodiment of the present application;
[0067] Figure 2 A schematic diagram of a requirement document for vehicle control requirements in an embodiment of the present application;
[0068] Figure 3 A block diagram of a test case generating device in one embodiment of the present application;
[0069] Figure 4 A schematic diagram of the hardware structure of a test case generation system in one embodiment of the present application. DETAILED DESCRIPTION
[0070] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application.
[0071] This article provides a solution for automatically generating test cases by extracting vehicle control rules in natural language from requirement documents, including input and output signal extraction, control logic extraction, and signal value range sampling. Then, the solution is combined with automatic test case generation to shorten the test case writing process and improve the test case writing efficiency.
[0072] Figure 1 Flow chart of a test case generation method in one embodiment of the present application, such as Figure 1 As shown, the method can be implemented as the following steps S101-S104:
[0073] In step S101, a requirement document including vehicle control requirements is obtained;
[0074] In step S102, signal information corresponding to the vehicle control requirement is obtained from the requirement document, and an assignment rule corresponding to the vehicle control requirement is obtained from the requirement document, wherein the assignment rule includes a conditional expression and an action expression;
[0075] In step S103, the signal value interval of the signal information corresponding to the vehicle control demand is extracted through the conditional expression and the action expression in the assignment rule;
[0076] In step S104, a target test case including the signal value interval is generated.
[0077] In this application, a requirement document containing vehicle control requirements is obtained; first, a user Token is obtained, and then a third-party API (application programming interface) is accessed based on the user Token to obtain a specific requirement document from the knowledge base, and the requirement details in the requirement table are extracted from the requirement document. Figure 2 This is a schematic diagram of a requirement document for vehicle control requirements in one embodiment of the present application, such as Figure 2 As shown, the requirement document includes three parts: requirement definition, input signal and output signal. The requirement definition includes the correspondence between the test logic of the test case and the input and output values. The input signal includes the input signal name, signal value type and signal value range of the test case. The output signal includes the output signal name, signal value type and signal value range of the test case.
[0078] After the requirement document is obtained, signal information corresponding to the vehicle control requirement is obtained from the requirement document, and an assignment rule corresponding to the vehicle control requirement is obtained from the requirement document, wherein the assignment rule includes a conditional expression and an action expression.
[0079] When acquiring the signal information corresponding to the vehicle control requirement from the requirement document, the first signal information contained in the requirement document is extracted, that is, the original signal information in the requirement document is extracted, such as Figure 2 As shown, the input signal and output signal parts are extracted. Secondly, the characters in the first signal information are converted into characters in a preset format to obtain the second signal information. Specifically, the special characters in the first signal information are removed, such as uniformly replacing Chinese full-width and half-width symbols and English symbols, unifying units, removing useless information, and unifying redundant expressions, etc., so as to convert the first signal into a second signal information with a unified format. Then, at least one of the following attribute items in the second signal information is obtained: signal statement, signal name, signal enumeration value, signal domain value; as Figure 2 As shown, the signal statement "RESts_Inner (M) Range Extender Working Status (X Platform)" can be extracted; the signal name can be extracted: RESts_Inner; the signal enumeration value can be extracted: such as: {0x0: Off, 0x1: Start, 0x2: Run, 0x3: Stop, 0x4: Stall}; the signal range can be extracted: the signal value range of the RESCur signal can be [-2500, 2500]. Finally, the attribute items are combined into the signal information corresponding to the vehicle control demand. Specifically, the combined signal information can be expressed in the form of a table, for example, it can be expressed in the form of the following Table 1.
[0080] Table 1 Signal information table corresponding to vehicle control requirements
[0081]
[0082] When obtaining the assignment rules corresponding to the vehicle control requirements from the requirement document, the original assignment rules in the requirement document can be obtained; the original assignment rules in the requirement document are converted into the assignment rules corresponding to the vehicle control requirements. Specifically, when converting the original assignment rules in the requirement document into the assignment rules corresponding to the vehicle control requirements, the original assignment rules can be standardized; the conditional expressions and action expressions in the standardized original assignment rules are extracted; and the assignment rules corresponding to the vehicle control requirements containing the conditional expressions and action expressions are generated.
[0083] When standardizing the original assignment rules, the special characters in the original assignment rules are standardized, the logical relationship words in the original assignment rules are converted into preset words with the same meaning as the logical relationship words, and the Chinese operators in the original assignment rules are converted into standard operators.
[0084] The conditional expressions and action expressions contained in the assignment rules are explained through the following examples:
[0085] For example, in the assignment rule, there is a statement like this: if a==1&&b==2, then c=3, otherwise c=4. Then "a==1&&b==2" between the logical conjunctions if and then is a conditional expression, and "c=3" and "c=4" are action expressions.
[0086] After obtaining the signal information corresponding to the vehicle control requirement from the requirement document and obtaining the assignment rule corresponding to the vehicle control requirement from the requirement document, the signal value interval of the signal information corresponding to the vehicle control requirement is extracted through the conditional expression and action expression in the assignment rule.
[0087] Specifically, when the signal information is an input signal and the signal domain value defined by the input signal is a discrete value, the discrete value is traversed through the conditional expression in the assignment rule; and the value in the discrete value that matches the conditional expression is determined to be the signal value interval of the signal information corresponding to the vehicle control requirement.
[0088] In addition, it should be noted that when the signal information is an input signal and the signal domain value defined by the input signal is a value range, the span of the value range can be obtained. When the span of the value range is small, the value range can also be traversed through the conditional expression in the assignment rule to filter out signal values that meet the conditional expression as the signal value range of the signal information corresponding to the vehicle control requirement.
[0089] Since the ultimate goal of this application is only to generate test cases to test whether the architecture functions normally, only a limited number of test cases are needed to complete the test, and there is no need to exhaustively list all situations. When the span of the value interval is large, if it is traversed, a large number of test cases will be generated, which does not meet the original intention of the test. Therefore, when the span of the value interval is large, the maximum value, second largest value, middle value, second smallest value and minimum value of the value interval can be taken as the signal value interval of the signal information corresponding to the vehicle control demand, wherein the span size of the value interval can be measured by the number of integers in the value interval. That is to say, when the signal information is an input signal, and the signal domain value defined by the input signal is a value interval, the method can also be implemented as the following steps:
[0090] When the number of integers in the value interval is less than a preset number, the value interval is traversed through the conditional expression in the assignment rule, and the signal values that meet the conditional expression are screened out as the signal value interval of the signal information corresponding to the vehicle control demand.
[0091] When the number of integers in the value interval is greater than a preset number, the maximum value, the second largest value, the middle value, the second smallest value and the minimum value of the value interval are determined as the signal value interval of the signal information corresponding to the vehicle control demand.
[0092] Specifically, at least one intermediate value may be determined by at least one of the following formulas:
[0093] Middle value = minimum value + (maximum value - minimum value) / 2;
[0094] Middle value = maximum value - (maximum value - minimum value) / 2.
[0095] It should also be noted that when the value interval corresponding to the signal domain value is open or closed, or when the value interval corresponding to the signal domain value has multiple non-continuous value intervals, the generated value may fall outside the interval. Therefore, after calculating the maximum value, second largest value, middle value, second smallest value and minimum value, a secondary judgment is required to determine whether these values fall outside the interval. If they fall outside the interval, they are discarded. If they fall within the interval, they are used as the signal value interval of the signal information corresponding to the vehicle control requirement.
[0096] After extracting the signal value interval of the signal information corresponding to the vehicle control requirement through the conditional expression and the action expression in the assignment rule, a target test case containing the signal value interval is generated, and the target test case mainly includes each signal value interval. In this way, the construction of the test case is completed. In addition, after the target test case is generated, a configuration file containing the target test case and the action expression can be generated to realize the automatic running of the test case on the device.
[0097] The beneficial effects of the present application are: obtaining a requirement document containing vehicle control requirements; obtaining the signal information corresponding to the vehicle control requirements and the corresponding assignment rules from the requirement document, wherein the assignment rules contain conditional expressions and action expressions; then, extracting the signal value interval of the signal information corresponding to the vehicle control requirements through the conditional expressions and action expressions in the assignment rules; and then automatically generating a target test case containing the signal value interval. Since the signal information and the corresponding assignment rules can be directly obtained from the vehicle control requirement document, and the signal value interval can be automatically extracted to generate a test case, there is no need for developers to manually write test cases, which shortens the test case writing cycle and improves the test case writing efficiency.
[0098] In one embodiment, the step S102 of acquiring the signal information corresponding to the vehicle control requirement from the requirement document may be implemented as the following steps A1-A4:
[0099] In step A1, extracting first signal information contained in the requirement document;
[0100] In step A2, characters in the first signal information are converted into characters in a preset format to obtain second signal information;
[0101] In step A3, at least one of the following attribute items in the second signal information is obtained:
[0102] Signal statement, signal name, signal enumeration value, signal domain value;
[0103] In step A4, the attribute items are combined into signal information corresponding to the vehicle control requirement.
[0104] In this embodiment, the first signal information contained in the requirement document is extracted, that is, the original signal information in the requirement document is extracted, such as Figure 2 As shown, the input signal and output signal parts are extracted.
[0105] Secondly, the characters in the first signal information are converted into characters in a preset format to obtain the second signal information. Specifically, the special characters in the first signal information are removed, such as replacing Chinese full-width and half-width symbols and English symbols, unifying the units, removing useless information, and unifying redundant expressions, thereby converting the first signal into the second signal information with a unified format.
[0106] Then, at least one of the following attribute items in the second signal information is obtained: signal statement, signal name, signal enumeration value, signal domain value; Figure 2 As shown, the signal statement "RESts_Inner (M) Range Extender Working Status (X Platform)" can be extracted; the signal name can be extracted: RESts_Inner; the signal enumeration value can be extracted: such as: {0x0: Off, 0x1: Start, 0x2: Run, 0x3: Stop, 0x4: Stall}; the signal range can be extracted: the signal value range of RESSCur signal is [-2500, 2500].
[0107] Finally, as shown in Table 1, the attribute items are combined into signal information corresponding to the vehicle control demand.
[0108] Table 1 Signal information table corresponding to vehicle control requirements
[0109]
[0110]
[0111] In one embodiment, the step S102 of obtaining the assignment rule corresponding to the vehicle control requirement from the requirement document may be implemented as the following steps B1-B2:
[0112] In step B1, the original assignment rule in the requirement document is obtained;
[0113] In step B2, the original assignment rules in the requirement document are converted into assignment rules corresponding to the vehicle control requirements.
[0114] In this embodiment, the original assignment rules in the requirement document are obtained, that is, the original assignment rules described in the requirement definition are extracted from the requirement document. Then, the original assignment rules in the requirement document are converted into assignment rules corresponding to the vehicle control requirements, that is, formalized into assignment rules that can be understood by a computer.
[0115] In one embodiment, the above step B2 may be implemented as the following steps B21-B23:
[0116] In step B21, the original assignment rule is standardized;
[0117] In step B22, the conditional expression and action expression in the standardized original assignment rule are extracted;
[0118] In step B23, an assignment rule corresponding to the vehicle control requirement including the conditional expression and the action expression is generated.
[0119] In one embodiment, the above step B21 may be implemented as follows:
[0120] The special characters in the original assignment rules are standardized, the logical relationship words in the original assignment rules are converted into preset words with the same meaning as the logical relationship words, and the Chinese operators in the original assignment rules are converted into standard operators.
[0121] like Figure 2As shown, since the vehicle control requirement rules in the requirement document are written by testers in natural language, there are inconsistencies in the terms, and the original assignment rules need to be standardized. Specifically, it includes standardizing the special characters in the original assignment rules, such as uniformly replacing Chinese full-width and half-width symbols and English symbols; it also includes converting the logical relationship words in the original assignment rules into preset words with the same meaning as the logical relationship words, such as converting "when, if" to "if", "not for" to "not equal to", "not meeting the above conditions" to "otherwise", etc.; in addition, it also includes converting the Chinese operators in the original assignment rules into standard operators, for example, converting Chinese operators such as "greater than or equal to" and "less than or equal to" into standard operators.
[0122] For example, when standardizing the special characters in the original assignment rules, Chinese full-width and half-width symbols and English symbols can be uniformly replaced. For another example, when converting the logical relationship words in the original assignment rules into preset words with the same meaning as the logical relationship words, "when" and "if" can be uniformly converted into the preset word "if"; "not for", "not" and the like are converted into the preset word "not equal to"; "does not meet the above conditions" is converted into the preset word "otherwise"; for another example, when converting the Chinese operators in the original assignment rules into standard operators, "the value of xxx is 1 or 2 or 3" can be converted into xxx==1||xxx==2||xxx==3.
[0123] In one embodiment, the signal information includes information of the input signal and information of the output signal. The above step S103 can be implemented as the following steps C1-C2:
[0124] In step C1, when the signal information is an input signal, and the signal domain value defined by the input signal is a discrete value, a traversal operation is performed on the discrete value through a conditional expression in an assignment rule;
[0125] In step C2, it is determined that the value matching the conditional expression in the discrete values is a signal value interval of the signal information corresponding to the vehicle control requirement.
[0126] In one embodiment, the method can also be implemented as the following steps D1-D2:
[0127] In step D1, a target test case is obtained;
[0128] In step D2, a configuration file including the target test case is generated.
[0129] In this embodiment, the generated target test case is obtained, and then, according to the requirements of the case execution engine, a configuration file containing the target test case is generated, for example, an ini (initialization file) file is generated.
[0130] Figure 3 A block diagram of a test case generating device in one embodiment of the present application is shown in FIG. Figure 3 As shown, the device comprises:
[0131] A first acquisition module 301 is used to acquire a requirement document including vehicle control requirements;
[0132] A second acquisition module 302 is used to acquire signal information corresponding to the vehicle control requirement from the requirement document, and acquire an assignment rule corresponding to the vehicle control requirement from the requirement document, wherein the assignment rule includes a conditional expression and an action expression;
[0133] An extraction module 303 is used to extract the signal value interval of the signal information corresponding to the vehicle control demand through the conditional expression and the action expression in the assignment rule;
[0134] The generating module 304 is used to generate a target test case including the signal value interval.
[0135] In one embodiment, the second acquisition module includes:
[0136] An extraction submodule, used to extract the first signal information contained in the requirement document;
[0137] A first conversion submodule, used for converting characters in the first signal information into characters in a preset format to obtain second signal information;
[0138] The first acquisition submodule is configured to acquire at least one of the following attribute items in the second signal information:
[0139] Signal statement, signal name, signal enumeration value, signal domain value;
[0140] The combining submodule is used to combine the attribute items into signal information corresponding to the vehicle control demand.
[0141] In one embodiment, the second acquisition module includes:
[0142] A second acquisition submodule is used to acquire the original assignment rules in the requirement document;
[0143] The second conversion submodule is used to convert the original assignment rules in the requirement document into assignment rules corresponding to the vehicle control requirements.
[0144] In one embodiment, the second conversion submodule is further used for:
[0145] Standardizing the original assignment rule;
[0146] Extract the conditional expressions and action expressions in the standardized original assignment rules;
[0147] Generate an assignment rule corresponding to the vehicle control demand including the conditional expression and the action expression.
[0148] In one embodiment, the standardizing the original assignment rule includes:
[0149] The special characters in the original assignment rules are standardized, the logical relationship words in the original assignment rules are converted into preset words with the same meaning as the logical relationship words, and the Chinese operators in the original assignment rules are converted into standard operators.
[0150] In one embodiment, the signal information includes information of input signals and information of output signals, and the extraction module includes:
[0151] When the signal information is an input signal, and the signal domain value defined by the input signal is a discrete value, a traversal operation is performed on the discrete value through a conditional expression in an assignment rule;
[0152] A value among the discrete values that matches the conditional expression is determined as a signal value interval of the signal information corresponding to the vehicle control requirement.
[0153] In one embodiment, the apparatus further comprises:
[0154] The third acquisition module is used to acquire the target test case;
[0155] The generation module is also used to generate a configuration file containing the target test case.
[0156] Figure 4 FIG. 1 is a schematic diagram of the hardware structure of a test case generation system in an embodiment of the present application. Figure 4 As shown, the test case generation system includes:
[0157] at least one processor 420; and,
[0158] A memory 404 in communication with the at least one processor 420; wherein,
[0159] The memory 404 stores instructions that can be executed by the at least one processor 420, and the instructions are executed by the at least one processor 420 to implement the test case generation method recorded in any of the above embodiments.
[0160] Reference Figure 4 The test case generation system 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0161] The processing component 402 generally controls the overall operation of the test case generation system 400. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0162] The memory 404 is configured to store various types of data to support the operation of the test case generation system 400. Examples of such data include instructions for any application or method operating on the test case generation system 400, such as text, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0163] The power component 406 provides power to various components of the test case generation system 400. The power component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the vehicle control system 400.
[0164] The multimedia component 408 includes a screen that provides an output interface between the test case generation system 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 may also include a front camera and / or a rear camera. When the test case generation system 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0165] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the test case generation system 400 is in an operation mode, such as an alarm mode, a recording mode, a speech recognition mode, and a speech output mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0166] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0167] The sensor assembly 414 includes one or more sensors for providing various aspects of status evaluation for the test case generation system 400. For example, the sensor assembly 414 may include a sound sensor. In addition, the sensor assembly 414 may detect the open / closed state of the test case generation system 400, the relative positioning of the components, such as the display and keypad of the test case generation system 400, and the sensor assembly 414 may also detect the operating state of the test case generation system 400 or a component of the test case generation system 400, such as the operating state of the air distribution plate, the structural state, the operating state of the discharge scraper, etc., the orientation or acceleration / deceleration of the test case generation system 400 and the temperature change of the test case generation system 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, a material stacking thickness sensor or a temperature sensor.
[0168] The communication component 416 is configured to enable the test case generation system 400 to provide the ability to communicate with other devices and cloud platforms in a wired or wireless manner. The test case generation system 400 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0169] In an exemplary embodiment, the test case generation system 400 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the test case generation method described in any of the above embodiments.
[0170] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the test case generation system, the test case generation system can implement the test case generation method recorded in any of the above embodiments.
[0171] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0172] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0173] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0175] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A test case generation method, characterized in that: include: Obtain requirements document containing vehicle control requirements; Acquire signal information corresponding to the vehicle control requirement from the requirement document, and acquire an assignment rule corresponding to the vehicle control requirement from the requirement document, wherein the assignment rule includes a conditional expression and an action expression; Extracting the signal value interval of the signal information corresponding to the vehicle control demand through the conditional expression and the action expression in the assignment rule; Generate a target test case containing the signal value interval.
2. The method according to claim 1, characterized in that The acquiring signal information corresponding to the vehicle control requirement from the requirement document includes: Extracting first signal information contained in the requirement document; Converting characters in the first signal information into characters in a preset format to obtain second signal information; Obtain at least one of the following attribute items in the second signal information: Signal statement, signal name, signal enumeration value, signal domain value; The attribute items are combined into signal information corresponding to the vehicle control requirement.
3. The method according to claim 1, characterized in that The obtaining of the assignment rule corresponding to the vehicle control requirement from the requirement document includes: Obtaining the original assignment rule in the requirement document; The original assignment rules in the requirement document are converted into assignment rules corresponding to the vehicle control requirements.
4. The method according to claim 3, characterized in that The converting the original assignment rule in the requirement document into the assignment rule corresponding to the vehicle control requirement includes: Standardizing the original assignment rule; Extract the conditional expressions and action expressions in the standardized original assignment rules; Generate an assignment rule corresponding to the vehicle control demand including the conditional expression and the action expression.
5. The method according to claim 4, characterized in that The standardizing of the original assignment rule comprises: The special characters in the original assignment rules are standardized, the logical relationship words in the original assignment rules are converted into preset words with the same meaning as the logical relationship words, and the Chinese operators in the original assignment rules are converted into standard operators.
6. The method according to claim 1, characterized in that The signal information includes information of input signals and information of output signals, and the signal value interval of the signal information corresponding to the vehicle control requirement is extracted through the conditional expression and the action expression in the assignment rule, including: When the signal information is an input signal, and the signal domain value defined by the input signal is a discrete value, a traversal operation is performed on the discrete value through a conditional expression in an assignment rule; A value among the discrete values that matches the conditional expression is determined as a signal value interval of the signal information corresponding to the vehicle control requirement.
7. The method according to claim 1, characterized in that The method further comprises: Get the target test case; Generate a configuration file containing the target test cases.
8. A test case generating device, characterized in that: include: A first acquisition module is used to acquire a requirement document including vehicle control requirements; A second acquisition module is used to acquire signal information corresponding to the vehicle control requirement from the requirement document, and acquire an assignment rule corresponding to the vehicle control requirement from the requirement document, wherein the assignment rule includes a conditional expression and an action expression; An extraction module, used to extract the signal value interval of the signal information corresponding to the vehicle control demand through the conditional expression and the action expression in the assignment rule; A generation module is used to generate a target test case containing the signal value interval.
9. A test case generation system, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the test case generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor corresponding to the test case generation system, the test case generation system can implement the test case generation method as described in any one of claims 1 to 7.