Interface test method and device of application program, vehicle and storage medium

By automatically generating application test scripts, the problems of large development work, high cost and long time consuming caused by manual writing of test scripts in the existing technology are solved, and efficient and automated interface testing is achieved.

CN120029890APending Publication Date: 2025-05-23XIAOMI EV TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311517409.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The testing methods of applications in the prior art require manual writing of test scripts, resulting in large development workload, high labor costs and long time.

Method used

By obtaining the signal matrix of the application to be tested, generating a test script, and performing interface testing based on the test script, the automatic generation of the test script is realized.

Benefits of technology

It reduces development workload, reduces labor costs, shortens testing time, and improves automation, and is suitable for interface testing scenarios of vehicle and machine systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029890A_ABST
    Figure CN120029890A_ABST
Patent Text Reader

Abstract

The invention relates to an interface testing method and device of an application program, a vehicle and a storage medium, and belongs to the technical field of program testing and vehicles. The method comprises the following steps: acquiring a first signal matrix of a to-be-tested application program; generating a test script of the application program based on the first signal matrix; and based on the test script, performing an interface test on the application program. Therefore, the first signal matrix of the application program can be considered, automatic generation of the test script can be realized to perform interface testing on the application program, and compared with the prior art that the test script needs to be written manually mostly, the method has the advantages of low development workload, low labor cost, short time consumption, high automation degree and the like, and is suitable for an interface testing scene of a vehicle-mounted terminal system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of program testing and vehicle technology, and in particular to an application program interface testing method, device, vehicle and storage medium. Background Art

[0002] At present, with the continuous development of Internet technology, the development and iteration of applications are relatively frequent to meet people's usage needs. In order to ensure the normal operation of the application, most applications need to be tested before they are officially put into use. However, the application testing methods in the related art mostly require manual writing of test scripts, which has the problems of high development workload, high labor cost and long time consumption. Summary of the invention

[0003] The present disclosure provides an application interface testing method, device, vehicle, and computer-readable storage medium to at least solve the problem that most application testing methods in related technologies require manual writing of test scripts, which results in a large amount of development work, high labor costs, and a long time consumption. The technical solution of the present disclosure is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided a method for interface testing of an application, comprising: obtaining a first signal matrix of an application to be tested; generating a test script of the application based on the first signal matrix; and performing an interface test on the application based on the test script.

[0005] In one embodiment of the present disclosure, obtaining a first signal matrix of an application to be tested includes: obtaining second signal matrices of multiple subroutines of the application; and obtaining the first signal matrix based on the second signal matrices of the multiple subroutines.

[0006] In one embodiment of the present disclosure, generating a test script for the application based on the first signal matrix includes: generating a data dictionary file based on the first signal matrix; and generating the test script based on the data dictionary file.

[0007] In one embodiment of the present disclosure, generating the test script based on the data dictionary file includes: extracting information from the data dictionary file to obtain key information; and generating the test script based on the key information.

[0008] In one embodiment of the present disclosure, generating the test script based on the key information includes: acquiring a setting syntax of the test script; and generating the test script based on the key information and the setting syntax.

[0009] In one embodiment of the present disclosure, performing interface testing on the application based on the test script includes: splitting the test script to obtain multiple test sub-scripts; and performing interface testing on the application based on the multiple test sub-scripts.

[0010] In one embodiment of the present disclosure, splitting the test script to obtain multiple test sub-scripts includes: splitting the application to obtain multiple sub-programs; extracting content associated with the sub-program from the test script as the test sub-script of the sub-program.

[0011] In one embodiment of the present disclosure, the interface testing of the application based on the multiple test sub-scripts includes: obtaining the hierarchical relationship between the multiple sub-programs; and performing interface testing of the application based on the hierarchical relationship and the multiple test sub-scripts.

[0012] In one embodiment of the present disclosure, the interface testing of the application based on the hierarchical relationship and the multiple test sub-scripts includes: identifying that the hierarchical levels of the first sub-program and the second sub-program are the same level, and the first sub-program and the second sub-program are any two sub-programs for aggregating into a target program, wherein the target program includes a third sub-program and the application; and performing interface testing on the first sub-program and the second sub-program based on the test sub-script of the first sub-program and the test sub-script of the second sub-program.

[0013] In one embodiment of the present disclosure, the interface testing of the application based on the test script includes: configuring a test project of the application based on the test script; and running the test project to perform interface testing on the application.

[0014] In one embodiment of the present disclosure, running the test project to perform interface testing on the application includes: generating an interface test report of the application based on the interface test result of the application; and sending the interface test report to a client associated with the application.

[0015] According to a second aspect of an embodiment of the present disclosure, there is provided an interface testing device for an application, comprising: an acquisition module configured to execute acquisition of a first signal matrix of an application to be tested; a generation module configured to execute generation of a test script for the application based on the first signal matrix; and a test module configured to execute interface testing of the application based on the test script.

[0016] In one embodiment of the present disclosure, the acquisition module is further configured to execute: acquiring second signal matrices of multiple subroutines of the application; and obtaining the first signal matrix based on the second signal matrices of the multiple subroutines.

[0017] In one embodiment of the present disclosure, the generating module is further configured to execute: generating a data dictionary file based on the first signal matrix; generating the test script based on the data dictionary file.

[0018] In one embodiment of the present disclosure, the generating module is further configured to execute: extracting information from the data dictionary file to obtain key information; and generating the test script based on the key information.

[0019] In one embodiment of the present disclosure, the generating module is further configured to execute: obtaining a setting syntax of the test script; and generating the test script based on the key information and the setting syntax.

[0020] In one embodiment of the present disclosure, the test module is further configured to execute: splitting the test script to obtain a plurality of test sub-scripts; and performing interface testing on the application based on the plurality of test sub-scripts.

[0021] In one embodiment of the present disclosure, the test module is further configured to execute: splitting the application to obtain multiple sub-programs; extracting content associated with the sub-program from the test script as a test sub-script of the sub-program.

[0022] In one embodiment of the present disclosure, the test module is further configured to execute: obtaining the hierarchical relationship between the plurality of subprograms; and performing interface testing on the application based on the hierarchical relationship and the plurality of test subscripts.

[0023] In one embodiment of the present disclosure, the test module is further configured to execute: identifying that the levels of the first subprogram and the second subprogram are the same level, and the first subprogram and the second subprogram are any two subprograms for aggregating into a target program, wherein the target program includes a third subprogram and the application; and performing interface testing on the first subprogram and the second subprogram based on the test subscript of the first subprogram and the test subscript of the second subprogram.

[0024] In one embodiment of the present disclosure, the test module is further configured to execute: configuring a test project of the application based on the test script; and running the test project to perform interface testing on the application.

[0025] In one embodiment of the present disclosure, the test module is further configured to execute: generating an interface test report of the application based on the interface test result of the application; and sending the interface test report to a client associated with the application.

[0026] According to a third aspect of an embodiment of the present disclosure, a vehicle is provided, comprising a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the steps of the method described in the first aspect of the embodiment of the present disclosure.

[0027] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the method described in the first aspect of the embodiment of the present disclosure are implemented.

[0028] The technical solution provided by the embodiment of the present disclosure brings at least the following beneficial effects: obtaining the first signal matrix of the application to be tested, generating a test script of the application based on the first signal matrix, and performing interface testing on the application based on the test script. Therefore, the first signal matrix of the application can be taken into account to realize the automatic generation of the test script to perform interface testing on the application. Compared with the related art that mostly requires manual writing of the test script, it has the advantages of less development workload, low labor cost, short time consumption, high degree of automation, etc., and is suitable for the interface testing scenario of the vehicle system.

[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0031] Figure 1 The present invention is a flowchart of a method for testing an interface of an application program according to an exemplary embodiment.

[0032] Figure 2 The present invention is a flowchart of a method for testing an interface of an application program according to another exemplary embodiment.

[0033] Figure 3 The present invention is a flowchart of a method for testing an interface of an application program according to another exemplary embodiment.

[0034] Figure 4 The present invention is a flowchart of a method for testing an interface of an application program according to another exemplary embodiment.

[0035] Figure 5 The present invention is a flowchart of a method for testing an interface of an application program according to another exemplary embodiment.

[0036] Figure 6 The invention is a block diagram of a device for testing an interface of an application program according to an exemplary embodiment.

[0037] Figure 7 is a block diagram of a vehicle according to an exemplary embodiment. DETAILED DESCRIPTION

[0038] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0040] Figure 1 is a flow chart of a method for testing an application interface according to an exemplary embodiment. Figure 1 As shown, the interface testing method of the application program of the embodiment of the present disclosure includes the following steps.

[0041] S101, obtaining a first signal matrix of an application to be tested.

[0042] It should be noted that the execution subject of the interface testing method of the application program of the embodiment of the present disclosure is an electronic device, and the electronic device includes a mobile phone, a notebook, a desktop computer, a vehicle terminal (such as a vehicle wireless module), a smart home appliance, etc. The interface testing method of the application program of the embodiment of the present disclosure can be executed by the interface testing device of the application program of the embodiment of the present disclosure, and the interface testing device of the application program of the embodiment of the present disclosure can be configured in any electronic device to execute the interface testing method of the application program of the embodiment of the present disclosure.

[0043] It should be noted that there are no excessive restrictions on applications. For example, applications may include web (World Wide Web) applications, non-web applications, etc., and the architecture of applications may include C / S (Client / Server) architecture, B / S (Browser / Server) architecture, etc. For example, taking the vehicle scenario as an example, the application may include the vehicle computer system.

[0044] It should be noted that the first signal matrix refers to the signal matrix of the application program, and there is no excessive limitation on the first signal matrix. For example, it may include signal identification (such as signal name), signal description, signal category (such as periodic type), signal parameters (such as signal period, signal length, default initial value, signal minimum value, signal maximum value, etc.), CAN (Controller Area Network, control area network) node, message identification (such as message name), message category, message parameters (such as message length) and other information. Among them, the CAN node may include a first CAN node for sending signals and a second CAN node for receiving signals. For example, the first signal matrix may be in a document format such as a table.

[0045] It is understandable that different applications may correspond to different first signal matrices.

[0046] It should be noted that the first signal matrix can be obtained by using any method for obtaining a signal matrix of an application in the related art, and no further limitation is given here. For example, it can be set by the developer of the application.

[0047] In one implementation, obtaining the first signal matrix includes downloading an application, obtaining a data stream during the running of the application, and obtaining the first signal matrix based on the data stream.

[0048] In one embodiment, obtaining the first signal matrix includes obtaining a test requirement of the application program, and generating the first signal matrix based on an interface test requirement of the application program. Thus, the first signal matrix can be generated taking into account the interface test requirement of the application program.

[0049] In some examples, generating a first signal matrix based on an interface test requirement of an application includes determining signals associated with a target interface to be tested based on the interface test requirement of the application, and generating the first signal matrix based on information of the signals associated with the target interface.

[0050] In some examples, generating a first signal matrix based on a test requirement of an application includes obtaining an original signal matrix of the application and extracting content associated with the test requirement from the original signal matrix as the first signal matrix.

[0051] S102: Generate a test script for the application based on the first signal matrix.

[0052] It should be noted that there are not too many restrictions on the programming language of the test script. For example, it can include interpreted languages, compiled languages, etc.

[0053] In one embodiment, based on the first signal matrix, generating a test script for the application includes inputting the first signal matrix into a language model, and the language model generates the test script based on the first signal matrix. It should be noted that the language model can be implemented using any language model in the relevant technology, and no further limitation is made here.

[0054] In one embodiment, based on the first signal matrix, a test script of the application is generated, including extracting information from the first signal matrix to obtain target information, and generating a test script based on the target information. It should be noted that the target information is not too limited, for example, it can include any type of information in the first signal matrix. Extracting information from the first signal matrix to obtain target information, and generating a test script based on the target information can refer to the following embodiment in which information is extracted from the data dictionary file to obtain key information, and related content of generating a test script based on the key information is not repeated here.

[0055] S103, performing interface testing on the application based on the test script.

[0056] It should be noted that the interface test of the application program based on the test script can be implemented by using any interface test method in the relevant technology, and no excessive restrictions are made here.

[0057] In one embodiment, the interface test of the application is performed based on the test script, including executing the test script in the test environment to perform the interface test of the application. It should be noted that the test environment is not too limited. For example, taking the vehicle scenario as an example, the test environment may include CANoe (Controller Area Network open environment), which is a CAN bus development environment.

[0058] In one embodiment, an interface test is performed on an application based on a test script, including executing the test script to transmit a message, obtaining a message transmission result as an interface test result of the application. It should be noted that there are no excessive restrictions on the message transmission result, for example, it may include whether the message is successfully sent, whether the message is successfully received, whether the received message data is consistent with the sent message data, etc.

[0059] In one embodiment, the interface test of the application is performed based on the test script, including configuring the test project of the application based on the test script, and running the test project to perform the interface test on the application. Thus, the test project can be automatically configured based on the test script, and the test project can be automatically run to perform the interface test on the application.

[0060] It should be noted that there are not too many restrictions on the test project. For example, taking the vehicle scenario as an example, the test project may include the CANoe project.

[0061] In some examples, configuring a test project of an application based on a test script includes starting a test environment, creating a test project of the application in the test environment, and configuring the created test project based on the test script and a setting file. The setting file may include an A2L file, which is a description file of ECU (Electronic Control Unit) information.

[0062] In some examples, after configuring the test project of the application, the step further includes saving the test project configuration information.

[0063] In some examples, running a test project to perform interface testing on an application includes opening the test project, running the test project to test CAN nodes until all CAN nodes are tested, and then closing the test project.

[0064] In some examples, the test project is run to perform interface testing on the application, including generating an interface test report of the application based on the interface test result of the application, and sending the interface test report to a client associated with the application. Thus, the automatic generation of the interface test report can be achieved, and the automatic sending of the interface test report can be achieved.

[0065] It should be noted that there are no excessive restrictions on the method of sending the interface test report, for example, it can include text messages, emails, etc.

[0066] It should be noted that the client associated with the application may include a mobile phone, a notebook, etc. There is an association relationship between the application and the client. One application may be associated with multiple clients, and one client may be associated with multiple applications. For example, the client associated with the application may include the clients corresponding to the developer and tester of the application.

[0067] In one embodiment, after the application is interface tested, the application is also subjected to HIL (Hardware-in-the-Loop) testing. Thus, the application can be interface tested before the application is subjected to HIL testing, and interface problems can be avoided before the HIL testing, thus avoiding the situation where the application cannot be used due to interface problems after the application is released.

[0068] The interface testing method of the application provided by the embodiment of the present disclosure obtains the first signal matrix of the application to be tested, generates a test script of the application based on the first signal matrix, and performs interface testing on the application based on the test script. Therefore, the first signal matrix of the application can be taken into account to realize the automatic generation of the test script to perform interface testing on the application. Compared with the related art that mostly requires manual writing of the test script, it has the advantages of less development workload, low labor cost, short time consumption, high degree of automation, etc., and is suitable for the interface testing scenario of the vehicle system.

[0069] Figure 2 is a flowchart of a method for testing an interface of an application program according to another exemplary embodiment. Figure 2 As shown, the interface testing method of the application program of the embodiment of the present disclosure includes the following steps.

[0070] S201, obtaining a second signal matrix of a plurality of subroutines of an application program.

[0071] It should be noted that the application can be split into multiple sub-programs. There is no restriction on the splitting method of the application, which can be determined according to the development architecture of the application.

[0072] For example, taking the application program as a vehicle-computer system, the vehicle-computer system may include sub-programs such as automatic driving programs, chassis programs, body programs, thermal management programs, multimedia device management programs, and communication programs. Among them, the automatic driving program may include sub-programs such as obstacle detection programs, route planning programs, and automatic parking programs. The chassis program may include sub-programs such as transmission equipment management programs, braking equipment management programs, and steering equipment management programs. The body program may include sub-programs such as window management programs, door management programs, and light management programs. The thermal management program may include sub-programs such as motor thermal management programs, battery thermal management programs, and air-conditioning thermal management programs. The multimedia device management program may include sub-programs such as display equipment management programs and voice equipment management programs. The communication program includes sub-programs such as wireless communication programs and CAN bus communication programs.

[0073] It should be noted that the second signal matrix refers to the signal matrix of the subroutine, and the second signal matrix can refer to the relevant content of the first signal matrix, which will not be repeated here. Different subroutines can correspond to different second signal matrices.

[0074] S202, obtaining a first signal matrix based on the second signal matrices of the plurality of subroutines.

[0075] In one embodiment, the first signal matrix is ​​obtained based on the second signal matrices of the plurality of subprograms, including splicing the second signal matrices of the plurality of subprograms to obtain the first signal matrix. It should be noted that the splicing of the plurality of second signal matrices can be implemented by any matrix splicing method in the related art, and no further limitation is made here. For example, the second signal matrices of the plurality of subprograms can be spliced ​​vertically to obtain the first signal matrix.

[0076] In one embodiment, the first signal matrix is ​​obtained based on the second signal matrices of multiple subroutines, including concatenating the second signal matrices of the multiple subroutines to obtain a third signal matrix, and performing deduplication processing on the third signal matrix to obtain the first signal matrix.

[0077] S203: Generate a test script for the application based on the first signal matrix.

[0078] S204, performing interface testing on the application based on the test script.

[0079] The relevant contents of steps S203 - S204 can be found in the above embodiment and will not be described again here.

[0080] The interface testing method of the application provided by the embodiment of the present disclosure obtains the second signal matrices of multiple subprograms of the application, and obtains the first signal matrix based on the second signal matrices of the multiple subprograms. Thus, the first signal matrix can be obtained by comprehensively considering the second signal matrices of multiple subprograms of the application.

[0081] Figure 3 is a flowchart of a method for testing an interface of an application program according to another exemplary embodiment. Figure 3 As shown, the interface testing method of the application program of the embodiment of the present disclosure includes the following steps.

[0082] S301, obtaining a first signal matrix of an application to be tested.

[0083] The relevant contents of step S301 can be found in the above embodiment and will not be described again here.

[0084] S302: Generate a data dictionary file based on the first signal matrix.

[0085] It should be noted that the DD (Data Dictionary) file is a collection of information describing data, which may include the data type transmitted by the interface, data parameters (such as data length, calibration value, observation value), data address, interface name, etc.

[0086] In one embodiment, generating a data dictionary file based on the first signal matrix includes inputting the first signal matrix into a language model, and generating the data dictionary file based on the first signal matrix by the language model.

[0087] In one embodiment, generating a data dictionary file based on the first signal matrix includes determining metadata of the first signal matrix based on the first signal matrix, and generating the data dictionary file based on the metadata of the first signal matrix.

[0088] In one implementation, the data dictionary file is used for code development of an application. For example, a code framework and an ARXML (Automotive Open System Architecture Extensible Markup Language) file of the application may be generated based on the data dictionary file.

[0089] S303, generating a test script based on the data dictionary file.

[0090] In one embodiment, generating a test script based on a data dictionary file includes inputting the data dictionary file into a language model, and generating a test script based on the data dictionary file by the language model.

[0091] In one embodiment, generating a test script based on a data dictionary file includes extracting information from the data dictionary file to obtain key information, and generating a test script based on the key information. Thus, key information can be extracted from the data dictionary file to generate a test script.

[0092] It should be noted that information extraction from a data dictionary file can be implemented by using any text information extraction method in the relevant technology, and no further limitation is given here. For example, named entity recognition can be performed on candidate information in a data dictionary file to determine the named entity of the candidate information, and based on the named entity of the candidate information, it is identified whether the candidate information is key information. For example, if the named entity of the candidate information is a set named entity, the candidate information is determined to be key information.

[0093] It should be noted that there are no excessive restrictions on key information, for example, it can include any type of information in the data dictionary file.

[0094] In some examples, generating a test script based on the key information includes obtaining a template script, replacing template information in the template script with the key information, and obtaining the test script.

[0095] In some examples, generating a test script based on key information includes obtaining a setting syntax of the test script, and generating the test script based on the key information and the setting syntax. It should be noted that the setting syntax may include any programming syntax in the relevant technology, which is not limited here. Therefore, the test script can be generated by comprehensively considering the key information and the setting syntax.

[0096] S304, performing interface testing on the application based on the test script.

[0097] The relevant contents of step S304 can be found in the above embodiment and will not be described again here.

[0098] The interface testing method of the application provided by the embodiment of the present disclosure generates a data dictionary file based on the first signal matrix, and generates a test script based on the data dictionary file. Thus, the data dictionary file can be generated based on the first signal matrix to generate a test script.

[0099] Figure 4 is a flowchart of a method for testing an interface of an application program according to another exemplary embodiment. Figure 4 As shown, the interface testing method of the application program of the embodiment of the present disclosure includes the following steps.

[0100] S401: Obtain a first signal matrix of an application to be tested.

[0101] S402: Generate a test script for the application based on the first signal matrix.

[0102] The relevant contents of steps S401-S402 can be found in the above embodiment and will not be repeated here.

[0103] S403, split the test script to obtain multiple test sub-scripts.

[0104] In one embodiment, splitting the test script to obtain multiple test sub-scripts includes splitting the test script according to the writing structure of the test script to obtain multiple test sub-scripts. For example, if the writing structure of the test script includes a first part, a second part, and a third part, the content of the first part, the content of the second part, and the content of the third part of the test script can be used as test sub-scripts respectively.

[0105] In one embodiment, the test script is split to obtain multiple test sub-scripts, including splitting the application to obtain multiple sub-programs, and extracting sub-program-related content from the test script as the test sub-scripts of the sub-programs. Thus, the test script can be split to obtain test sub-scripts of multiple sub-programs of the application in consideration of the splitting method of the application.

[0106] It should be noted that the application is split into multiple sub-programs. The relevant content of step S201 in the above embodiment can be referred to and will not be repeated here.

[0107] For example, taking the application as a vehicle system, the vehicle system may include sub-programs such as autonomous driving programs, chassis programs, body programs, thermal management programs, multimedia device management programs, and communication programs. The content related to the autonomous driving program can be extracted from the test script as a test sub-script for the autonomous driving program, and the content related to the chassis program can be extracted from the test script as a test sub-script for the chassis program.

[0108] In some examples, extracting the subroutine-related content from the test script includes obtaining the subroutine-related identifier, and extracting the content corresponding to the subroutine-related identifier from the test script as the subroutine-related content. It should be noted that there are no excessive restrictions on the subroutine-related identifier, for example, it may include the identifier of the subroutine, the identifier of the signal processed or transmitted by the subroutine, the identifier of the subroutine interface, etc.

[0109] In some examples, extracting the subroutine-related content from the test script includes matching candidate information in the test script with the subroutine, and if the candidate information successfully matches the subroutine, determining the candidate information as the subroutine-related content. It should be noted that the matching method can be implemented using any information matching method in the relevant technology, and is not limited here.

[0110] In some examples, the test sub-script of the sub-program is also sent to a client associated with the sub-program. For example, the client associated with the sub-program may include a client corresponding to a developer or tester of the sub-program.

[0111] S404, performing interface testing on the application based on multiple test sub-scripts.

[0112] In one embodiment, the interface test of the application is performed based on multiple test sub-scripts, including executing multiple test sub-scripts to perform interface test on the application. It should be noted that the execution order of the multiple test sub-scripts is not too limited, for example, the multiple test sub-scripts can be executed serially, or the multiple test sub-scripts can be executed in parallel.

[0113] In one embodiment, the interface test of the application is performed based on multiple test sub-scripts, including obtaining the hierarchical relationship between the multiple sub-programs, and performing the interface test of the application based on the hierarchical relationship and the multiple test sub-scripts. Thus, the interface test of the application can be performed taking into account the hierarchical relationship between the multiple sub-programs and the multiple test sub-scripts.

[0114] It should be noted that there are not too many restrictions on the hierarchical relationship. For example, taking the application as a vehicle system, the vehicle system may include sub-programs such as automatic driving programs, chassis programs, body programs, thermal management programs, multimedia device management programs, and communication programs. Among them, the automatic driving program may include sub-programs such as obstacle detection programs, route planning programs, and automatic parking programs. The body program may include sub-programs such as window management programs, door management programs, and light management programs.

[0115] The obstacle detection program, route planning program, automatic parking program, window management program, door management program, and light management program are at the first level, and the automatic driving program, chassis program, body program, thermal management program, multimedia device management program, and communication program are at the second level.

[0116] In some examples, based on the hierarchical relationship and multiple test sub-scripts, an interface test is performed on an application, including determining the execution order of multiple test sub-scripts based on the hierarchical relationship, and executing the multiple test sub-scripts according to the execution order to perform interface testing on the application. Thus, the hierarchical relationship between multiple sub-programs can be taken into consideration to determine the execution order of multiple test sub-scripts, so as to execute multiple test sub-scripts and then perform interface testing on the application.

[0117] For example, the higher the level of a subroutine, the later the test subscripts of the subroutine will be executed.

[0118] In some examples, an interface test is performed on an application based on a hierarchical relationship and a plurality of test sub-scripts, including identifying that the hierarchical levels of a first sub-program and a second sub-program are the same, and that the first sub-program and the second sub-program are any two sub-programs used to aggregate into a target program, wherein the target program includes a third sub-program and an application. Based on the test sub-script of the first sub-program and the test sub-script of the second sub-program, an interface test is performed on the first sub-program and the second sub-program. Thus, if any two sub-programs have the same hierarchical level and are used to aggregate into the same target program, an interface test is performed on any two sub-programs based on the test sub-scripts of any two sub-programs.

[0119] It should be noted that the first subprogram, the second subprogram and the third subprogram are any subprograms of the application program.

[0120] For example, taking the application program as a vehicle-computer system, the vehicle-computer system may include sub-programs such as automatic driving programs, chassis programs, body programs, thermal management programs, multimedia device management programs, and communication programs. Among them, the automatic driving program may include sub-programs such as obstacle detection programs, route planning programs, and automatic parking programs. The body program may include sub-programs such as window management programs, door management programs, and light management programs.

[0121] The obstacle detection program, route planning program, automatic parking program, window management program, door management program, and light management program are at the first level, and the automatic driving program, chassis program, body program, thermal management program, multimedia device management program, and communication program are at the second level.

[0122] For example, it can be recognized that the obstacle detection program and the route planning program are at the same level, and the obstacle detection program and the route planning program are any two subprograms for aggregating into the autonomous driving program. Based on the test subscript of the obstacle detection program and the test subscript of the route planning program, the interface test of the obstacle detection program and the route planning program can be performed. It should be noted that in this embodiment, the obstacle detection program, the route planning program, and the autonomous driving program are the first subprogram, the second subprogram, and the third subprogram, respectively.

[0123] For example, it can be recognized that the levels of the window management program and the door management program are the same level, and the window management program and the door management program are any two subprograms for aggregating into the body program. Based on the test subscript of the window management program and the test subscript of the door management program, the interface test of the window management program and the door management program can be performed. It should be noted that in this embodiment, the window management program, the door management program, and the body program are the first subprogram, the second subprogram, and the third subprogram, respectively.

[0124] For example, it can be recognized that the level of the autonomous driving program and the body program is the same level, and the autonomous driving program and the body program are any two subprograms for aggregating into the vehicle system. Based on the test subscript of the autonomous driving program and the test subscript of the body program, the interface test of the autonomous driving program and the body program can be performed. It should be noted that in this embodiment, the autonomous driving program, the body program, and the vehicle system are the first subprogram, the second subprogram, and the application program, respectively.

[0125] The interface testing method of the application provided by the embodiment of the present disclosure splits the test script to obtain multiple test sub-scripts, and performs interface testing on the application based on the multiple test sub-scripts. Thus, the test script can be split into multiple test sub-scripts to perform interface testing on the application.

[0126] Figure 5is a flowchart of a method for testing an interface of an application program according to another exemplary embodiment. Figure 5 As shown, the interface testing method of the application program of the embodiment of the present disclosure includes the following steps.

[0127] S501, obtaining a second signal matrix of a plurality of subroutines of an application program.

[0128] S502, obtaining a first signal matrix based on the second signal matrices of the plurality of subroutines.

[0129] S503: Generate a data dictionary file based on the first signal matrix.

[0130] S504, extracting information from the data dictionary file to obtain key information.

[0131] S505, obtaining the setting syntax of the test script.

[0132] S506, generating a test script based on the key information and the set syntax.

[0133] S507, configuring a test project of the application based on the test script.

[0134] S508, running the test project to perform interface testing on the application program.

[0135] The relevant contents of steps S501-S508 can be found in the above embodiment and will not be repeated here.

[0136] Figure 6 is a block diagram of an application interface testing device according to an exemplary embodiment. Figure 6 The application interface testing device 100 of the embodiment of the present disclosure includes: an acquisition module 110, a generation module 120 and a testing module 130.

[0137] An acquisition module 110 is configured to execute acquisition of a first signal matrix of an application to be tested;

[0138] A generating module 120, configured to generate a test script for the application based on the first signal matrix;

[0139] The testing module 130 is configured to execute interface testing on the application based on the testing script.

[0140] In one embodiment of the present disclosure, the acquisition module 110 is further configured to execute: acquiring second signal matrices of multiple subprograms of the application; and obtaining the first signal matrix based on the second signal matrices of the multiple subprograms.

[0141] In one embodiment of the present disclosure, the generating module 120 is further configured to execute: generating a data dictionary file based on the first signal matrix; generating the test script based on the data dictionary file.

[0142] In one embodiment of the present disclosure, the generating module 120 is further configured to execute: extracting information from the data dictionary file to obtain key information; and generating the test script based on the key information.

[0143] In one embodiment of the present disclosure, the generating module 120 is further configured to execute: obtaining a setting syntax of the test script; and generating the test script based on the key information and the setting syntax.

[0144] In one embodiment of the present disclosure, the test module 130 is further configured to execute: splitting the test script to obtain a plurality of test sub-scripts; and performing interface testing on the application based on the plurality of test sub-scripts.

[0145] In one embodiment of the present disclosure, the test module 130 is further configured to execute: splitting the application to obtain multiple subprograms; extracting content associated with the subprogram from the test script as a test subscript of the subprogram.

[0146] In one embodiment of the present disclosure, the test module 130 is further configured to execute: obtaining the hierarchical relationship between the plurality of subprograms; and performing interface testing on the application based on the hierarchical relationship and the plurality of test subscripts.

[0147] In one embodiment of the present disclosure, the test module 130 is further configured to execute: identifying that the levels of the first subprogram and the second subprogram are the same level, and the first subprogram and the second subprogram are any two subprograms for aggregating into a target program, wherein the target program includes a third subprogram and the application; and performing interface testing on the first subprogram and the second subprogram based on the test subscript of the first subprogram and the test subscript of the second subprogram.

[0148] In one embodiment of the present disclosure, the test module 130 is further configured to execute: configuring a test project of the application based on the test script; and running the test project to perform interface testing on the application.

[0149] In one embodiment of the present disclosure, the testing module 130 is further configured to execute: generating an interface testing report of the application based on the interface testing result of the application; and sending the interface testing report to a client associated with the application.

[0150] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0151] The interface testing device of the application provided by the embodiment of the present disclosure obtains the first signal matrix of the application to be tested, generates a test script of the application based on the first signal matrix, and performs interface testing on the application based on the test script. Therefore, the first signal matrix of the application can be taken into account to realize the automatic generation of the test script to perform interface testing on the application. Compared with the related art that mostly requires manual writing of the test script, it has the advantages of less development workload, low labor cost, short time consumption, high degree of automation, etc., and is suitable for the interface testing scenario of the vehicle system.

[0152] Figure 7 2 is a block diagram of a vehicle according to an exemplary embodiment. For example, vehicle 200 may be a hybrid vehicle, a non-hybrid vehicle, an electric vehicle, a fuel cell vehicle, or other types of vehicles. Vehicle 200 may be an autonomous vehicle, a semi-autonomous vehicle, or a non-autonomous vehicle.

[0153] Reference Figure 7 , the vehicle 200 may include various subsystems, for example, an infotainment system 210, a perception system 220, a decision control system 220, a drive system 240, and a computing platform 250. The vehicle 200 may also include more or fewer subsystems, and each subsystem may include multiple components. In addition, each subsystem and each component of the vehicle 200 may be interconnected by wire or wireless means.

[0154] In some embodiments, the infotainment system 210 may include a communication system, an entertainment system, and a navigation system, among others.

[0155] The perception system 220 may include several sensors for sensing information about the environment around the vehicle 200. For example, the perception system 220 may include a global positioning system (the global positioning system may be a GPS system, or a Beidou system or other positioning systems), an inertial measurement unit (IMU), a laser radar, a millimeter wave radar, an ultrasonic radar, and a camera.

[0156] The decision control system 230 may include a computing system, a vehicle controller, a steering system, a throttle, and a braking system.

[0157] The drive system 240 may include components that provide power movement for the vehicle 200. In one embodiment, the drive system 240 may include an engine, an energy source, a transmission system, and wheels. The engine may be one or a combination of an internal combustion engine, an electric motor, and an air compression engine. The engine can convert energy provided by the energy source into mechanical energy.

[0158] Some or all functions of the vehicle 200 are controlled by a computing platform 250. The computing platform 250 may include at least one processor 251 and a memory 252, and the processor 251 may execute instructions 253 stored in the memory 252.

[0159] The processor 251 may be any conventional processor, such as a commercially available CPU. The processor may also include a graphics processor (Graphic Process Unit, GPU), a field programmable gate array (Field Programmable Gate Array, FPGA), a system on chip (System on Chip, SOC), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or a combination thereof.

[0160] The memory 252 may be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0161] In addition to instructions 253 , memory 252 may also store data, such as road maps, route information, and data such as the location, direction, and speed of the vehicle. The data stored in memory 252 may be used by computing platform 250 .

[0162] In the embodiment of the present disclosure, the processor 251 may execute the instruction 253 to implement all or part of the steps of the application program interface testing method provided by the present disclosure.

[0163] The vehicle of the embodiment of the present disclosure obtains the first signal matrix of the application to be tested, generates a test script of the application based on the first signal matrix, and performs interface testing on the application based on the test script. Therefore, the first signal matrix of the application can be taken into account to realize automatic generation of the test script to perform interface testing on the application. Compared with the related art that mostly requires manual writing of the test script, it has the advantages of less development workload, low labor cost, short time consumption, high degree of automation, etc., and is suitable for the interface testing scenario of the vehicle system.

[0164] In order to implement the above embodiments, the present disclosure further proposes a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the interface testing method of the application provided by the present disclosure are implemented.

[0165] Alternatively, the computer readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, or the like.

[0166] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0167] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An application interface testing method, It is characterized in that include: Obtaining a first signal matrix of the application to be tested; generating a test script for the application based on the first signal matrix; Based on the test script, interface testing is performed on the application.

2. The method according to claim 1, It is characterized in that The step of obtaining a first signal matrix of the application to be tested includes: Acquire a second signal matrix of a plurality of subroutines of the application program; The first signal matrix is ​​obtained based on a plurality of second signal matrices of the subroutines.

3. The method according to claim 1, It is characterized in that The step of generating a test script for the application based on the first signal matrix includes: Based on the first signal matrix, generating a data dictionary file; The test script is generated based on the data dictionary file.

4. The method according to claim 3, It is characterized in that The step of generating the test script based on the data dictionary file includes: Extracting information from the data dictionary file to obtain key information; Based on the key information, the test script is generated.

5. The method according to claim 4, It is characterized in that The generating the test script based on the key information includes: Obtaining a setting syntax of the test script; The test script is generated based on the key information and the set syntax.

6. The method according to claim 1, It is characterized in that The performing interface testing on the application based on the test script includes: Splitting the test script to obtain multiple test sub-scripts; Based on the multiple test sub-scripts, interface testing is performed on the application.

7. The method according to claim 6, It is characterized in that The test script is split to obtain multiple test sub-scripts, including: Splitting the application program to obtain multiple subprograms; The content associated with the subprogram is extracted from the test script as a test subscript of the subprogram.

8. The method according to claim 7, It is characterized in that The step of performing interface testing on the application based on the plurality of test sub-scripts comprises: Obtaining a hierarchical relationship between a plurality of said subroutines; Based on the hierarchical relationship and the multiple test sub-scripts, interface testing is performed on the application.

9. The method according to claim 8, It is characterized in that The performing interface testing on the application based on the hierarchical relationship and the plurality of test sub-scripts includes: Identify that the first subprogram and the second subprogram are at the same level, and the first subprogram and the second subprogram are any two subprograms for being aggregated into a target program, wherein the target program includes a third subprogram and the application program; Based on the test subscript of the first subprogram and the test subscript of the second subprogram, interface testing is performed on the first subprogram and the second subprogram.

10. The method according to any one of claims 1 to 9, It is characterized in that The performing interface testing on the application based on the test script includes: Based on the test script, configure a test project for the application; The test project is run to perform interface testing on the application.

11. The method according to claim 10, It is characterized in that The running of the test project to perform interface testing on the application program includes: Based on the interface test result of the application, generate an interface test report of the application; The interface test report is sent to a client associated with the application.

12. An application program interface testing device, It is characterized in that include: An acquisition module is configured to execute acquisition of a first signal matrix of an application to be tested; A generating module, configured to generate a test script of the application based on the first signal matrix; The test module is configured to execute interface testing on the application based on the test script.

13. A vehicle, It is characterized in that include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Implement the steps of the method according to any one of claims 1 to 11.

14. A computer readable storage medium having computer program instructions stored thereon, It is characterized in that When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.