Test method and device, electronic equipment and vehicle
By using a test configuration file containing business use case configuration information to automatically adjust the test environment and target objects, the existing testing process is solved and the problem of high demands and high costs for testers is achieved, and an efficient and automated testing process is achieved.
Patent Information
- Application Number
- CN202310947193.0
- 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
The existing in-domain/inter-domain development and testing process requires high demands on testers and requires a large labor cost.
By obtaining a test configuration file containing business use case configuration information, parsing the configuration file to obtain structural data, adjusting the test environment and target objects to the test state using the use case information and usage rule information, and triggering tests based on the registered business use case and test environment, obtaining The actual value of the target object, compare the actual value with the preset expectation value to determine the test result.
The automated testing process is realized, reducing the requirements for testers' experience, reducing labor costs, and improving testing efficiency.
Smart Images

Figure CN119441015A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a testing method, device, electronic equipment and vehicle. Background Art
[0002] The conventional intra-domain / inter-domain development and testing process of automobiles requires sufficient testing after developers complete their development work. The testing specifically includes unit testing and business logic testing. Conventional unit testing and business testing rely heavily on the tester's familiarity and experience with the business, and developers are required to set up multiple test cases to complete a test verification. Therefore, the testing process has high requirements for testers and requires a high testing labor cost. Summary of the invention
[0003] In view of this, the present application provides a testing method, device, electronic equipment and vehicle, which can solve the problem that the current testing process has high requirements for testers and requires high labor costs.
[0004] In a first aspect, the present application provides a testing method, comprising:
[0005] Obtain a test configuration file; the test configuration file includes configuration information of the business use case;
[0006] Parsing the test configuration file to obtain structural data corresponding to the configuration information, wherein the structural data includes: use case information of the business use case, usage rule information of the business use case, and target objects involved in the business use case;
[0007] Registering using the use case information, and adjusting the test environment and the target object to a test state based on the registered use case information and the usage rule information;
[0008] Based on the registered business use case and the test environment, the target object is tested to obtain an actual value of the target object based on feedback of a trigger signal;
[0009] The actual value is compared with a preset expected value to determine the test result of the target object.
[0010] Optionally, parsing the test configuration file to obtain structure data corresponding to the configuration information includes:
[0011] Performing data parsing on the test configuration file to obtain source data corresponding to the configuration information;
[0012] The source data is structured to obtain the structured data.
[0013] Optionally, the source data includes: data type information and topic information;
[0014] The step of structuring the source data to obtain structured data includes:
[0015] Performing a format check on the source data, and checking the data type information and the topic information;
[0016] When the format check, the data type and the topic information all meet the requirements, the source data is converted into the structure data.
[0017] Optionally, adjusting the test environment and the target object to a test state based on the use case information and the usage rule information includes:
[0018] Initializing the test environment using the registered use case information;
[0019] Based on the usage rule information, a form transformation instruction is sent to the target object to adjust the target object to the test state.
[0020] Optionally, triggering a test on the target object to obtain an actual value of the target object based on feedback of a trigger signal includes:
[0021] Publishing the trigger signal to the data channel;
[0022] The actual value fed back by the target object based on the trigger signal is received.
[0023] Optionally, comparing the actual value with a preset expected value to determine a test result of the target object includes:
[0024] Calculating the absolute value of the difference between the actual value and the expected value;
[0025] When the absolute value of the difference is less than a preset threshold, it is determined that the test result of the target object is passed.
[0026] In a second aspect, the present application provides a testing device, comprising:
[0027] An acquisition unit is configured to acquire a test configuration file; the test configuration file includes configuration information of the business use case;
[0028] A parsing unit is configured to parse the test configuration file to obtain structure data corresponding to the configuration information, wherein the structure data includes: use case information of the business use case, usage rule information of the business use case and target objects involved in the business use case;
[0029] an adjusting unit configured to register using the use case information, and adjust the test environment and the target object to a test state based on the registered use case information and the usage rule information;
[0030] A processing unit, configured to trigger testing of the target object based on the registered business use case and the test environment, and obtain an actual value of the target object based on feedback of the trigger signal;
[0031] The judgment unit is configured to compare the actual value with a preset expected value to determine a test result of the target object.
[0032] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the testing method described in the first aspect when executed by a processor.
[0033] In a fourth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the test method described in the first aspect when executing the computer program.
[0034] In a fifth aspect, the present application provides a vehicle, comprising the testing device as mentioned in the second aspect or the electronic device as mentioned in the fourth aspect.
[0035] By means of the above technical scheme, a test method, device, electronic device and vehicle provided by the present application first obtain a test configuration file containing configuration information of several business use cases, wherein the configuration information of several business use cases in the test configuration file is obtained in the development stage and can be used as input of the test process. Then the test configuration file is parsed to obtain structural data, and by reading the structural data, the use case information of the business use case, the use rule information of the business use case and the target object involved in the business use case are obtained. Among them, the use case information and the use rule information are used to adjust the test environment and the target object to the test state. Finally, after adjusting to the test state, the test can be performed, and based on the registered business use case and the test environment, the target object is triggered to test, and the actual value of the target object based on the trigger signal feedback is obtained. According to the relationship between the actual value of the feedback and the preset expected value, the test result of the target object is determined. Compared with the related art, the present application uses a test configuration file containing the configuration information of several business use cases to directly transfer the information of some use cases in the development stage to the test stage in the form of a configuration file, which provides convenience for the test stage. Then, the test stage only needs to adjust the environment and the target test object to determine the test result. Essentially, it simulates a message middleware. Testers only need to use the test configuration file to complete the automated testing process, thus solving the problem that the current testing process has high requirements for testers and requires high labor costs.
[0036] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 A schematic diagram of a testing method provided in an embodiment of the present application is shown;
[0040] Figure 2 A schematic diagram of a process flow of another testing method provided in an embodiment of the present application is shown;
[0041] Figure 3 A schematic diagram of another testing method provided in an embodiment of the present application is shown;
[0042] Figure 4 A schematic structural diagram of a testing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0043] In order to be able to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that, in the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other. In addition, in order to be able to understand the characteristics and technical content of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings, and the attached drawings are only for reference purposes and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided by multiple details. However, in the absence of these details, one or more embodiments can still be implemented. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0044] The test method provided in this embodiment can be applied to test devices or electronic devices, such as vehicle-mounted domain controllers, etc., and can be integrated with devices responsible for handling intra-domain / inter-domain communications in the vehicle, or a separate processor can be set. It is not limited to communications within the automotive field, and the test method provided in this embodiment can be used in the process of testing various hardware devices that need to use application programs.
[0045] In order to solve the problem that the current testing process has high requirements for testers and requires high labor costs, this embodiment proposes a testing method. Figure 1 As shown, the method includes:
[0046] S101, obtaining a test configuration file.
[0047] The test configuration file contains configuration information of several business use cases. These configuration information containing several business use cases are generally recorded and saved by developers during the software development phase, such as conventional cases, extreme cases, positive cases, negative cases, etc. After the development phase is completed, developers can record these configuration information containing several business use cases in the test configuration file. In addition, the business use cases in the configuration file can also be a set of test cases of the same application with high similarity.
[0048] S102, parsing the test configuration file to obtain structure data corresponding to the configuration information.
[0049] Parse the test configuration file to obtain structured data. The structured data here refers to the conversion of the format and type of the parsed data to meet the requirements of subsequent tests. The specific parsing process includes checking the compliance of the source data, improving the data type and topic information, etc.
[0050] The structural data includes: use case information of business use cases, usage rule information of business use cases, and target objects involved in business use cases. Use case information refers to the relevant information of these business use cases read from the structural data, which is used for subsequent registration of business use cases to complete the initialization of the test environment; usage rule information includes some usage conditions or restrictions, etc., which can be used to adjust the target object to the test state; because different use cases may have wide applicability, the target objects involved in business use cases are mainly used to determine which test objects the test case can or cannot be used for.
[0051] S103, registering using the use case information, and adjusting the test environment and the target object to a test state based on the registered use case information and usage rule information.
[0052] Use the use case information in the structure data to register, and adjust the test environment and target object based on the registered use case information and usage rule information to facilitate the subsequent test process. The target object is the application to be tested, and the test status refers to whether the test environment and target object need to meet the test requirements.
[0053] S104, based on the registered business use case and test environment, trigger the test of the target object to obtain the actual value of the target object based on the trigger signal feedback.
[0054] Since the test configuration files prepared in the development phase have been added, and the corresponding test environment and target objects have been adjusted to the test state, in the actual test process, you only need to trigger the test to start the test process. Specifically, the triggering can be performed by issuing a trigger signal.
[0055] S105, comparing the actual value with the preset expected value to determine the test result of the target object
[0056] In this embodiment, a test configuration file containing configuration information of several business use cases is first obtained. The configuration information of several business use cases in the test configuration file is obtained in the development stage and can be used as an input for the test process. Then the test configuration file is parsed to obtain structural data, and by reading the structural data, the use case information of the business use case, the use rule information of the business use case and the target object involved in the business use case are obtained. Among them, the use case information and the use rule information are used to adjust the test environment and the target object to the test state. Finally, after adjusting to the test state, the test can be carried out. Based on the registered business use case and the test environment, the target object is triggered to test, and the actual value of the target object based on the trigger signal feedback is obtained. According to the relationship between the actual value of the feedback and the preset expected value, the test result of the target object is determined. Compared with the related art, this embodiment uses a test configuration file containing the configuration information of several business use cases to directly transfer the information of some use cases in the development stage to the test stage in the form of a configuration file, which provides convenience for the test stage. Then the test stage only needs to adjust the environment and the target test object to determine the test result. Essentially, it simulates a message middleware. Testers only need to use the test configuration file to complete the automated testing process, thus solving the problem that the current testing process has high requirements for testers and requires high labor costs.
[0057] In addition, this embodiment relies on Google gmock to implement the simulated message middleware, set the trigger conditions and expected results based on the configuration file, and automatically verify the test results. The tester only needs to use the test configuration file of the previous developer to perform the automated test of scene restoration and produce the test verification results.
[0058] It should be noted that, currently, for testing some service programs of vehicle-mounted domain controllers, the verification is still based on the traditional method of testers after program development. This is a great test of the experience of testers, and secondly, the test elements set by developers in the development stage are basically not used. Currently, there is no test configuration file written by developers in the market. Based on the platform provided by the present invention, developers only need to fill in the test configuration file and provide the configuration file including the corresponding business use case to the tester, and the tester can directly run the verification without understanding the business details.
[0059] Optionally, parsing the test configuration file to obtain structural data corresponding to the configuration information includes: performing data parsing on the test configuration file to obtain source data corresponding to the configuration information; and structuring the source data to obtain the structural data.
[0060] In this embodiment, it is necessary to first obtain the source data of each use case from the configuration information of several business use cases, and then structure the source data to obtain structured data. Structural data refers to the conversion of the format and type of the parsed data so that it can meet the requirements of subsequent tests, thereby facilitating subsequent tests.
[0061] Optionally, the source data includes: data type information and topic information; the structuring of the source data to obtain structured data includes: format checking the source data, and checking the data type information and the topic information; when the format check, the data type and the topic information meet the requirements, converting the source data into the structured data.
[0062] In this embodiment, the test configuration file is first parsed, and the source data of each use case is obtained from the configuration information of several business use cases. The INIparser can be used to perform preliminary data parsing on the file with the suffix "ini" in the use case to obtain the source data. Then, the source data is checked for compliance through SignalFinding, and the data type and topic information topic are improved to form structured data. Among them, the structured data includes trigger information and expected information. The trigger information also includes dds writer data, vddp pub data, etc., which are used to pass the data to the test object later. The expected information is used to set the expected value in advance, so as to facilitate subsequent testing.
[0063] Optionally, based on the use case information and usage rule information, the test environment and the target object are adjusted to a test state, including: initializing the test environment using the registered use case information; and sending a morphology transformation instruction to the target object based on the usage rule information to adjust the target object to a test state.
[0064] In this embodiment, it is first necessary to call the gmock dynamic registration interface to register the use case and pass the structure data to the test engine. After the registration is successful, the test engine will initialize the test environment, that is, adjust the test environment to the test state. At the same time, the target object, also known as the target test object or the test object, often appears in a certain intermediate state for the target test object. At this time, the test engine module will directly trigger the morphological transformation instruction to the test object based on the use rule information, so that the target test object is adjusted to the test state.
[0065] Optionally, triggering a test on the target object to obtain an actual value of the target object based on feedback of a trigger signal includes: publishing the trigger signal to a data channel; and receiving the actual value of the target object based on feedback of the trigger signal.
[0066] In this embodiment, after the above registration process and the adjustment of the test environment and the target object, the next step is the actual test process. First, a trigger signal is issued to the data channel. The triggerer can be a user, or after detecting that the test environment and the target object are adjusted to the test state, the trigger signal can be sent to the data channel through the task scheduler. Among them, the trigger signal can be DDS writer data, VDDP PUB data, etc. in the trigger information, which is used to upload the data to the DDS / VDDP data channel. The target object has a subscription to DDS / VDDP data. After finding that there is a trigger signal in the data channel, the actual value of itself can be fed back and output to the data channel. Then the domain processor compares the actual value with the preset expected value to determine the test result of the target object. Thereby completing the implementation of the test process.
[0067] Optionally, the absolute value of the difference between the actual value and the expected value is calculated; when the absolute value of the difference is less than a preset threshold, the test result of the target object is determined to be passed.
[0068] In this embodiment, for example, p is a preset threshold value, and when |ab|<p, the test result of the target object is determined to be passed. That is, when the test result a fed back by the target object is slightly different from the preset expected value b (less than the preset threshold value p), the test is considered to have passed. On the contrary, if the difference is large, the test is considered to have failed. The setting of the preset value b is specifically through the ecpected information, and the expected information is set by calling the gmock EXPECTED_CALL interface. It can be set by the user or by directly referencing or inheriting other preset expected values. And p is the specific setting value determined based on actual experience. The above method makes the test results more accurate, and automatically compares the expected and actual values, reducing labor costs.
[0069] like Figure 2 As shown, another testing method provided by this embodiment is shown, which summarizes the above process steps and combines Figure 3 The method specifically includes:
[0070] S201, obtaining a test configuration file.
[0071] S202, preliminarily parse the use case configuration information in the test configuration file to obtain source data.
[0072] S203, performing structured processing on the source data to obtain structured data.
[0073] S204, using the structural data, adjusting the test environment and the target object to a test state.
[0074] S205, issuing a trigger signal to the data channel, and receiving an actual value fed back by the target object based on the trigger signal.
[0075] S206, comparing the actual value with the preset expected value to determine the test result of the target object.
[0076] In S201, the first step is to obtain a test configuration file, where the test configuration file contains configuration information for several business use cases. Then in S202, the use case configuration information in the test configuration file is preliminarily parsed to obtain source data. After the use case configuration information is parsed, it may contain multiple use cases, and the use cases in the use case pool can be parsed in the subsequent process by forming a use case pool. For example, the use case file is preliminarily parsed through the INIparser function to obtain the source data. In S203, the source data is searched and compliance checked through the SignalFinding function, and the data type and topic information topic are improved to form structured data.
[0077] In S204, the test environment and the target object are adjusted to the test state by using the structural data. In practical applications, this can be achieved by registering a use case and sending a morphological conversion instruction. Specifically, the structural data is first transmitted to the test engine through the gmock dynamic registration interface, and then the test engine initializes the test environment for subsequent testing processes. At the same time, a DDS or VDDP signal is sent to the target test object to allow the target test object to complete the morphological conversion to meet the needs of the test process.
[0078] Before S205, it should be noted that the structure data includes trigger information for sending data to the target object and expected information for setting expected values. Then in step S205, the trigger is triggered by the user or the preprocessor, and the task scheduler is activated to send the set trigger information as a trigger signal to the DDS / VDDP data channel. The target object has a subscription to DDS / VDDP data, and after receiving the trigger signal, it will feedback the actual value of the trigger signal corresponding to the test case, which is equivalent to completing the process of outputting the results according to the test case feedback.
[0079] S206, compare the actual value with the preset expected value to determine the test result of the target object. Specifically, the feedback value of the target object can be intercepted by a signal interceptor, and the expected value and the actual value are compared by a HU-Compartor or an M-CORE Compartor. When the difference between the two is less than a preset threshold, the test is considered to have passed.
[0080] Figure 3 A schematic diagram of another testing method provided in an embodiment of the present application is shown, combined with the above Figure 2 For the corresponding solution, the use case pool includes multiple business use cases in the test configuration file, and then the use cases are parsed through INIParser and SingalFinding to obtain the structural data. Then the use case registration process is carried out, including testCaseRegister use case registration, test Case Environment Init environment initialization, etc. Then in the triggering stage, the use case data is interacted and fed back to the target test object through the task scheduler to the DDS / VDDP data channel. The signal interceptor intercepts the actual value fed back by the target test object, compares the expected value and the actual value through HU-Compartor or M-CORE Compartor, and finally outputs the test comparison result.
[0081] Based on the scheme described in the above embodiment, a test configuration file containing configuration information of several business use cases is used to directly pass the information of some use cases in the development phase to the test phase in the form of a configuration file, which provides convenience for the test phase. Therefore, the test phase only needs to adjust the environment and the target test object to determine the test results. In essence, a message middleware is simulated, and testers only need to use the test configuration file to complete the automated test process, thereby solving the problem that the current test process has high requirements for testers and requires large labor costs. In addition, this embodiment relies on google gmock to realize the simulation of message middleware, set trigger conditions and expected results based on the configuration file, and automatically verify the test results. Testers only need to use the test configuration file of the previous developer to perform automated testing of scene restoration and output test verification results.
[0082] Further, as Figures 1 to 3 The specific implementation of the method shown in this embodiment provides a testing device, such as Figure 4 As shown, the device includes: an acquisition unit 401, a parsing unit 402, an adjustment unit 403, a processing unit 404 and a judgment unit 405.
[0083] The acquisition unit 401 is configured to acquire a test configuration file; the test configuration file includes configuration information of the business use case;
[0084] The parsing unit 402 is configured to parse the test configuration file to obtain structure data corresponding to the configuration information, wherein the structure data includes: use case information of the business use case, usage rule information of the business use case and target objects involved in the business use case;
[0085] The adjustment unit 403 is configured to register using the use case information, and adjust the test environment and the target object to a test state based on the registered use case information and the usage rule information;
[0086] The processing unit 404 is configured to trigger a test on the target object based on the registered business use case and the test environment, and obtain an actual value of the target object based on the feedback of the trigger signal;
[0087] The judgment unit 405 is configured to compare the actual value with a preset expected value to determine the test result of the target object.
[0088] In a specific application scenario, the parsing unit 402 is specifically configured to perform data parsing on the test configuration file to obtain source data corresponding to the configuration information; and perform structured processing on the source data to obtain the structured data.
[0089] In a specific application scenario, the parsing unit 402 is further configured to perform a format check on the source data, and to check the data type information and the topic information; when the format check, the data type and the topic information meet the requirements, the source data is converted into the structured data.
[0090] In a specific application scenario, the adjustment unit 403 is further configured to use the registered use case information to initialize the test environment; based on the usage rule information, send a morphology transformation instruction to the target object to adjust the target object to the test state.
[0091] In a specific application scenario, the processing unit 404 is further configured to publish the trigger signal to the data channel; receive the actual value fed back by the target object based on the trigger signal; compare the actual value with the preset expected value to determine the test result of the target object.
[0092] In a specific application scenario, the judgment unit 405 is further configured to calculate the absolute value of the difference between the actual value and the expected value; when the absolute value of the difference is less than a preset threshold, determine that the test result of the target object is passed.
[0093] It should be noted that for other corresponding descriptions of the functional units involved in the test device provided in this embodiment, reference can be made to Figures 1 to 3 The corresponding description in will not be repeated here.
[0094] Based on the above Figures 1 to 3 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figures 1 to 3 The method shown.
[0095] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0096] Based on the above Figures 1 to 3 The method shown, and Figure 4 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, which can be configured on a computer side or a vehicle side, etc. The device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figures 1 to 3 The method shown.
[0097] Based on the above electronic device, the embodiment of the present application further provides a vehicle, which may specifically include: Figure 4 The device shown in the figure or the electronic device as described above. The vehicle can be a new energy vehicle or a traditional vehicle.
[0098] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0099] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0100] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware. Using the solution of this embodiment, compared to the related art, the present application utilizes a test configuration file containing configuration information of several business use cases, and directly transfers the information of some use cases in the development phase to the test phase in the form of a configuration file, which provides convenience for the test phase. Then the tester only needs to use the test configuration file to adjust the environment and the target test object to determine the test results, thereby solving the problem that the current test process has high requirements for testers and requires a large labor cost.
[0102] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0103] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features of the present application.
[0104] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0105] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0106] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A testing method, characterized in that: include: Get the test configuration file; The test configuration file contains configuration information of the business use case; Parsing the test configuration file to obtain structural data corresponding to the configuration information, wherein the structural data includes: use case information of the business use case, usage rule information of the business use case, and target objects involved in the business use case; Registering using the use case information, and adjusting the test environment and the target object to a test state based on the registered use case information and the usage rule information; Based on the registered business use case and the test environment, the target object is tested to obtain an actual value of the target object based on feedback of a trigger signal; The actual value is compared with a preset expected value to determine the test result of the target object.
2. The method according to claim 1, characterized in that The parsing of the test configuration file to obtain structure data corresponding to the configuration information includes: Performing data parsing on the test configuration file to obtain source data corresponding to the configuration information; The source data is structured to obtain the structured data.
3. The method according to claim 2, characterized in that The source data includes: data type information and topic information; The step of performing structured processing on the source data to obtain the structured data includes: Performing a format check on the source data, and checking the data type information and the topic information; When the format check, the data type and the topic information all meet the requirements, the source data is converted into the structure data.
4. The method according to claim 1, characterized in that Based on the use case information and the usage rule information, adjusting the test environment and the target object to a test state includes: Initializing the test environment using the registered use case information; Based on the usage rule information, a form transformation instruction is sent to the target object to adjust the target object to the test state.
5. The method according to claim 1, characterized in that Triggering a test on the target object to obtain an actual value of the target object based on feedback of the trigger signal, including: Publishing the trigger signal to the data channel; The actual value fed back by the target object based on the trigger signal is received.
6. The method according to claim 1, characterized in that Comparing the actual value with a preset expected value to determine a test result of the target object includes: Calculating the absolute value of the difference between the actual value and the expected value; When the absolute value of the difference is less than a preset threshold, it is determined that the test result of the target object is passed.
7. A testing device, characterized in that: include: An acquisition unit, configured to acquire a test configuration file; The test configuration file contains configuration information of the business use case; A parsing unit is configured to parse the test configuration file to obtain structure data corresponding to the configuration information, wherein the structure data includes: use case information of the business use case, usage rule information of the business use case and target objects involved in the business use case; an adjusting unit configured to register using the use case information, and adjust the test environment and the target object to a test state based on the registered use case information and the usage rule information; A processing unit, configured to trigger testing of the target object based on the registered business use case and the test environment, and obtain an actual value of the target object based on feedback of the trigger signal; The judgment unit is configured to compare the actual value with a preset expected value to determine a test result of the target object.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
10. A vehicle, characterized in that: include: The device as claimed in claim 7 or the electronic device as claimed in claim 9.
Citation Information
Cited By
Test case conversion method of geometric engine, test method and related product
CN120295905A