Test case generation method, test method, development platform and electronic equipment
By analyzing and subscribing to the configuration files of the on-board network interface and generating test cases, the problem of low testing efficiency of on-board network interfaces in the existing technology is solved, and a more efficient testing process is achieved.
Patent Information
- Application Number
- CN202310955427.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-14
AI Technical Summary
When implementing automated testing of on-board network interfaces, existing controller Ethernet testing tools need to import complex configuration files and test scripts, resulting in low testing efficiency.
By analyzing the configuration file of the on-board network interface, obtaining service items, and generating on-board network services to be tested through subscription operations, encapsulating the service items using the interface protocol, generating test messages, and finally generating test cases based on the test messages.
Simplifies the on-board network interface testing process, improves testing efficiency, and reduces the need for test script writing.
Smart Images

Figure CN119449874A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of electronic information technology, and in particular to a test case generation method, a test method, a development platform and an electronic device. Background Art
[0002] In-vehicle network interfaces such as the SOME / IP interface are used in vehicle networks to enable efficient, reliable and scalable communication between various controllers, sensors and actuators.
[0003] Some current controller Ethernet (such as SOME / IP) test tools need to import general configuration files or database files and executable test scripts into the test tools when implementing automated testing of vehicle network interfaces. The test scripts need to be written by users in CAPL, which has a high learning cost and a complex writing process. After the import is completed, complex network configuration and test module configuration must be performed based on the information in the general configuration files or database files, resulting in low interface testing efficiency. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a test case generation method, a test method, a development platform and an electronic device to at least solve the above-mentioned problems.
[0005] According to a first aspect of an embodiment of the present invention, a test case generation method is provided, the test case generation method comprising parsing a configuration file of an on-board network interface based on a preset parsing rule to obtain a service item of the configuration file, the configuration file having a standard configuration format of the on-board network; obtaining a subscription operation for the service item; generating an on-board network service to be tested according to the subscription operation; encapsulating the service item in the on-board network service to be tested using an interface protocol of the on-board network interface to obtain at least one test message; and generating a test case according to the at least one test message.
[0006] In one implementation, generating a vehicle network service to be tested according to a subscription operation includes: displaying service items of a configuration file as a vehicle network service list; and selecting a service item targeted by the subscription operation from the vehicle network service list as the vehicle network service to be tested.
[0007] In another implementation, generating a test case according to at least one test message includes: obtaining a message sorting rule matching a test requirement; constructing a message sequence of at least one test message based on the message sorting rule; and generating a test case including the message sequence.
[0008] In another implementation, generating a test case including a message sequence includes: representing each test message in the message sequence as a message list; and generating the message list as a file in a list format.
[0009] In another implementation, the test case generation method further includes: starting to execute acquisition of preset parsing rules according to a triggering operation of a test start control configured based on a user interface component; and exporting the test case at an export control configured based on a user interface component.
[0010] In another implementation, the test case generation method further includes importing a configuration file of the vehicle network interface.
[0011] According to a second aspect of an embodiment of the present invention, a testing method is provided, the testing method comprising: importing a test case into a test development platform, the test case being generated by the test case generation method described in the first aspect; and executing the test case in the test development platform.
[0012] According to a third aspect of an embodiment of the present invention, a test development platform is provided, and the test development platform includes: a parsing module, which is used to parse a configuration file of an on-board network interface based on preset parsing rules to obtain service items contained in the configuration file, and the configuration file has a standard configuration format of the on-board network; an acquisition module, which is used to obtain a subscription operation for the service item; a first generation module, which is used to generate a on-board network service to be tested according to the subscription operation; an encapsulation module, which is used to encapsulate the service items in the on-board network service to be tested using an interface protocol of the on-board network interface to obtain at least one test message; and a second generation module, which is used to generate a test case according to at least one test message.
[0013] According to a fourth aspect of an embodiment of the present invention, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes operations corresponding to the test case generation method described in the first aspect above, or executes operations corresponding to the test method described in the second aspect above.
[0014] According to a fifth aspect of an embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, it can implement the test case generation method described in the first aspect above, or it can implement the test method described in the second aspect above.
[0015] In the scheme of the embodiment of the present invention, by parsing the configuration file of the vehicle network interface into service items, subscribing to the service items instead of writing test scripts, and further generating test cases through encapsulation, the vehicle network interface testing process is simplified, which is beneficial to improving the testing efficiency of the vehicle network interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. By reading the detailed description of the embodiments below, the advantages and benefits of the solutions become clear to those skilled in the art. The drawings are only used to illustrate the preferred embodiments and are not to be considered as limiting the present invention.
[0017] In the figure:
[0018] Figure 1 The present invention is a flowchart of a test case generation method according to an exemplary embodiment of the present invention.
[0019] Figure 2 The figure is a flowchart of the steps of a testing method according to another embodiment of the present invention.
[0020] Figure 3 A structural block diagram of a test development platform according to an exemplary embodiment of the present invention.
[0021] Figure 4 is a structural block diagram of an electronic device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to have a clearer understanding of the technical features, purposes and effects of the embodiments of the present invention, the specific implementation of the embodiments of the present invention is now described with reference to the accompanying drawings.
[0023] In this document, “exemplary” means “serving as an example, instance or illustration”, and any diagram or implementation described in this document as “exemplary” should not be interpreted as a more preferred or more advantageous technical solution.
[0024] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one or more of the parts with the same structure or function are schematically drawn, or only one or more of them are marked.
[0025] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.
[0026] The specific implementation of the embodiment of the present invention is further described below in conjunction with the accompanying drawings of the embodiment of the present invention.
[0027] Figure 1 A flowchart of a road image processing method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, this embodiment mainly includes the following steps:
[0028] Step S110 , parsing a configuration file of the vehicle network interface based on a preset parsing rule to obtain a service item of the configuration file, wherein the configuration file has a standard configuration format of the vehicle network.
[0029] It should be understood that the vehicle network interface is the SOME / IP interface. In the vehicle network, an ECU sometimes needs to call services implemented on other ECUs. SOME / IP is the interface that implements this remote service call so that ECU software can communicate with each other.
[0030] It should be understood that the configuration file has the standard configuration format of the vehicle network, usually a configuration file with the suffix format of .arxml, which can be imported into the configuration tool as input for relevant configuration. The configuration file usually contains, for example, software components, ECUC modules, and order information content, where the software component is used to describe the name, version information, interface, configuration parameters and dependencies of the software component. The ECUC module is used to describe the configuration parameters of the automotive electronic control unit (ECU) and the configuration of various modules, such as diagnosis, communication and memory. Order information is used to describe information on the organization and maintenance of AUTOSAR projects, such as versions, change history, personnel information and documentation.
[0031] Furthermore, by parsing the configuration file of the vehicle network interface, the contents contained in the configuration file, such as software components, ECUC modules, and order information, can be obtained, and these contents are used as service items of the configuration file, that is, the service items of the configuration file are obtained, and there are multiple service items.
[0032] It should also be understood that the preset parsing rules are provided by the test development platform.
[0033] Step S120: obtaining a subscription operation for the service item.
[0034] It should be understood that after parsing the configuration file of the vehicle network interface, multiple service items can be obtained. The multiple service items are optional. The user selects the service item through the operation interface of the test development platform to subscribe to the service item, and the test development platform obtains the subscription operation for the service item.
[0035] Exemplarily, there are ten service items, and the user selects five of them through the operation interface of the test development platform. Then the user subscribes to the five service items, and the test development platform obtains the subscription operations for the five service items.
[0036] As another example, there are fifteen service items, and the user selects six of them through the operation interface of the test development platform. Then the user subscribes to the six service items, and the test development platform obtains the subscription operations for the six service items.
[0037] Step S130: generating a vehicle network service to be tested according to the subscription operation.
[0038] It should be understood that the generated in-vehicle network service consists of selected service items.
[0039] Step S140: encapsulate the service items in the vehicle network service to be tested by using the interface protocol of the vehicle network interface to obtain at least one test message.
[0040] It should be understood that the test message is an encapsulated service item. There can be multiple test messages, which correspond to the number of service items.
[0041] Step S150: Generate a test case according to the at least one test message.
[0042] In summary, in the scheme of the embodiment of the present invention, by parsing the configuration file of the vehicle network interface into a service item, and replacing the writing of a test script with the subscription to the service item, and further generating test cases through encapsulation, the vehicle network interface testing process is simplified, which is beneficial to improving the testing efficiency of the vehicle network interface.
[0043] In one implementation, generating a vehicle network service to be tested according to a subscription operation includes: displaying service items of a configuration file as a vehicle network service list; and selecting a service item targeted by the subscription operation from the vehicle network service list as the vehicle network service to be tested.
[0044] For example, if there are twenty service items in the configuration file, the service items in the configuration file are displayed in a list, that is, the service items in the configuration file are displayed as a vehicle network service list, and seven service items are checked from the vehicle network service list, and these seven service items are subscribed to, and these seven services are selected as the vehicle network services to be tested. Subscribing to service items replaces writing test scripts, which is conducive to improving the test efficiency of the vehicle network interface.
[0045] In another implementation, generating a test case according to at least one test message includes: obtaining a message sorting rule matching a test requirement; constructing a message sequence of at least one test message based on the message sorting rule; and generating a test case including the message sequence.
[0046] It should be understood that the message sorting rule indicates the order in which the multiple test messages are arranged.
[0047] It should also be understood that the message sorting rules are a plurality of pre-set message sorting rules, and the plurality of message sorting rules are respectively adapted to different test requirements.
[0048] It should also be understood that the message sequence is a sequence number of multiple test messages.
[0049] In another implementation, generating a test case including a message sequence includes: representing each test message in the message sequence as a message list; and generating the message list as a file in a list format.
[0050] It should be understood that each test message in the message sequence is characterized as a message list, that is, each test message in the message sequence is shown in a list form.
[0051] It should also be understood that generating the message list as a file in a list format means generating the message list as an EXCEL file.
[0052] Exemplarily, there are 20 test messages in total. The 20 test messages in the message sequence are represented as a message list, and the message list is generated into an EXCEL file. The EXCEL file includes the 20 test messages.
[0053] As another example, if there are two message sequences, one message sequence has ten test messages and the other message sequence has fifteen test messages, then the test messages in the two message sequences are represented as two message lists respectively, and these two message lists are generated into EXCEL files, where one EXCEL file contains ten test messages and the other EXCEL file contains fifteen test messages.
[0054] In another implementation, the test case generation method further includes: starting to execute acquisition of preset parsing rules according to a triggering operation of a test start control configured based on a user interface component; and exporting the test case at an export control configured based on a user interface component.
[0055] It should be understood that when exporting test cases using the export control based on the configuration of the user interface component, the test cases are exported in the form of an EXCEL file.
[0056] In another implementation, the test case generation method further includes importing a configuration file of the vehicle network interface.
[0057] It should be understood that importing the configuration file of the vehicle network interface means importing the .arxml configuration file of the vehicle network interface.
[0058] In summary, in the scheme of the embodiment of the present invention, by parsing the configuration file of the vehicle network interface into a service item, and replacing the writing of a test script with the subscription to the service item, and further generating test cases through encapsulation, the vehicle network interface testing process is simplified, which is beneficial to improving the testing efficiency of the vehicle network interface.
[0059] See also Figure 2 This is a flow chart of the steps of a testing method according to another embodiment of the present invention, which mainly includes the following steps:
[0060] Step S210: import the test case into the test development platform.
[0061] Step S220, executing the test case in the test development platform.
[0062] By using a test development platform that generates test cases to directly execute the test cases, the vehicle network interface test process is simplified and the test efficiency of the vehicle network interface is improved.
[0063] The test case is specifically generated in the following manner: based on preset parsing rules, the configuration file of the vehicle network interface is parsed to obtain the service items of the configuration file, and the configuration file has a standard configuration format of the vehicle network; a subscription operation for the service item is obtained; based on the subscription operation, the vehicle network service to be tested is generated; the interface protocol of the vehicle network interface is used to encapsulate the service items in the vehicle network service to be tested to obtain at least one test message; and a test case is generated based on the at least one test message.
[0064] It should be understood that the vehicle network interface is the SOME / IP interface. In the vehicle network, an ECU sometimes needs to call services implemented on other ECUs. SOME / IP is the interface that implements this remote service call so that ECU software can communicate with each other.
[0065] It should also be understood that the configuration file has a standard configuration format for vehicle networks, usually a configuration file with a suffix of .arxml, which can be used as an input to import the configuration tool for related configuration. The configuration file usually contains, for example, software components, ECUC modules, order information content, among which
[0066] Software components are used to describe the names, version information, interfaces, configuration parameters, and dependencies of software components. ECUC modules are used to describe the configuration parameters of automotive electronic control units (ECUs) and the configuration of various modules, such as diagnosis, communication, and memory. Order information is used to describe information on the organization and maintenance of AUTOSAR projects, such as versions, change history, personnel information, and documentation.
[0067] Furthermore, by parsing the configuration file of the vehicle network interface, the contents contained in the configuration file, such as software components, ECUC modules, and order information, can be obtained, and these contents are used as service items of the configuration file, that is, the service items of the configuration file are obtained, and there are multiple service items.
[0068] It should also be understood that the preset parsing rules are provided by the test development platform.
[0069] It should also be understood that after parsing the configuration file of the vehicle network interface, multiple service items can be obtained. The multiple service items are optional. The user selects the service item through the operation interface of the test development platform to subscribe to the service item, and the test development platform obtains the subscription operation for the service item.
[0070] Exemplarily, there are ten service items, and the user selects five of them through the operation interface of the test development platform. Then the user subscribes to the five service items, and the test development platform obtains the subscription operations for the five service items.
[0071] As another example, there are fifteen service items, and the user selects six of them through the operation interface of the test development platform. Then the user subscribes to the six service items, and the test development platform obtains the subscription operations for the six service items.
[0072] It should also be understood that the generated in-vehicle network service is composed of selected service items.
[0073] It should also be understood that the test message is an encapsulated service item, and there can be multiple test messages, which correspond to the number of service items.
[0074] In another implementation, generating a vehicle network service to be tested according to a subscription operation includes: displaying service items of a configuration file as a vehicle network service list; and selecting a service item targeted by the subscription operation from the vehicle network service list as the vehicle network service to be tested.
[0075] For example, if there are twenty service items in the configuration file, the service items in the configuration file are displayed in a list, that is, the service items in the configuration file are displayed as a vehicle network service list, and seven service items are checked from the vehicle network service list, and these seven service items are subscribed to, and these seven services are selected as the vehicle network services to be tested. Subscribing to service items replaces writing test scripts, which is conducive to improving the test efficiency of the vehicle network interface.
[0076] In another implementation, generating a test case according to at least one test message includes: obtaining a message sorting rule matching a test requirement; constructing a message sequence of at least one test message based on the message sorting rule; and generating a test case including the message sequence.
[0077] It should be understood that the message sorting rule indicates the order in which the multiple test messages are arranged.
[0078] It should also be understood that the message sorting rules are a plurality of pre-set message sorting rules, and the plurality of message sorting rules are respectively adapted to different test requirements.
[0079] It should also be understood that the message sequence is a sequence number of multiple test messages.
[0080] In another implementation, generating a test case including a message sequence includes: representing each test message in the message sequence as a message list; and generating the message list as a file in a list format.
[0081] It should be understood that each test message in the message sequence is characterized as a message list, that is, each test message in the message sequence is shown in a list form.
[0082] It should also be understood that generating the message list as a file in a list format means generating the message list as an EXCEL file.
[0083] Exemplarily, there are 20 test messages in total. The 20 test messages in the message sequence are represented as a message list, and the message list is generated into an EXCEL file. The EXCEL file includes the 20 test messages.
[0084] As another example, if there are two message sequences, one message sequence has ten test messages and the other message sequence has fifteen test messages, then the test messages in the two message sequences are represented as two message lists respectively, and these two message lists are generated into EXCEL files, where one EXCEL file contains ten test messages and the other EXCEL file contains fifteen test messages.
[0085] In another implementation, the test case generation method further includes: starting to execute acquisition of preset parsing rules according to a triggering operation of a test start control configured based on a user interface component; and exporting the test case at an export control configured based on a user interface component.
[0086] It should be understood that when exporting test cases using the export control based on the configuration of the user interface component, the test cases are exported in the form of an EXCEL file.
[0087] In another implementation, the test case generation method further includes importing a configuration file of the vehicle network interface.
[0088] It should be understood that importing the configuration file of the vehicle network interface means importing the .arxml configuration file of the vehicle network interface.
[0089] See also Figure 3 FIG. 3 is a structural block diagram of a test development platform 300 according to an exemplary embodiment of the present invention. The test development platform 300 mainly includes:
[0090] The parsing module 310 is used to parse the configuration file of the vehicle network interface based on preset parsing rules to obtain the service items included in the configuration file. The configuration file has a standard configuration format of the vehicle network.
[0091] The acquisition module 320 is used to acquire a subscription operation for a service item.
[0092] The first generating module 330 is used to generate the in-vehicle network service to be tested according to the subscription operation.
[0093] The encapsulation module 340 is used to encapsulate the service items in the vehicle network service to be tested by using the interface protocol of the vehicle network interface to obtain at least one test message.
[0094] The second generating module 350 is configured to generate a test case according to at least one test message.
[0095] The first generating module 330 is further configured to display the service items of the configuration file as a vehicle network service list; and select the service item targeted by the subscription operation from the vehicle network service list as the vehicle network service to be tested.
[0096] The second generation module 350 is further used to obtain a message sorting rule that matches the test requirement; based on the message sorting rule, construct a message sequence of the at least one test message; and generate a test case including the message sequence. The generating of the test case including the message sequence includes: representing each test message in the message sequence as a message list; and generating the message list as a file in a list format.
[0097] The test development platform 300 also includes: an execution module, which is used to execute test cases.
[0098] The test development platform 300 also includes: an export module, which is used to start acquiring the preset parsing rules according to the triggering operation of the test start control configured based on the user interface component; and export the test case at the export control configured based on the user interface component.
[0099] In summary, in the scheme of the embodiment of the present invention, by parsing the configuration file of the vehicle network interface into a service item, and subscribing to the service item instead of writing a test script, and further generating test cases through encapsulation, the vehicle network interface testing process is simplified, which is beneficial to improving the testing efficiency of the vehicle network interface.
[0100] The test development platform of this embodiment is used to implement the corresponding methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments. In addition, the functional implementation of each module in the test development platform of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments.
[0101] According to another embodiment of the present invention, an electronic device 400 is provided. Figure 4 , a block diagram of an electronic device 400 that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, user digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile systems, such as user digital processing, cellular phones, smart phones, wearable devices, and other similar computing systems. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0102] The electronic device 400 may include a processor 402 , a communications interface 404 , a memory 406 , and a communications bus 408 .
[0103] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other electronic devices or servers.
[0104] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above method embodiment.
[0105] Specifically, the program 410 may include program codes, which include computer operation instructions.
[0106] The processor 402 may be a processor CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0107] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0108] Program 410 can be specifically used to enable processor 402 to perform the following operations: based on preset parsing rules, parse the configuration file of the vehicle network interface to obtain the service items of the configuration file, where the configuration file has a standard configuration format of the vehicle network; obtain a subscription operation for the service item; generate a vehicle network service to be tested according to the subscription operation; encapsulate the service items in the vehicle network service to be tested using the interface protocol of the vehicle network interface to obtain at least one test message; and generate a test case according to the at least one test message.
[0109] The program 410 may also be used to enable the processor 402 to perform the following operations: import the test case into the test development platform; and execute the test case in the test development platform.
[0110] In addition, the specific implementation of each step in program 410 can refer to the corresponding description of the corresponding steps and units in the above method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.
[0111] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.
[0112] Exemplary embodiments of the present invention further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the methods of various embodiments of the present invention.
[0113] The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code that may be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded over a network and will be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, processor, or programmable or hardware (such as an ASIC or FPGA). It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, processor, or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the method shown herein.
[0114] Thus far, specific embodiments of the present invention have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired results. Additionally, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing may be advantageous.
[0115] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0116] In the description of the present invention, the terms "first" and "second" are only used to facilitate the description of different components or names, and cannot be understood as indicating or implying a sequential relationship, relative importance, or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.
[0117] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0118] It should be understood that although this specification is described according to various embodiments, not every embodiment contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0119] The examples of the embodiments of the present invention are intended to concisely illustrate the technical features of the embodiments of the present invention so that those skilled in the art can intuitively understand the technical features of the embodiments of the present invention, and are not intended to be improper limitations of the embodiments of the present invention.
[0120] Finally, it should be noted that the above implementation methods are only used to illustrate the embodiments of the present invention, and are not limitations of the embodiments of the present invention. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention. The patent protection scope of the embodiments of the present invention should be defined by the claims.
Claims
1. A test case generation method, characterized in that: include: Parsing a configuration file of the vehicle network interface based on a preset parsing rule to obtain a service item of the configuration file, wherein the configuration file has a standard configuration format of the vehicle network; Obtaining a subscription operation for the service item; According to the subscription operation, generating a vehicle network service to be tested; Encapsulating the service items in the vehicle network service to be tested by using the interface protocol of the vehicle network interface to obtain at least one test message; A test case is generated according to the at least one test message.
2. The method according to claim 1, characterized in that: The generating the vehicle network service to be tested according to the subscription operation includes: Displaying the service items of the configuration file as a vehicle network service list; From the in-vehicle network service list, select the service item targeted by the subscription operation as the in-vehicle network service to be tested.
3. The method according to claim 2, characterized in that The generating a test case according to the at least one test message comprises: Get the message sorting rules that match the test requirements; Based on the message sorting rule, construct a message sequence of the at least one test message; A test case is generated that includes the message sequence.
4. The method according to claim 3, characterized in that The generating of a test case including the message sequence comprises: Characterizing each test message in the message sequence as a message list; The message list is generated as a file in a list format.
5. The method according to claim 1, characterized in that The method further comprises: According to the triggering operation of the test start control configured based on the user interface component, the acquisition of the preset parsing rule is started; The test case is exported at an export control configured based on the user interface component.
6. The method according to claim 1, characterized in that The method also includes importing a configuration file of the vehicle network interface.
7. A testing method, characterized in that: include: Importing a test case into a test development platform, wherein the test case is generated by the test case generation method according to any one of claims 1 to 6; The test case is executed in the test development platform.
8. A test development platform, characterized in that: include: A parsing module, used to parse a configuration file of the vehicle network interface based on a preset parsing rule to obtain service items included in the configuration file, wherein the configuration file has a standard configuration format of the vehicle network; An acquisition module, used to acquire a subscription operation for the service item; A first generating module, used to generate a vehicle network service to be tested according to the subscription operation; An encapsulation module, used to encapsulate the service items in the vehicle network service to be tested by using the interface protocol of the vehicle network interface to obtain at least one test message; The second generating module is used to generate a test case according to the at least one test message.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor performs operations corresponding to the test case generation method according to any one of claims 1 to 6, or performs operations corresponding to the test method according to claim 7.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by the processor, the test case generation method according to any one of claims 1 to 6 is implemented, or the test method according to claim 7 can be implemented.