CN112699043A - Method and device for generating test case - Google Patents

Method and device for generating test case Download PDF

Info

Publication number
CN112699043A
CN112699043A CN202110007854.2A CN202110007854A CN112699043A CN 112699043 A CN112699043 A CN 112699043A CN 202110007854 A CN202110007854 A CN 202110007854A CN 112699043 A CN112699043 A CN 112699043A
Authority
CN
China
Prior art keywords
test
parameter
simulation
candidate
description information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110007854.2A
Other languages
Chinese (zh)
Inventor
陈雨
付浩生
刘谱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202110007854.2A priority Critical patent/CN112699043A/en
Publication of CN112699043A publication Critical patent/CN112699043A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The specification discloses a method and a device for generating test cases, and particularly discloses that all test participating objects related to a simulation test task are automatically determined from received description information, and all candidate test cases are obtained through combination according to each parameter value corresponding to all the test participating objects, so that manual participation can be effectively reduced, the generation cost of the test cases is reduced, and the efficiency of the test cases is improved. And after each candidate test case is obtained, the test can be performed on each candidate test case to select the test case corresponding to the simulation test task, so that the finally determined test case can meet the actual requirement of the simulation test task, and the rationality of the generated test case is improved.

Description

Method and device for generating test case
Technical Field
The specification relates to the technical field of unmanned driving, in particular to a method and a device for generating a test case.
Background
Currently, when various decision algorithms of the unmanned equipment are subjected to simulation test and verification, a large number of test cases are generally used. When test cases of various decision algorithms are generated at present, most of the test cases are firstly determined as test targets when the test cases are executed, and then the environment background and traffic elements corresponding to the test cases are manually added according to the test targets, so that test scenes corresponding to the test cases are formed. However, this method often requires excessive labor cost, is inefficient to generate, and may cause situations where the generated test cases are not practical.
Therefore, how to effectively reduce the generation cost of the test case and improve the efficiency and accuracy of the test case is an urgent problem to be solved.
Disclosure of Invention
The present specification provides a method and an apparatus for generating test cases, so as to partially solve the above problems in the prior art.
The technical scheme adopted by the specification is as follows:
the present specification provides a method for generating a test case, including:
receiving description information aiming at a simulation test task to be executed;
identifying each test participating object related to the simulation test task from the description information;
for each test participant, determining a parameter set corresponding to the test participant, and selecting a plurality of parameter values corresponding to the test participant from the parameter set;
aiming at each parameter value corresponding to the test participating object, combining the parameter value with each parameter value corresponding to other test participating objects except the test participating object to obtain each candidate test case;
and respectively carrying out simulation test on the candidate test cases to obtain test results, and selecting the test case corresponding to the simulation test task from the candidate test cases according to the test results.
Optionally, identifying, from the description information, each test participant involved in the simulation test task, specifically includes:
performing semantic analysis on the description information to obtain a semantic analysis result;
and determining each test participating object related to the simulation test task from a preset simulation test database according to the semantic analysis result.
Optionally, for each test participant, determining a parameter set corresponding to the test participant specifically includes:
aiming at each test participant, determining at least one parameter item for describing the test participant based on a preset simulation test database;
for each parameter item related to the test participating object, determining a parameter value range corresponding to the parameter item according to the description information and/or a preset simulation test database;
and determining a parameter set corresponding to the test participating object according to the parameter value range corresponding to each parameter item related to the test parameter object.
Optionally, for each parameter item related to the test participating object, determining a parameter value range corresponding to the parameter item according to the description information and/or a preset simulation test database, specifically including:
judging whether the description information contains a parameter value range corresponding to each parameter item related to the test participating object;
if so, extracting a parameter value range corresponding to the parameter item from the description information, otherwise, inquiring the parameter value range corresponding to the parameter item from the simulation test database.
Optionally, selecting a plurality of parameter values corresponding to the test participating object from the parameter set, specifically including:
for each test participant, determining a behavior relation between the test participant and other test participants according to the description information, wherein the behavior relation is used for representing at least one of a relative position relation and a relative speed relation between the test participant and other test participants;
and screening a plurality of parameter values which accord with the behavior relation from the parameter value range of the parameter item contained in the parameter set aiming at each parameter item related to the test participating object, and taking the parameter values as the parameter values corresponding to the selected test participating object.
Optionally, the performing simulation test on each candidate test case respectively to obtain each test result, and selecting the test case corresponding to the simulation test task from the candidate test cases according to each test result, specifically including:
aiming at each candidate test case, carrying out simulation test on the candidate test case to obtain an actual test result corresponding to the candidate test case;
and if the actual test result corresponding to the candidate test case is matched with the expected test result corresponding to the simulation test task, taking the candidate test case as the test case corresponding to the simulation test task.
Optionally, the method further comprises:
and storing the test case corresponding to the simulation test task so as to perform simulation test on other simulation test tasks through the stored test case corresponding to the simulation test task.
This specification provides a device for test case generation, including:
the device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving description information aiming at a simulation test task to be executed;
the identification module is used for identifying each test participating object related to the simulation test task from the description information;
the determining module is used for determining a parameter set corresponding to each test participant and selecting a plurality of parameter values corresponding to the test participants from the parameter set;
the combination module is used for combining each parameter value corresponding to the test participating object with each parameter value corresponding to other test participating objects except the test participating object to obtain each candidate test case;
and the selection module is used for respectively carrying out simulation test on each candidate test case to obtain each test result, and selecting the test case corresponding to the simulation test task from the candidate test cases according to each test result.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method of test case generation.
The present specification provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the program, the method for generating the test case is implemented.
The technical scheme adopted by the specification can achieve the following beneficial effects:
in the method for generating test cases provided in this specification, description information for a simulation test task to be executed is received, then each test participant involved in the simulation test task is identified from the description information, a parameter set corresponding to each test participant is determined, a plurality of parameter values corresponding to each test participant are selected from the parameter set, then, for each parameter value corresponding to each test participant, the parameter value is combined with each parameter value corresponding to other test participants except the test participant to obtain each candidate test case, finally, each candidate test case is subjected to simulation test respectively to obtain each test result, and the test case corresponding to the simulation test task is selected from the candidate test cases according to each test result.
According to the method, the test participation objects related to the simulation test task can be automatically determined from the received description information, and the candidate test cases are obtained through combination according to each parameter value corresponding to each test participation object, so that the manual participation can be effectively reduced, the generation cost of the test cases is reduced, and the efficiency of the test cases is improved. And after each candidate test case is obtained, the test can be performed on each candidate test case to select the test case corresponding to the simulation test task, so that the finally determined test case can meet the actual requirement of the simulation test task, and the rationality of the generated test case is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
FIG. 1 is a flow chart illustrating a method for test case generation according to the present disclosure;
FIG. 2 is a schematic view of a test scenario in which a main vehicle changes lanes to the left, and a vehicle is located in front of a lane adjacent to the left and a vehicle is located behind the lane adjacent to the left in the present specification;
FIG. 3 is a schematic diagram of an apparatus for test case generation provided in the present specification;
fig. 4 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a method for generating a test case in this specification, which specifically includes the following steps:
step S100, receiving description information for a simulation test task to be executed.
The execution subject of test case generation referred to in this specification may be a server, or may be a terminal device such as a desktop computer or a notebook computer. For convenience of description, the method for generating the test case in the embodiment of the present specification will be described below by taking only the terminal device as an execution subject as an example.
The description information of the simulation test task to be executed can be used for describing the actual test content of the simulation test required by the tester. The above description information may be in various forms of text, voice, and the like. The description information can be input into the terminal equipment by a tester according to the actual simulation test requirement.
The method for generating the test case provided by the present specification may be used for a simulation test of an unmanned device in a simulation scene, where the unmanned device may refer to a device capable of realizing automatic driving, such as an unmanned vehicle, a robot, and an automatic distribution device. Based on this, the unmanned device to which the method for generating the test case provided by the present specification is applied can be used for executing delivery tasks in the delivery field, such as business scenes of delivery such as express delivery, logistics, takeaway and the like by using the unmanned device.
And step S102, identifying each test participating object related to the simulation test task from the description information.
After receiving the above description information, the terminal device may simulate each test participant involved in the test task from the description information. Some of the determined test participants can be directly determined from the description information, and some test participants are not directly recorded in the description information, but need to determine the test participants related to the test content according to the test content recorded in the description information.
For example, the description information of the simulation test task to be executed is: the main vehicle changes the lane to the left at the speed of 20 Km/h; there is the car and the rear has the car in left side adjacent lane place ahead. The host vehicle included in the description information belongs to the test vehicle, so that the test participant of the test vehicle can be directly determined from the description information. The vehicles involved in the front and rear vehicles belong to a test participant of an obstacle, which can also be determined directly from the description information. Because the simulation test is usually performed based on the simulation scene corresponding to the actual map, the description information also relates to a test participant, which is a map, and the test participant cannot be directly determined from the description information but is determined based on the actual test content of the simulation test.
In this specification, when the terminal device determines the test participating objects related to the simulation test task, the terminal device may first perform semantic analysis on the description information to obtain a semantic analysis result, and then determine each test participating object related to the simulation test task from a preset simulation test database according to the semantic analysis result.
The above-mentioned simulation test database is preset, and the simulation test database may include: all the test participating objects related to the simulation test tasks, all the parameter items for describing the test participating objects related to the simulation test tasks, the parameter value ranges corresponding to the parameter items and the like. The test participation object related to the simulation test task may include: a main car, an obstacle, a traffic light, a map, etc. Each test participant corresponds to at least one parameter item for describing the test participant, and the parameter items corresponding to different test participants are not identical.
Based on this, the terminal device may further determine, through the simulation test database, each parameter item corresponding to each test participant involved in the simulation test task, and a parameter value range of the parameter items, so as to generate each candidate test case in the following through each determined parameter item and parameter value range.
Continuing with the above example, the terminal device may query the simulation test database for the parameter items related to the test participant according to the test participant, namely the test vehicle, including: the host vehicle speed (a parameter item for describing the test vehicle), the start position, the end position, the acceleration, and the like are used for describing the parameter item of the test vehicle. And for the test participant of the obstacle, the terminal device can inquire out parameter items such as the relative position of the obstacle and the host vehicle, the number of the obstacles, the acceleration of the obstacle, the position of the obstacle, the speed of the obstacle and the like for describing the test participant of the obstacle from the simulation test database. For a test participant, such as a map, the terminal device may determine from the simulation test database the parameter items describing the map, such as the number of lanes, road sections, road types, etc., that the host vehicle needs to use to perform the simulation test task.
In addition to the above-mentioned test participants and parameter items, in practical applications, other test participants and parameter items corresponding to the test participants may also be included, for example, for a test participant of a traffic light, the parameter items corresponding to the test participant may include: location, lighting rules, number, etc. The simulation test database records the corresponding relation between various test participating objects and parameter items, and particularly relates to which test participating objects and parameter items are related, which can be determined by the semantic analysis result of the terminal equipment on the description information.
The terminal device can perform semantic analysis on the description information in various ways. For example, the terminal device may perform semantic analysis on the description information through a natural language understanding model, extract keywords from the description information, and then match the keywords with keywords related to test participants included in a preset simulation test database to determine the test participants related to the description information. For another example, the terminal device may perform semantic analysis on the description information, extract each keyword, and convert each keyword into a corresponding word vector, and then, the terminal device may determine each test participating object related in the description information by determining a similarity between the word vector of each keyword and the word vector of each keyword (the keyword corresponding to each test participating object) included in the simulation test database. Other ways are not illustrated in detail here. It should be noted that the terminal device may also determine the parameter item that matches the description information from the simulation test database according to the semantic analysis result for the description information, and the specific manner may refer to the above method, which is not described in detail herein.
Step S104, aiming at each test participant, determining a parameter set corresponding to the test participant, and selecting a plurality of parameter values corresponding to the test participant from the parameter set.
In specific implementation, the terminal device determines, for each test participant, at least one parameter item for describing the test participant based on a preset simulation test database, then determines, for each parameter item related to the test participant, a parameter value range corresponding to the parameter item according to the description information and/or the preset simulation test database, and finally determines, according to the parameter value range corresponding to each parameter item related to the test parameter object, a parameter set corresponding to the test participant. That is to say, the parameter set corresponding to each test participant object may include the parameter items related to the test participant object and the parameter value ranges of the parameter items related to the test participant object.
When the terminal equipment determines the parameter value range corresponding to each parameter item related to each test participating object, whether the description information contains the parameter value range corresponding to the parameter item is judged for each parameter item related to the test participating object, if the description information contains the parameter value range corresponding to the parameter item, the parameter value range corresponding to the parameter item is extracted from the description information, and otherwise, the parameter value range corresponding to the parameter item is inquired from the simulation test database.
The description information can be seen that the speed of the main vehicle is limited to be 20Km/h in the description information, so that the parameter value range of the parameter item of the speed of the main vehicle can be directly determined through the description information, and the parameter value ranges corresponding to the other parameter items can be inquired from the simulation test database.
For example, with respect to the above description information: the main vehicle changes the lane to the left at the speed of 20 Km/h; for the case that a vehicle is arranged in front of the left adjacent lane and a vehicle is arranged behind the left adjacent lane, the description information comprises information that the speed of the main vehicle is 20Km/h, and at least comprises parameter value ranges of two parameter items of two lanes, so that the terminal equipment can directly determine the parameter value range of the parameter item of the speed of the main vehicle and the parameter value range corresponding to the parameter item of the lane from the description information, and for the parameter value ranges corresponding to the other parameter items, the parameter value ranges can be inquired from the simulation test database.
It should be noted that, for some parameter items, the terminal device may directly determine a corresponding parameter value from the obtained description information, but when the test case is finally generated, the terminal device does not necessarily completely correspond to the parameter value, as long as it is ensured that a value range of the parameter included in the test case can meet the parameter value. For example, for a test participant object, such as a map, the parameter item corresponding to the test participant object is finally positioned on the selectable road segment corresponding to the simulation test task. If at least two feasible lanes are determined according to the description information, the maximum number of feasible lanes 4 is determined according to the information of the actual test map, so that the number n of all feasible lanes belongs to [2, 4], then the number of selectable road sections containing 2 feasible lanes is k2, the number of selectable road sections containing 3 feasible lanes is k3, and the number of selectable road sections containing 4 feasible lanes is k4, and finally the total number of selectable road sections which can be used for simulation test is determined to be k2+ k3+ k 4.
When the terminal device determines the parameter values corresponding to the test participating objects, the terminal device may determine, for each test participating object, the behavior relationship between the test participating object and the other test participating objects according to the description information, and then, for each parameter item related to the test participating object, screen out a plurality of parameter values conforming to the behavior relationship from the parameter value range of the parameter item included in the parameter set corresponding to the test participating object, as the selected parameter value corresponding to the test participating object. The behavior relation is used for representing at least one of a relative position relation and a relative speed relation between the test participant and other test participants.
For example: as shown in FIG. 2, the main truck changes lanes to the left at a speed of 20 Km/h; there is the car and the rear has the car in left side adjacent lane place ahead. At least two barrier vehicles in the front and the rear of the host vehicle can be determined from the description information, and when the longitudinal distance of the barrier vehicles relative to the host vehicle in the adjacent lanes is inquired from a preset simulation test database, the value range belongs to [ -20m, 20m ]. As can be seen from FIG. 2, if the origin of coordinates of the host vehicle is assumed, it is obviously unreasonable to set the longitudinal distance of the front obstacle vehicle to the host vehicle in the adjacent lane to be [ -20m, 0], and it is also obviously unreasonable to set the longitudinal distance of the rear obstacle vehicle to the host vehicle in the adjacent lane to be [0, 20m ]. Therefore, by constraining the behavior relationship between the host vehicle and the two obstacles, it can be determined that the longitudinal distance of the rear obstacle vehicle relative to the host vehicle in the adjacent lane should be within the range of [ -20m, 0], while the longitudinal distance of the front obstacle vehicle relative to the host vehicle in the adjacent lane should be within the range of [0, 20m ].
For another example: when the main vehicle runs with the vehicle at the speed of 20-40 Km/h in the current lane, the speed range of the vehicle in front of the main vehicle is inquired from a preset simulation test database that the speed range of the vehicle in front of the main vehicle is 10-80 Km/h, the speed of the main vehicle is relatively consistent with the speed of the vehicle in front of the main vehicle because the main vehicle needs to run with the vehicle, and the speed range of the vehicle in front of the main vehicle can be reduced to 15-45 Km/h.
It should be noted that, in order to reduce the data amount of the finally generated test case to a certain extent, for a parameter item whose value range is continuous, a set number of parameter values may be randomly acquired from a parameter value interval corresponding to the parameter item, and the parameter values of the parameter item for generating the candidate test case are formed. Or obtaining parameter values every set length of the value range from the parameter value interval corresponding to the parameter item, and forming the parameter values of the parameter item for generating the candidate test case.
And step S106, aiming at each parameter value corresponding to the test participating object, combining the parameter value with each parameter value corresponding to other test participating objects except the test participating object to obtain each candidate test case.
After the parameter value ranges corresponding to the parameter items of the test participating objects are determined, the parameter values in the parameter value ranges of different parameter items can be combined to obtain the candidate test cases. For example: as shown in fig. 2The main vehicle changes the lane to the left at the speed of 20 Km/h; when a vehicle is in front of the left adjacent lane and a vehicle is in the rear of the left adjacent lane, the road where the main vehicle runs at least comprises two feasible lanes, and the number n of all the feasible lanes belongs to [2, n ∈ [ ]max]Wherein n ismaxThe maximum value of the number of the feasible lanes in all roads on the map, and further, the number of the feasible lanes is respectively determined to be 2, 3 and up to nmaxNumber k of time-corresponding selectable road segments2、k3Up to
Figure BDA0002884213590000101
And finally determining the number of the common optional road sections as
Figure BDA0002884213590000102
Meanwhile, according to the behavior relation between the main vehicle and the obstacle vehicle, the corresponding relative distance d E [0, d ] of the front obstacle vehicle is determinedmax]The relative distance d ∈ [ d ] corresponding to the rear obstacle vehiclemin,0]The set value step length is dstepThe combination of values of the relative distance between the obstacle vehicle and the main vehicle is common
Figure BDA0002884213590000111
And (4) seed preparation. Obstacle vehicle speed v ∈ [ v ]min,vmax]The set value step length is vstepThe value combination of the speed of the obstacle vehicle is shared
Figure BDA0002884213590000112
Wherein m is the number of obstacle vehicles. Thus, based on the three parameter items, K × D × V candidate test cases can be obtained.
And S108, respectively carrying out simulation test on each candidate test case to obtain each test result, and selecting the test case corresponding to the simulation test task from the candidate test cases according to each test result.
Specifically, the terminal device performs a simulation test on each candidate test case to obtain an actual test result corresponding to the candidate test case, and if it is determined that the actual test result corresponding to the candidate test case matches with an expected test result corresponding to the simulation test task, the candidate test case is used as the test case corresponding to the simulation test task.
For example, the candidate test case is tested, a prediction test result of the host vehicle following the front vehicle is given, but actually, because the speed of the obstacle vehicle is greater than the speed of the host vehicle by a certain numerical value, the finally obtained test result shows that the host vehicle cannot realize the following behavior (for example, when the candidate test case is subjected to simulation test, the host vehicle and the obstacle vehicle are gradually far away, and the host vehicle is determined to not realize the following behavior), which indicates that the candidate test case is not suitable for the test of the following behavior of the host vehicle, and can be abandoned. Of course, the expected test results mentioned above may be determined according to actual requirements, and may be specifically determined according to actual simulation test tasks, which are not illustrated in detail herein.
According to the method, the test participation objects related to the simulation test task can be automatically determined from the received description information, and the candidate test cases are obtained through combination according to each parameter value corresponding to each test participation object, so that manual participation can be effectively reduced, the generation cost of the test cases is reduced, and the efficiency of the test cases is improved. Before generating each candidate test case, determining the behavior relation among the test participating objects, screening a plurality of parameter values which accord with the behavior relation from the parameter value range of the parameter item contained in the parameter set corresponding to the test participating objects, and generating the candidate test cases based on the parameter values, thereby improving the rationality of the generated test cases. And after each candidate test case is obtained, the test can be performed on each candidate test case to select the test case corresponding to the simulation test task, so that the finally determined test case can meet the actual requirement of the simulation test task, and the rationality of the generated test case is improved.
It should be noted that, after the terminal device determines the test case corresponding to the simulation test task by the method for generating the test case, the test case corresponding to the simulation test task is stored, and then, the terminal device may perform simulation test on other simulation test tasks by using the stored test case corresponding to the simulation test task. The other simulation test tasks of the test case can be used in the test content which is approximately consistent with the test content of the simulation test task, correspondingly, when the other simulation test tasks are executed, the part of test participation objects, parameter items and parameter values related in the test case can be correspondingly adjusted according to the description information corresponding to the other simulation test tasks, so that the test case which is consistent with the other simulation tests can be obtained. Therefore, the time consumed by generating test cases of other simulation tests can be greatly reduced, and the generation efficiency of the test cases is further improved.
Based on the same idea, the present specification further provides a corresponding device for generating test cases, as shown in fig. 3.
Fig. 3 is a schematic diagram of a device for generating test cases provided in this specification, which specifically includes:
a receiving module 400, configured to receive description information for a simulation test task to be executed;
an identifying module 401, configured to identify, from the description information, each test participant involved in the simulation test task;
a determining module 402, configured to determine, for each test participant, a parameter set corresponding to the test participant, and select a plurality of parameter values corresponding to the test participant from the parameter set;
the combination module 403 is configured to combine, for each parameter value corresponding to the test participant, the parameter value with each parameter value corresponding to other test participants except the test participant, to obtain each candidate test case;
a selecting module 404, configured to perform simulation testing on the candidate test cases respectively to obtain test results, and select a test case corresponding to the simulation test task from the candidate test cases according to the test results.
Optionally, the identification module 401 is specifically configured to:
performing semantic analysis on the description information to obtain a semantic analysis result; and determining each test participating object related to the simulation test task from a preset simulation test database according to the semantic analysis result.
Optionally, the determining module 402 is specifically configured to:
aiming at each test participant, determining at least one parameter item for describing the test participant based on a preset simulation test database; for each parameter item related to the test participating object, determining a parameter value range corresponding to the parameter item according to the description information and/or a preset simulation test database; and determining a parameter set corresponding to the test participating object according to the parameter value range corresponding to each parameter item related to the test parameter object.
Optionally, the determining module 402 is specifically configured to:
judging whether the description information contains a parameter value range corresponding to each parameter item related to the test participating object; if so, extracting a parameter value range corresponding to the parameter item from the description information, otherwise, inquiring the parameter value range corresponding to the parameter item from the simulation test database.
Optionally, the determining module 402 is specifically configured to:
for each test participant, determining a behavior relation between the test participant and other test participants according to the description information, wherein the behavior relation is used for representing at least one of a relative position relation and a relative speed relation between the test participant and other test participants; and screening a plurality of parameter values which accord with the behavior relation from the parameter value range of the parameter item contained in the parameter set aiming at each parameter item related to the test participating object, and taking the parameter values as the parameter values corresponding to the selected test participating object.
Optionally, the selecting module 404 is specifically configured to:
aiming at each candidate test case, carrying out simulation test on the candidate test case to obtain an actual test result corresponding to the candidate test case; and if the actual test result corresponding to the candidate test case is matched with the expected test result corresponding to the simulation test task, taking the candidate test case as the test case corresponding to the simulation test task.
Optionally, the selecting module 404 is further configured to:
and storing the test case corresponding to the simulation test task so as to perform simulation test on other simulation test tasks through the stored test case corresponding to the simulation test task.
The present specification also provides a computer-readable storage medium storing a computer program, which can be used to execute the method for generating the test case provided in fig. 1.
This specification also provides a schematic block diagram of the electronic device shown in fig. 4. As shown in fig. 4, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to implement the method for generating the test case described in fig. 1. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. A method for test case generation, comprising:
receiving description information aiming at a simulation test task to be executed;
identifying each test participating object related to the simulation test task from the description information;
for each test participant, determining a parameter set corresponding to the test participant, and selecting a plurality of parameter values corresponding to the test participant from the parameter set;
aiming at each parameter value corresponding to the test participating object, combining the parameter value with each parameter value corresponding to other test participating objects except the test participating object to obtain each candidate test case;
and respectively carrying out simulation test on the candidate test cases to obtain test results, and selecting the test case corresponding to the simulation test task from the candidate test cases according to the test results.
2. The method of claim 1, wherein identifying test participants involved in the simulation test task from the description information specifically comprises:
performing semantic analysis on the description information to obtain a semantic analysis result;
and determining each test participating object related to the simulation test task from a preset simulation test database according to the semantic analysis result.
3. The method of claim 1, wherein determining, for each test participant, a parameter set corresponding to the test participant comprises:
aiming at each test participant, determining at least one parameter item for describing the test participant based on a preset simulation test database;
for each parameter item related to the test participating object, determining a parameter value range corresponding to the parameter item according to the description information and/or a preset simulation test database;
and determining a parameter set corresponding to the test participating object according to the parameter value range corresponding to each parameter item related to the test parameter object.
4. The method according to claim 3, wherein determining a parameter value range corresponding to each parameter item involved in the test participating object according to the description information and/or a preset simulation test database specifically includes:
judging whether the description information contains a parameter value range corresponding to each parameter item related to the test participating object;
if so, extracting a parameter value range corresponding to the parameter item from the description information, otherwise, inquiring the parameter value range corresponding to the parameter item from the simulation test database.
5. The method of claim 3, wherein selecting a plurality of parameter values corresponding to the test participant from the parameter set specifically comprises:
for each test participant, determining a behavior relation between the test participant and other test participants according to the description information, wherein the behavior relation is used for representing at least one of a relative position relation and a relative speed relation between the test participant and other test participants;
and screening a plurality of parameter values which accord with the behavior relation from the parameter value range of the parameter item contained in the parameter set aiming at each parameter item related to the test participating object, and taking the parameter values as the parameter values corresponding to the selected test participating object.
6. The method according to claim 1, wherein the performing simulation test on each candidate test case to obtain each test result, and selecting the test case corresponding to the simulation test task from the candidate test cases according to each test result specifically includes:
aiming at each candidate test case, carrying out simulation test on the candidate test case to obtain an actual test result corresponding to the candidate test case;
and if the actual test result corresponding to the candidate test case is matched with the expected test result corresponding to the simulation test task, taking the candidate test case as the test case corresponding to the simulation test task.
7. The method of claim 1, wherein the method further comprises:
and storing the test case corresponding to the simulation test task so as to perform simulation test on other simulation test tasks through the stored test case corresponding to the simulation test task.
8. An apparatus for test case generation, comprising:
the device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving description information aiming at a simulation test task to be executed;
the identification module is used for identifying each test participating object related to the simulation test task from the description information;
the determining module is used for determining a parameter set corresponding to each test participant and selecting a plurality of parameter values corresponding to the test participants from the parameter set;
the combination module is used for combining each parameter value corresponding to the test participating object with each parameter value corresponding to other test participating objects except the test participating object to obtain each candidate test case;
and the selection module is used for respectively carrying out simulation test on each candidate test case to obtain each test result, and selecting the test case corresponding to the simulation test task from the candidate test cases according to each test result.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 7 when executing the program.
CN202110007854.2A 2021-01-05 2021-01-05 Method and device for generating test case Pending CN112699043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110007854.2A CN112699043A (en) 2021-01-05 2021-01-05 Method and device for generating test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110007854.2A CN112699043A (en) 2021-01-05 2021-01-05 Method and device for generating test case

Publications (1)

Publication Number Publication Date
CN112699043A true CN112699043A (en) 2021-04-23

Family

ID=75514731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110007854.2A Pending CN112699043A (en) 2021-01-05 2021-01-05 Method and device for generating test case

Country Status (1)

Country Link
CN (1) CN112699043A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112987596A (en) * 2021-05-10 2021-06-18 北京三快在线科技有限公司 Test method and test device for unmanned equipment
CN113703417A (en) * 2021-07-13 2021-11-26 交控科技股份有限公司 Method and device for determining test cases of full-automatic scene of train operation

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112987596A (en) * 2021-05-10 2021-06-18 北京三快在线科技有限公司 Test method and test device for unmanned equipment
CN113703417A (en) * 2021-07-13 2021-11-26 交控科技股份有限公司 Method and device for determining test cases of full-automatic scene of train operation
CN113703417B (en) * 2021-07-13 2022-12-20 交控科技股份有限公司 Method and device for determining test cases of full-automatic scene of train operation

Similar Documents

Publication Publication Date Title
CN112732585A (en) Simulation test method and device
US10719863B2 (en) Method and apparatus for improving vehicle loss assessment image identification result, and server
CN111639682A (en) Ground segmentation method and device based on point cloud data
CN112307978B (en) Target detection method and device, electronic equipment and readable storage medium
CN112699043A (en) Method and device for generating test case
CN103823900A (en) Information point significance determining method and device
CN112033421B (en) Method and device for detecting lane in electronic map
CN113032261B (en) Simulation test method and device
CN112327864A (en) Control method and control device of unmanned equipment
CN112818811A (en) Vehicle damage assessment method and device
CN105989066A (en) Information processing method and device
CN112966577B (en) Method and device for model training and information providing
CN111694992A (en) Data processing method and device
CN111639269B (en) Site recommendation method and device
CN107247716B (en) Method and device for increasing electronic eye information, navigation chip and server
CN112183181A (en) Information display method
CN112849156B (en) Driving risk identification method and device
CN111899264A (en) Target image segmentation method, device and medium
CN113344078A (en) Model training method and device
CN113706552A (en) Method and device for generating semantic segmentation marking data of laser reflectivity base map
CN112905913A (en) Public opinion display method, device and equipment
CN113344197A (en) Training method of recognition model, service execution method and device
CN112684720A (en) Simulation test method and device
CN113344590A (en) Method and device for model training and complaint rate estimation
CN111753661B (en) Target identification method, device and medium based on neural network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination