Automated testing methods, apparatus, equipment and storage media for vehicle service interfaces
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-13
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]本发明提供一种车载服务接口自动化测试方法、装置、设备及存储介质,以解决现有技术测试难度较大和测试周期较长,无法满足系统快速迭代的需求的问题,本发明能够屏蔽不同供应商系统间的差异,为车载服务接口提供方便、快捷的自动化测试方法,自动化程度高,满足车载系统快速迭代的需求
[0027] Compared with existing technologies, the present invention provides an automated testing method, apparatus, device, and storage medium for in-vehicle service interfaces. Responding to a user's selection command for a service name to be tested, it executes several test cases corresponding to that service name. During the execution of these test cases, an adaptation layer service calls the framework layer interface corresponding to the service name to be tested, generating a test result for each test case after the execution of all test cases. Therefore, the present invention shields the differences between different vendor systems through an adaptation layer, automatically performs testing in response to the user's selection command for the service name to be tested, achieving a high degree of automation, low testing difficulty, reduced workload for testers, and the ability to quickly identify system-side issues after the in-vehicle system is released. The short testing cycle meets the needs of rapid iteration in in-vehicle systems.
Smart Images

Figure CN116069641B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interface testing technology, and in particular to an automated testing method, apparatus, equipment, and storage medium for vehicle service interfaces. Background Technology
[0002] The Android automotive framework layer provides interfaces for various service modules, such as radio, Bluetooth, system, and audio. Testing methods typically involve testers performing functional testing, monkey testing, stress testing, and so on. However, due to the differences in interfaces provided by various in-vehicle system vendors, when there are interface changes in the framework layer, testers need to repeatedly perform full-scale testing to ensure interface compliance after each in-vehicle system version release. This results in significant testing difficulty and a long testing cycle, failing to meet the needs of rapid iteration in in-vehicle systems. Summary of the Invention
[0003] This invention provides an automated testing method, apparatus, device, and storage medium for in-vehicle service interfaces, addressing the problems of high testing difficulty and long testing cycles in existing technologies, which cannot meet the needs of rapid system iteration. This invention can shield the differences between systems from different suppliers, providing a convenient and fast automated testing method for in-vehicle service interfaces with a high degree of automation, meeting the needs of rapid iteration of in-vehicle systems.
[0004] To achieve the above objectives, embodiments of the present invention provide an automated testing method for vehicle service interfaces, comprising:
[0005] In response to the user's instruction to select a service name to be tested, several test cases corresponding to the service name to be tested are executed.
[0006] During the execution of several test cases, the framework layer interface corresponding to the name of the service to be tested is called through the adaptation layer service, so as to generate each test result of each test case after the execution of several test cases.
[0007] As an improvement to the above solution, after generating each test result for each of the aforementioned test cases, the automated testing method for the vehicle service interface further includes:
[0008] A visual test report is generated based on the results of each test.
[0009] As an improvement to the above solution, the automated testing method for vehicle service interfaces further includes: when the test result is a failure, obtaining the reason for the failure of the test case execution, and generating a visual test report from the reason.
[0010] As an improvement to the above solution, the step of responding to the user's selection instruction for the name of the service to be tested and executing several test cases corresponding to the name of the service to be tested includes:
[0011] In response to the user's instruction to select a service name to be tested, the service name to be tested is obtained;
[0012] Based on the preset correspondence between service names and test case paths, find each test case path corresponding to each of the service names to be tested;
[0013] Based on each test case path, several test cases are executed in a preset execution order.
[0014] As an improvement to the above solution, before executing several test cases corresponding to the service name to be tested in response to the user's selection instruction, the automated testing method for the vehicle service interface further includes:
[0015] Initialize the runtime environment for the test cases.
[0016] To achieve the above objectives, embodiments of the present invention provide an automated testing device for vehicle service interfaces, comprising:
[0017] The selection instruction response module is used to execute several test cases corresponding to the name of the service to be tested in response to the user's selection instruction for the name of the service to be tested.
[0018] The test result generation module is used to call the framework layer interface corresponding to the name of the service to be tested through the adaptation layer service during the execution of several test cases, so as to generate each test result of each test case after the execution of several test cases.
[0019] As an improvement to the above solution, the automated testing device for the vehicle service interface further includes:
[0020] The visualization test report generation module is used to generate a visualization test report based on each test result.
[0021] As an improvement to the above solution, the step of responding to the user's selection instruction for the name of the service to be tested and executing several test cases corresponding to the name of the service to be tested includes:
[0022] In response to the user's instruction to select a service name to be tested, the service name to be tested is obtained;
[0023] Based on the preset correspondence between service names and test case paths, find each test case path corresponding to each of the service names to be tested;
[0024] Based on each test case path, several test cases are executed in a preset execution order.
[0025] To achieve the above objectives, embodiments of the present invention provide an automated testing device for vehicle service interfaces, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the automated testing method for vehicle service interfaces as described above.
[0026] To achieve the above objectives, embodiments of the present invention provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the automated testing method for the vehicle service interface as described above.
[0027] Compared with existing technologies, the present invention provides an automated testing method, apparatus, device, and storage medium for in-vehicle service interfaces. Responding to a user's selection command for a service name to be tested, it executes several test cases corresponding to that service name. During the execution of these test cases, an adaptation layer service calls the framework layer interface corresponding to the service name to be tested, generating a test result for each test case after the execution of all test cases. Therefore, the present invention shields the differences between different vendor systems through an adaptation layer, automatically performs testing in response to the user's selection command for the service name to be tested, achieving a high degree of automation, low testing difficulty, reduced workload for testers, and the ability to quickly identify system-side issues after the in-vehicle system is released. The short testing cycle meets the needs of rapid iteration in in-vehicle systems. Attached Figure Description
[0028] Figure 1 This is a flowchart of an automated testing method for an in-vehicle service interface provided by an embodiment of the present invention;
[0029] Figure 2 This is a structural block diagram of an automated testing device for vehicle service interfaces provided in an embodiment of the present invention;
[0030] Figure 3 This is a structural block diagram of an automated testing device for vehicle service interfaces provided in an embodiment of the present invention. Detailed Implementation
[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] See Figure 1 , Figure 1 This is a flowchart of an automated testing method for an in-vehicle service interface provided by an embodiment of the present invention. The automated testing method for the in-vehicle service interface includes:
[0033] S1. In response to the user's selection instruction for the name of the service to be tested, execute several test cases corresponding to the name of the service to be tested;
[0034] S2. During the execution of several test cases, the framework layer interface corresponding to the name of the service to be tested is called through the adaptation layer service, so as to generate each test result of each test case after the execution of several test cases.
[0035] Understandably, testers configure the service names of all modules to be tested before testing. During testing, testers select the service name to be tested and begin executing several test cases corresponding to that service name. Test cases are code used to test the integrity of specific interfaces.
[0036] During the execution of test cases, the framework layer interface called is the interface to be tested; the adaptation layer service is actually the APP that actually calls the underlying interface, which will shield the differences between vendor systems. The adaptation layer service will call the framework layer interfaces of different vendors. This service is tested as the object of test to test its integrity. The test cases test whether the interface provided by the adaptation layer service is normal; the framework layer interface is actually the interface provided to the outside by the system layer. It is the interface that the adaptation layer service will ultimately call. The test cases ultimately test the availability of the interface in this layer.
[0037] After the test cases are executed, test results will be generated. The test results indicate whether the called interface under test was executed successfully or failed. The test results after executing the test cases show the execution status of the test cases. If the test result is successful, it is pass; if the test result is unsuccessful, it is fail.
[0038] In an optional embodiment, after generating each test result for each of the test cases, the automated testing method for the vehicle service interface further includes:
[0039] A visual test report is generated based on the results of each test.
[0040] The visual test reports generated by the embodiments of the present invention are more intuitive and easier for users to analyze and understand.
[0041] In an optional embodiment, the automated testing method for the vehicle service interface further includes: when the test result is a failure, obtaining the reason for the failure of the test case execution, and generating a visual test report from the reason.
[0042] In this embodiment of the invention, the test result of the test case is the execution status of the interface under test: Success / Failed. If an error occurs, the test result will be exported along with the error reason. The export format and path can be preset. The test result after executing the test case is the execution status of the test case. If the test result is successful, it is a pass; if the test result is a failure, it is a fail. The reason for the failure can be exported. Optionally, the visualized test report includes: the name of the service under test, the interface name, the test result, and the reason.
[0043] In an optional embodiment, the step of executing a plurality of test cases corresponding to the name of the service to be tested in response to the user's selection instruction includes:
[0044] In response to the user's instruction to select a service name to be tested, the service name to be tested is obtained;
[0045] Based on the preset correspondence between service names and test case paths, find each test case path corresponding to each of the service names to be tested;
[0046] Based on each test case path, several test cases are executed in a preset execution order.
[0047] It is understood that in this embodiment of the invention, each module is dynamically tested based on the service name. Before testing, the tester configures the service names of all modules to be tested and the test case paths corresponding to the service names. During testing, the tester selects the service name to be tested, finds each test case path corresponding to each service name to be tested according to the preset correspondence between service names and test case paths, and executes the test cases according to the preset execution order.
[0048] In an optional embodiment, before executing a plurality of test cases corresponding to the name of the service to be tested in response to the user's selection instruction for the name of the service to be tested, the automated testing method for the vehicle service interface further includes:
[0049] Initialize the runtime environment for the test cases.
[0050] Understandably, the runtime environment is initialized before responding to the user's command to select the name of the service to be tested, to ensure the execution of test cases.
[0051] This invention provides an automated testing method for in-vehicle service interfaces. Responding to a user's selection command for a service name to be tested, it executes several test cases corresponding to that service name. During the execution of these test cases, an adaptation layer service calls the framework layer interface corresponding to the service name to be tested. After the execution of all test cases, a test result for each test case is generated. Therefore, this invention shields the differences between different vendor systems through an adaptation layer, automatically performs testing in response to the user's selection command for the service name to be tested, achieving a high degree of automation, low testing difficulty, reduced workload for testers, and the ability to quickly identify system-side issues after the in-vehicle system is released. The short testing cycle meets the needs of rapid iteration in in-vehicle systems.
[0052] See Figure 2 , Figure 2 This is a structural block diagram of an automated testing device 10 for an in-vehicle service interface provided in an embodiment of the present invention. The automated testing device 10 for the in-vehicle service interface includes:
[0053] The selection instruction response module 11 is used to execute several test cases corresponding to the name of the service to be tested in response to the user's selection instruction for the name of the service to be tested.
[0054] The test result generation module 12 is used to call the framework layer interface corresponding to the name of the service to be tested through the adaptation layer service during the execution of several test cases, so as to generate each test result of each test case after the execution of several test cases.
[0055] Preferably, the automated testing device for the vehicle service interface further includes:
[0056] The visualization test report generation module is used to generate a visualization test report based on each test result.
[0057] Preferably, when the test result is a failure, the reason for the failure of the test case is obtained, and the reason is used to generate a visual test report.
[0058] Preferably, in response to the user's selection instruction for the name of the service to be tested, several test cases corresponding to the name of the service to be tested are executed, including:
[0059] In response to the user's instruction to select a service name to be tested, the service name to be tested is obtained;
[0060] Based on the preset correspondence between service names and test case paths, find each test case path corresponding to each of the service names to be tested;
[0061] Based on each test case path, several test cases are executed in a preset execution order.
[0062] Preferably, the automated testing device for the vehicle service interface further includes:
[0063] The initialization module is used to initialize the runtime environment of test cases.
[0064] It is worth noting that the working process of each module in the vehicle service interface automated testing device 10 described in the embodiments of the present invention can refer to the working process of the vehicle service interface automated testing method described in the above embodiments, and will not be repeated here.
[0065] The automated testing device 10 for in-vehicle service interfaces provided in this embodiment of the invention executes a plurality of test cases corresponding to the name of the service to be tested in response to a user's selection instruction for the name of the service to be tested. During the execution of the plurality of test cases, an adaptation layer service calls the framework layer interface corresponding to the name of the service to be tested, so as to generate each test result for each test case after the execution of the plurality of test cases. Therefore, this embodiment of the invention shields the differences between different vendor systems through the adaptation layer, automatically performs testing in response to the user's selection instruction for the name of the service to be tested, has a high degree of automation, low testing difficulty, reduces the workload of testers, can quickly discover system-side problems after the release of the in-vehicle system, has a short testing cycle, and meets the needs of rapid iteration of in-vehicle systems.
[0066] This invention also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the automated testing method for the vehicle service interface as described in the above embodiments.
[0067] See Figure 3 , Figure 3 This is a structural block diagram of an automated testing device 20 for an in-vehicle service interface provided in an embodiment of the present invention. The automated testing device 20 for the in-vehicle service interface includes: a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the above-described embodiments of the automated testing method for in-vehicle service interfaces. Alternatively, when the processor 21 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments.
[0068] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the vehicle service interface automated testing equipment 20.
[0069] The automated testing equipment 20 for the vehicle service interface can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The automated testing equipment 20 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of the automated testing equipment 20 for the vehicle service interface and does not constitute a limitation on the equipment. It may include more or fewer components than shown, or combine certain components, or use different components. For example, the automated testing equipment 20 for the vehicle service interface may also include input / output devices, network access devices, buses, etc.
[0070] The processor 21 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The processor 21 is the control center of the vehicle service interface automated testing equipment 20, connecting all parts of the equipment via various interfaces and lines.
[0071] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the vehicle service interface automated testing equipment 20 by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0072] The modules / units integrated in the vehicle service interface automated testing equipment 20, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0073] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0074] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. An automated testing method for vehicle service interfaces, characterized in that, include: In response to the user's instruction to select a service name to be tested, several test cases corresponding to the service name to be tested are executed. During the execution of several test cases, the framework layer interface corresponding to the name of the service to be tested is called through the adaptation layer service, so as to generate each test result of each test case after the execution of several test cases. The step of responding to the user's selection instruction for the name of the service to be tested, and executing several test cases corresponding to the name of the service to be tested, includes: In response to the user's instruction to select a service name to be tested, the service name to be tested is obtained; Based on the preset correspondence between service names and test case paths, find each test case path corresponding to each of the service names to be tested; Based on each test case path, several test cases are executed in a preset execution order.
2. The automated testing method for vehicle service interfaces as described in claim 1, characterized in that, After generating each test result for each of the aforementioned test cases, the automated testing method for the vehicle service interface further includes: A visual test report is generated based on the results of each test.
3. The automated testing method for vehicle service interfaces as described in claim 2, characterized in that, The automated testing method for the vehicle service interface further includes: when the test result is a failure, obtaining the reason for the failure of the test case execution, and generating a visual test report based on the reason.
4. The automated testing method for vehicle service interfaces as described in claim 1, characterized in that, Before executing several test cases corresponding to the name of the service to be tested in response to the user's selection instruction, the automated testing method for the vehicle service interface further includes: Initialize the runtime environment for the test cases.
5. An automated testing device for vehicle-mounted service interfaces, characterized in that, include: The selection instruction response module is used to execute several test cases corresponding to the name of the service to be tested in response to the user's selection instruction for the name of the service to be tested. The test result generation module is used to call the framework layer interface corresponding to the name of the service to be tested through the adaptation layer service during the execution of several test cases, so as to generate each test result of each test case after the execution of several test cases. The step of responding to the user's selection instruction for the name of the service to be tested, and executing several test cases corresponding to the name of the service to be tested, includes: In response to the user's instruction to select a service name to be tested, the service name to be tested is obtained; Based on the preset correspondence between service names and test case paths, find each test case path corresponding to each of the service names to be tested; Based on each test case path, several test cases are executed in a preset execution order.
6. The automated testing device for vehicle service interfaces as described in claim 5, characterized in that, The automated testing device for the vehicle service interface also includes: The visualization test report generation module is used to generate a visualization test report based on each test result.
7. An automated testing device for vehicle-mounted service interfaces, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the automated testing method for an in-vehicle service interface as described in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the automated testing method for the vehicle service interface as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Automated test method and apparatus
CN108829556A