Application generation method for testing software development kit functionality
By generating test applications and test cases for software development kits using large language models and intelligent agent technology, the problems of low efficiency in test application generation and high maintenance costs are solved, achieving efficient and automated test application generation and verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2026-03-04
- Publication Date
- 2026-07-10
AI Technical Summary
In existing technologies, the process of generating test applications for software development kits has high technical barriers, is time-consuming, and is difficult to adapt to the iteration speed of application products. Furthermore, the development standards for test applications are not uniform across different operating systems, which increases maintenance costs and adaptation difficulties.
By acquiring the standardized interface documentation, page structure templates, page generation rules, test case templates, and runtime configuration rules of the target software development kit, and inputting them into a large language model, the target test application and test case set are generated. Automated testing is then achieved by combining the test case interpretation agent and the visual operation agent.
It improves the efficiency of test application generation, reduces manual intervention, increases test coverage and verification accuracy, reduces maintenance costs, and adapts to the rapid application needs of different operating systems.
Smart Images

Figure CN122364064A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of application development, software testing, mapping, intelligent agents, and large models, and specifically to an application generation method and an automated testing method for testing the functionality of a software development kit. Background Technology
[0002] After an application product is developed, test development engineers need to write test applications to display the application product's running effect on the front end for easy observation and testing. However, the process of writing test applications involves specialized programming technologies for different operating systems, so the technical threshold is high and the time consumption is long. Consequently, the testing efficiency of the application product is difficult to keep up with the iteration speed of the application product. Summary of the Invention
[0003] This disclosure provides an application generation method for testing the functionality of software development kits.
[0004] According to one aspect of this disclosure, an application generation method for testing the functionality of a software development kit is provided, comprising: Obtain the standardized interface documentation, page structure templates, page generation rules, test case templates, and runtime configuration rules corresponding to the running system of the test application for the target software development kit; The standardized interface document, page structure template, page generation rules, test case template, and runtime configuration rules are used as target prompts and input into the large language model. The large language model then parses the standardized interface document based on the prompts and generates a set of target test applications and corresponding test cases.
[0005] According to another aspect of this disclosure, an automated testing method is provided, comprising: Obtain the target test application and test cases, wherein the target test application and test cases are generated based on the application generation method for testing the functionality of software development kits disclosed herein; Input the test cases into the test case interpreter agent to generate a test case execution plan; The test case execution plan, target test application, and test cases are input into the visual operation agent, enabling the visual operation agent to operate the interface of the target test application according to the test case execution plan and test cases, and generate test results.
[0006] According to another aspect of this disclosure, an application generation apparatus for testing the functionality of a software development kit is provided, comprising: The acquisition module is used to acquire the standardized interface documents, page structure templates, page generation rules, test case templates, and runtime configuration rules corresponding to the running system of the test application of the target software development kit. The application generation module is used to input standardized interface documents, page structure templates, page generation rules, test case templates, and runtime configuration rules as target prompts into the large language model. The large language model then parses the standardized interface documents based on the prompts to generate the target test application and a set of test cases corresponding to the target test application.
[0007] According to another aspect of this disclosure, an automated testing apparatus is provided, comprising: The acquisition module is used to acquire the target test application and test cases, wherein the target test application and test cases are generated based on the application generation method for testing the functionality of software development kits disclosed herein; The planning generation module is used to input test cases into the test case interpreter agent to generate test case execution plans; The testing module is used to input the test case execution plan, the target test application, and the test cases into the visual operation agent, enabling the visual operation agent to operate the interface of the target test application according to the test case execution plan and the test cases, and generate test results.
[0008] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0009] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a flowchart illustrating an application generation method for testing the functionality of a software development kit, provided in an embodiment of this disclosure. Figure 2 This is a schematic diagram of a standardized interface document provided in this public implementation; Figure 3 This is a flowchart illustrating another application generation method for testing the functionality of a software development kit provided in this disclosure embodiment; Figure 4 This is a flowchart illustrating an automated testing method provided in an embodiment of this disclosure; Figure 5 This is a flowchart illustrating another automated testing method provided in an embodiment of this disclosure; Figure 6 This is a schematic diagram of an application generation device for testing the functionality of a software development kit, provided in an embodiment of this disclosure; Figure 7 This is a schematic diagram of an automated testing device provided in an embodiment of this disclosure; Figure 8 This is a block diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0010] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0011] The terms such as "first," "second," and "third" used herein are used only to distinguish one entity (or operation) from another, and are not intended to require or imply a specific order or relationship between these entities (or operations). Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0012] The collection, storage, use, processing, transmission, provision, and disclosure of any type of information, such as user personal information, in this technical solution comply with relevant laws and regulations and do not violate public order and good morals.
[0013] Before describing the technical solutions provided by the embodiments of this disclosure, in order to facilitate the understanding of the embodiments of this disclosure, this disclosure first specifically explains the problems existing in the related technologies.
[0014] After developing an application product, a software development kit (SDK) is obtained. This SSD needs to be used by test development engineers to write test applications for the application product. These test applications integrate the functions of the application product and can also be called test demos or test suites.
[0015] Test applications are used to display the running effect of application products to the front end for easy observation and testing. However, the process of writing test applications involves specialized programming techniques for different operating systems, so the technical threshold is high and the time consumption is long. Consequently, the testing efficiency of application products is difficult to keep up with the iteration speed of application products.
[0016] Software Development Kits (SDKs) can specifically be used. For example, a map SDK covers multiple operating systems, requiring the development of separate test applications for each system to monitor its rendering and application performance on the client. Taking Android as an example, in SDK-based business testing, Android projects need to be developed by test engineers using Android Studio, involving specialized Android programming technologies such as Java and Kotlin. Due to the high technical barrier, a significant amount of manpower and effort from professional test developers is required. Furthermore, with the increasing variety of test scenarios, test applications require multiple parameter settings and code logic adjustments during development, further increasing testing costs and limiting application iteration speed. Similar challenges exist on iOS and HarmonyOS NEXT platforms.
[0017] Related technical personnel also found that the development of conventional test applications relies on manual development using dedicated development tools for each platform, such as Android Studio for Android. This is not only time-consuming and labor-intensive, but also results in inconsistent development standards for test applications on different operating systems. This increases the maintenance cost and adaptation difficulty of test applications, making it difficult to meet the needs of rapid application in various project testing scenarios.
[0018] In view of this, this disclosure provides an application generation method and an automated testing method for testing the functionality of software development kits, in order to improve the efficiency of application generation.
[0019] This disclosure provides an application generation method for testing the functionality of software development kits, such as... Figure 1 The diagram shows a flowchart of a recommended resource ranking method, which may include the following steps 101 and 102.
[0020] Step 101: Obtain the standardized interface documentation, page structure template, page generation rules, test case template, and runtime configuration rules corresponding to the running system of the test application for the target software development kit; Step 102: Input the standardized interface document, page structure template, page generation rules, test case template, and runtime configuration rules as target prompt information into the large language model. The large language model will then parse the standardized interface document based on the prompt information to generate the target test application and a set of test cases corresponding to the target test application.
[0021] Specifically, standardized interface documentation includes introductory information about the various application functionalities provided by the software development kit (SDK). For example, it may include the interface methods that the SSD can provide and how to invoke those methods.
[0022] The page structure template includes information defining the display structure of interactive controls and the basic structure of page operation logic in the test application page. Optionally, it can be a template describing the display structure of interactive controls on the page based on an XML layout file, thereby defining the content displayed on the interface in the test application, such as the display position and style of buttons and text boxes. Alternatively, it can be a template describing the basic structure of page operation logic based on an Activity file, thereby defining the interaction logic of each control in the interface.
[0023] Adding prompts to the page structure template can help improve the accuracy of the generated test application, ensuring that the test application meets the front-end display and operation requirements.
[0024] Page generation rules include information on the standardization of page controls and page operation logic. For example, the page generation specifications can specify the control forms corresponding to different parameter types, thereby testing the application to ensure good operability. The page specifications can also include rules that help the application run stably.
[0025] Based on this, the test applications generated by the large language model follow a unified standard, reducing subsequent maintenance costs.
[0026] Test case templates include information that defines the structure of test cases, such as the description of the test object, the configuration of input parameters, and the expression of expected results.
[0027] The runtime configuration rules can include the standardized component registration information, permission declaration information, and startup entry configuration information of the test application in the corresponding runtime system to ensure that the test application can run normally.
[0028] Subsequently, the standardized interface document, page structure template, page generation rules, test case template, and runtime configuration rules are input into the large language model as target prompt information. The large language model then parses the standardized interface document based on the target prompt information and generates the target test application and the corresponding set of test cases.
[0029] By unifying standardized interface documentation, page structure templates, page generation rules, test case templates, and runtime configuration rules as target prompts input into the large language model, the large language model completes interface parsing, page construction, logic generation, and test case generation within a unified generation framework, forming a structurally complete target test application and its corresponding set of test cases. Based on this, the manual intervention in writing test applications and test cases one by one is effectively reduced, improving the efficiency of test application generation.
[0030] In some embodiments of this disclosure, in order to improve the ability of large models to accurately decompose the test design functional points of software development kits, and at the same time reserve expansion space for subsequent adaptation to other terminals, it is necessary to standardize the conventional interface documents provided by technical personnel.
[0031] Therefore, obtaining the standardized interface documentation of the target software development kit (SDK) can specifically include the following steps: obtaining the interface documentation of the target SSD; extracting the class name of each calling object and the corresponding interface method name from the interface documentation; extracting the functional description information, calling method, and parameter value range of the interface methods; and determining the method for determining the values of the input parameters of the interface methods, so that the values of the input parameters are determined by the parameter values received during the call, thus obtaining the standardized interface documentation.
[0032] Specifically, the original interface documentation includes introductory information describing the various application functions of the target software development kit, such as the calling objects of the interface methods and related information about the interface methods.
[0033] For example, Figure 2 This is a schematic diagram of a standardized interface document provided in this disclosure. The standardized interface document may include information such as class name, interface method name, function explanation and usage method.
[0034] The calling object is the class that implements the interface capabilities, and its class name is used to identify the entity that carries the interface capabilities; the interface method is the functional entry point provided by the calling object to the outside world, and its interface method name is used to identify the specific functional operation.
[0035] Based on the interface documentation, the class name of each calling object and the corresponding interface method name in the target software development kit are extracted to provide core recognition information for the large language model.
[0036] The API documentation also needs to extract the functional descriptions, calling methods, and parameter value ranges of the API methods. The functional descriptions describe the purpose of the API methods, the calling methods define the calling format and conditions, and the parameter value ranges define the legal boundaries of the parameters passed to the API methods, ensuring that the large language model understands the purpose of the API and the range of its parameters.
[0037] Standardized interface documentation should clearly define how the input parameters of interface methods are determined, ensuring that the values of the input parameters are determined by the parameter values received during the call. This avoids the use of preset default values within the interface methods, thereby improving the testing flexibility of test applications generated by large language models, expanding the range of parameter combinations, and enhancing the controllability and verification accuracy of automatically generated test applications.
[0038] Through the above process, the original interface documents are reorganized into a structured form, resulting in standardized interface documents.
[0039] In practical applications, the code generation characteristics of large language models, multi-terminal adaptability and scalability, engineering compatibility and other requirements can be combined to supplement extended design standards such as field type definitions, parameter dependencies, coding standard adaptation, version identification, etc., to ensure that the interface documentation is fully adapted to the full-process automation requirements.
[0040] In this disclosure, by developing a standardized interface document adapted to the parsing of a large language model, the large language model can accurately decompose the test design function points of the test application's operating system. At the same time, it reserves expansion space for subsequent adaptation to different operating systems and provides basic input for the automatic generation of test applications.
[0041] In this disclosure, the target test application includes functional units corresponding to class names, and the set of test cases includes multiple test cases corresponding to each functional unit.
[0042] Specifically, the target test application is a runnable application generated based on standardized interface documentation, and the target test application may include multiple functional units.
[0043] The functional unit corresponds to the class name in the standardized interface document. That is, an independent functional unit is generated for each class name to carry the set of interface methods corresponding to that class name.
[0044] Each functional unit includes at least one page, which allows for independent testing of the interface methods carried by various names.
[0045] Test cases can be used to verify the correctness of the target test application functions. Each functional unit can correspond to multiple test cases to cover the different interface methods, different parameter combinations and different calling scenarios included in the functional unit, thereby improving the test coverage.
[0046] Optionally, functional units can be implemented using a modular page structure, making functional units corresponding to different class names structurally independent, thereby reducing the coupling between interface call logic.
[0047] The target test application generated in this disclosure includes functional units corresponding to class names. Each functional unit is configured with multiple test cases, realizing a one-to-one correspondence between interface capabilities and test content. This helps to improve test coverage and verification completeness, and enhance the relevance and reliability of test results.
[0048] In some embodiments of this disclosure, the page structure template may specifically include a page layout template and a page operation logic template; the page layout template includes layout structure information of the display positions of interactive controls in the application page; the page operation logic template includes information of the operation processing logic of the interactive controls.
[0049] For example, in a page layout template, the layout structure information of the display position of interactive controls on the application page can be used to define the display position, arrangement and other display methods of the interface content of the controls on the page.
[0050] The information on the operation processing logic of interactive controls included in the page layout template can be used to determine the hierarchical relationship, relative position and arrangement order of each interactive control on the page. For example, the interface call logic, parameter processing logic and result display logic executed when the interactive control is triggered.
[0051] In this disclosure, by setting page layout templates and page operation logic templates, and by specifying the layout structure information and operation processing logic of interactive controls in the page layout templates, it is helpful to standardize the testing of applications.
[0052] In some embodiments of this disclosure, specific page generation rules may include: page control generation rules and page execution logic generation rules.
[0053] The page control generation rules include matching rules for interactive controls based on the input parameter types of interface methods. The page execution logic generation rules include at least one of the following: lifecycle management rules corresponding to the test application's runtime system, parameter processing rules for input parameters, rules for handling exceptions in preset business logic execution, page interaction control rules, and page execution logic code generation specifications.
[0054] The page control generation rules include interactive control matching rules based on the input parameter types of interface methods, that is, determining the corresponding interactive control type according to the type of the input parameter. Through these interactive control matching rules, a mapping relationship is established between the input parameters of the interface method and the interactive controls on the page.
[0055] In some alternative embodiments, the input parameter type includes at least one of input type, enumeration type, and Boolean type.
[0056] For example, for input parameters, a text input control, such as an EditText control, is generated for inputting data. The text input control displays the corresponding parameter name in the prompt message and shows the default value information in the preset display area of the text input control so that testers can view and modify the parameter content. The preset display area of the text input control is, for example, 20% space behind the control.
[0057] For enumeration type parameters, an enumeration selection control, such as a Spinner control, is generated. Corresponding identification information is set for each enumeration value. The identification information adopts {interface method name}-{specific enumeration value}. When the selection box is clicked, it is identified by {interface method name}. When a specific option is selected, it is accurately identified by {interface method name}-{specific enumeration value}, thereby ensuring accurate matching of enumeration parameters.
[0058] For Boolean type parameters, generate state selection controls, such as CheckBox controls, to control the logical state of the corresponding parameters. Support state switching by clicking the control or the text associated with the control. For example, for true / false type parameters, the check operation is implemented by clicking the control text to improve the ease of operation.
[0059] In this disclosure, refining the page control generation rules helps improve the visual stability of the generated test application, thereby improving the test scenario and functional coverage.
[0060] In some optional embodiments, the parameter processing rules for the input parameters include: parameter validation and parameter passing rules during the interface method call process.
[0061] Specifically, parameter validation rules are used to check the validity of input parameters collected through interactive controls before the interface method is called. For example, they can determine whether the parameter is empty, whether the parameter format conforms to the preset value range, and whether the parameter type matches.
[0062] When the input parameters are detected to be inconsistent with the preset conditions, a corresponding prompt message is generated and the subsequent interface method call process is terminated. The parameter passing rules are used to assemble the input parameters according to the parameter order and parameter type of the interface method after the parameter validation is successful, and then pass them to the corresponding interface method for invocation.
[0063] By combining parameter validation rules and parameter passing rules, we can achieve parameter validity control before calling interface methods and standardized processing of the parameter passing process.
[0064] This disclosure, by setting parameter processing rules for input parameters, verifies the validity of parameters before API method calls and standardizes the parameter passing process, thereby reducing API call failures due to abnormal parameters or incorrect formats and improving the operational stability of subsequent test applications. Furthermore, by terminating the API call process when parameter validation fails, erroneous parameters are prevented from entering the API logic, which helps enhance the accuracy and reliability of subsequent test results, thus improving the overall security and controllability of the testing process.
[0065] In some embodiments of this disclosure, the page execution logic generation rules can standardize the generation of interface call logic and execution control logic corresponding to interactive controls in the test application.
[0066] For example, lifecycle management rules are used to standardize the page lifecycle method call flow of the test application in the running system, so as to ensure the correct initialization and resource release of the page at different running stages. Specifically, the test application includes page components, which include one or more page controls and are used to implement the function of interacting with the user or displaying information. Each page component needs to override the onCreate, onResume, onPause and onDestroy methods to ensure that the logic of component initialization, resource release and other processes are executed normally.
[0067] Parameter processing rules are used to validate and control the transmission of input parameters collected by interactive controls.
[0068] For example, standardize the validation, transmission, and format consistency of user input parameters. All user input fields must undergo null value validation and format validation. For example, in a map software development kit project, latitude and longitude coordinate format validation is required. When validation fails, a clear Toast message should be displayed, such as "Please enter valid latitude and longitude coordinates" or "This field cannot be empty", and subsequent interface calls should be terminated immediately.
[0069] For example, if there are unfilled parameters on the page, the generated code should not set the parameter directly and should not use default values to fill them in, so that the input parameters of the interface method are determined only based on the actual input values.
[0070] For example, map software development kit projects include latitude and longitude input adaptation rules, which must strictly follow the definition of latitude and longitude coordinate input format in the page layout template, and maintain the same format requirements as the layout file during parameter passing.
[0071] Exception handling rules are used to capture and handle exceptions generated during API calls or control operations. Specifically, when generating the page's runtime logic code, an exception handling structure is wrapped around key business logic such as API call logic and control operation logic to capture runtime exceptions. For example, try-catch blocks can be wrapped around key business logic such as API calls and control operations to capture runtime exceptions and handle them in a friendly manner, preventing application crashes.
[0072] Page interaction control rules are used to standardize page layout switching and control event response behavior. For example, when generating the page's runtime logic code, a FrameLayout container is used to dynamically switch between different views to support flexible display of the page structure. For all button click events, a mechanism to prevent repeated clicks must be added, such as setting a preset time interval to limit continuous clicks, thereby avoiding repeated triggering of the same business logic. When the interface documentation includes a clickable control method of the setClickable(boolean isClickable) class, a click event is added to the target graphic after the corresponding state selection control is checked; when the click event is triggered, a fixed message "Graphic clicked" is displayed, and the click event must return a boolean result to adapt to specific interface methods.
[0073] The page execution logic code generation specification is used to define the structure and syntax of the generated code. For example, it requires that the generated page execution logic code file be stored in a preset agent folder path and follow the coding standards of the corresponding operating system's development language to ensure that the generated code conforms to language syntax requirements and is free of basic code errors.
[0074] Understandably, the specific code generation specifications for page execution logic can be adjusted according to the actual development scenario.
[0075] In this disclosure, the uniform constraints of the above rules ensure that the generated test application conforms to the preset specifications in terms of lifecycle management, parameter processing, exception control, page interaction, and engineering structure, thereby improving the stability, operability, and operational reliability of the test application.
[0076] In addition, by standardizing the definition of the interactive control matching logic and the operation control logic, a systematic mapping between interface method parameters and page structure and operation logic is achieved. Based on this, the test application has both a consistent page display format and a logical execution mechanism that conforms to the operating system specifications during the generation process, thereby improving the stability and runnability of the generated test application.
[0077] In this disclosure, the configuration rules include: adding a directory page to the target test application, and adding an access entry for each functional unit on the directory page.
[0078] Specifically, by requiring the addition of an access point for each functional unit on the test application's directory page, each functional unit can be displayed visually on the front-end interface. Based on these access points, users can easily jump directly to the corresponding functional module for testing. Therefore, during the testing process, it is convenient to quickly locate and enter the corresponding functional unit for testing, improving the clarity and efficiency of the testing process.
[0079] In this disclosure, the runtime configuration rules also include system registration configuration information.
[0080] System registration configuration information is used to register page components and related functional modules within the runtime system of the test application, enabling the test application to be recognized, loaded, and scheduled by the runtime system. For example, system registration configuration information may include page component registration information, startup entry point configuration information, and permission declaration information.
[0081] Different application systems correspond to different system registration configuration information. Taking the Android system as an example, the corresponding configuration information needs to be added to the AndroidManifest page to declare which pages or components the application includes, declare the system capabilities that the application needs to use, such as network, location, camera, etc., and declare the application's startup entry point, component attributes, process rules, etc.
[0082] In this disclosure, by adding system registration configuration information to the prompt message, the generated test application has complete component registration and startup configuration on the target running system, thereby ensuring that the test application can be correctly identified by the system, start normally, and execute test logic smoothly. After the test application is generated, it helps to achieve smooth installation and operation.
[0083] In some embodiments of this disclosure, the implementation flow of the application generation method for testing the functionality of a software development kit can be as follows: Figure 3 As shown, the entire process can be divided into standardization processing, input processing, and model processing.
[0084] Before inputting the target prompt information into the large language model, the process includes debugging the initial prompt information and selecting the appropriate large language model. Specifically, the initial prompt information is iteratively optimized based on multiple different interface documents, and the optimized initial prompt information is input into the large language model to generate a test application. After each test application is generated, it is run and verified until the interface document corresponding to the large language model generates a test application that meets the preset running requirements.
[0085] The initial prompts guide the large language model to generate a test application based on the standardized interface documentation. The content includes information such as the interface structure description, page generation constraints, and runtime configuration requirements.
[0086] To improve the stability and universality of the generated results, the initial prompts are debugged based on multiple different interface documents, thereby achieving iterative optimization. Optionally, the initial prompts are combined with different interface documents and input into the large language model to generate corresponding test applications, and the generated test applications are then run for verification. Run verification includes checking the test application's startup status, page display, and interface function execution results to determine if they meet the preset running requirements. If the generated test application does not meet the preset running requirements, the initial prompts are adjusted and input into the large language model again for generation, until the large language model can generate test applications that meet the preset running requirements for different interface documents.
[0087] Iterative optimization can be achieved through rule enhancement or structural adjustments, such as refining generation constraints in prompts, structurally marking interface parsing descriptions, or supplementing page generation rules. Runtime verification can be automated, including determining whether the test application can start normally, whether there are any runtime anomalies, and whether the target functionality is correctly displayed. For generated results that fail verification, the prompts can be optimized based on the anomaly type, such as supplementing lifecycle management requirements or improving parameter processing rules, thereby improving the accuracy and consistency of subsequent generated results.
[0088] In this disclosure, through iterative optimization based on multiple different interface documents and running verification after each generated test application, the large language model gradually adapts to different interface structures and functional requirements, improves the stability and generalization ability of the generated test applications, and helps the large language model generate test applications that meet preset running requirements for different interface documents.
[0089] Based on the target test application and test cases generated by the application generation method for testing the functionality of software development kits disclosed herein, this disclosure also provides an automated testing method.
[0090] Combination Figure 4 The automated testing method shown may include steps 401 to 403.
[0091] Step 401: Obtain the target test application and test cases.
[0092] Step 402: Input the test cases into the test case interpreter agent to generate the test case execution plan.
[0093] Step 403: Input the test case execution plan, target test application, and test cases into the visual operation agent, so that the visual operation agent can operate the interface of the target test application according to the test case execution plan and test cases, and generate test results.
[0094] Specifically, the target test application is a runnable application generated based on standardized interface documentation, which carries the calling logic of interface methods and the page display structure.
[0095] Test cases are used to describe the functional objectives, operational steps, and expected results to be verified.
[0096] In this disclosure, the intelligent agent is constructed based on a large language model or other artificial intelligence model and is configured to receive external input data, perform semantic understanding and logical processing on the data, and generate corresponding processing results or execution instructions according to preset goals. By splitting the test task and assigning it to different intelligent agents for processing, the automated execution of the test task can be achieved.
[0097] Specifically, the test case interpretation agent is a processing unit used to perform semantic parsing of the test case content and generate an execution plan.
[0098] Test cases are input into the test case interpreter agent, which performs semantic analysis on the functional descriptions, operation steps, and expected results of the test cases. It extracts target functional information, interface operation behaviors, and decision conditions from the test cases, and then automatically generates corresponding test case execution plans. The test case execution plan can include information about the execution steps, such as the order of operations, the objects being operated on, and the operation parameters during the test.
[0099] Based on the test case interpretation agent, test cases can be automatically converted from text descriptions into executable operation steps, improving the automation level of the test execution process.
[0100] The test case execution plan, target test application, and test cases are input into the vision operation agent, which then performs the subsequent testing.
[0101] Specifically, the visual operation agent is a processing unit used to automatically identify and manipulate the application interface of the target test application. Based on the received test case execution plan and test cases, the visual operation agent identifies and analyzes the interface images in the target test application, determines the position and type of each interactive control in the interface, and executes the corresponding interface operations according to the test case execution plan. For example, the visual operation agent can identify interactive controls such as buttons, input boxes, and selection controls in the interface, and execute operations such as clicking, parameter input, option selection, and page switching according to the operation steps in the test cases, thereby automatically completing the execution of the test cases in the target test application. After execution, it automatically collects the resulting images of the application content for subsequent test result generation.
[0102] In this disclosure, a vision-based intelligent agent can automatically operate the interface of a test application, which helps to improve the automation level and execution efficiency of test execution.
[0103] By leveraging the collaboration between the test case interpretation agent and the visual operation agent, the system achieves coordinated processing of test case semantic parsing and automated interface operation, automating the entire testing process from test case understanding to interface execution. This testing process reduces manual intervention, improves testing efficiency, and enhances the accuracy of the operation process through structured test case execution planning, thereby improving the overall reliability of the test solution.
[0104] In this disclosure, the visual operation agent operates the interface of the target test application according to the test case execution plan and test cases, and generates test results. Specifically, it may include: after each test case is executed, collecting the current interface state information and generating a result image; inputting the result image into the image verification agent, so that the image verification agent can identify and analyze the result image according to a preset result judgment rule, and generate test results.
[0105] Specifically, in combination Figure 5 As shown, the visual operation agent can determine the order of interface operations and the objects of operation based on the test case execution plan, and perform operations such as control recognition, parameter input, button click and page switching on the interface of the target test application.
[0106] After each test case is executed, the current state of the interface is collected. This interface state information may include the displayed page content, control states, and prompts. A result image is generated based on the interface state information and then input into the image verification agent. Optionally, the result image can be first transmitted to a database for archiving, and then extracted from the database and input into the image verification agent.
[0107] In this disclosure, the image verification agent is a processing unit used to perform image recognition and result determination on the test execution results.
[0108] Specifically, after the test cases are executed, the image verification agent receives the generated result image and identifies and analyzes the interface elements, text information, page status, and other content included in the interface.
[0109] For example, the image verification agent can determine whether a target interface element, target text information, or expected page state exists in the result image based on preset result judgment rules, and compare the recognition result with the expected result defined in the test case to generate the corresponding test result. For example, in a test case, after clicking on a graphic object in a map, the interface needs to pop up a prompt message with the content "Graphic clicked". The preset result judgment rule can be: identify whether target text information exists in the result image, and when text content consistent with the expected result of the test case is identified, the test result is determined to be passed.
[0110] In this disclosure, interface state information is collected and a result image is generated after the test cases are executed. An image verification agent is then used to automatically identify and determine the direct results of the test. The image-level verification mechanism improves the accuracy and efficiency of test result determination, thereby contributing to improved overall testing efficiency and accuracy.
[0111] Corresponding to the application generation method for testing the functionality of a software development kit provided in this disclosure, this disclosure also provides an application generation apparatus for testing the functionality of a software development kit. Specifically, in conjunction with... Figure 6 The application generation device shown for testing the functionality of a software development kit includes an acquisition module 601 and an application generation module 602.
[0112] The acquisition module 601 is used to acquire the standardized interface documents, page structure templates, page generation rules, test case templates, and runtime configuration rules corresponding to the running system of the test application of the target software development kit. The application generation module 602 is used to input standardized interface documents, page structure templates, page generation rules, test case templates, and runtime configuration rules as target prompt information into the large language model, so that the large language model can parse the standardized interface documents based on the prompt information and generate a set of target test applications and corresponding test cases.
[0113] In some embodiments of this disclosure, the acquisition module 601 is further configured to acquire the interface documentation of the target software development kit; The acquisition module 601 is also used to extract the class name of each calling object in the target software development kit and the name of the corresponding interface method from the interface document; extract the functional description information, calling method and parameter value range of the interface method; and determine the method of determining the value of the input parameter of the interface method so that the value of the input parameter is determined by the parameter value received at the time of the call, thereby obtaining a standardized interface document.
[0114] In some embodiments of this disclosure, the target test application includes functional units corresponding to class names, and the set of test cases includes multiple test cases corresponding to each functional unit.
[0115] In some embodiments of this disclosure, the page structure template includes a page layout template and a page execution logic template; The page layout template includes the layout structure information of the display positions of interactive controls in the application page; The page operation logic template includes the operation processing logic of interactive controls.
[0116] In some embodiments of this disclosure, the page generation rules include: page control generation rules and page execution logic generation rules; The page control generation rules include matching rules for interactive controls based on the input parameter types of interface methods; The page execution logic generation rules include at least one of the following: the lifecycle management rules corresponding to the test application's running system, the parameter processing rules for input parameters, the rules for handling exceptions in the preset business logic execution, the page interaction control rules, and the page execution logic code generation specifications.
[0117] In some embodiments of this disclosure, the input parameter type includes at least one of input type, enumeration type, and Boolean type.
[0118] In some embodiments of this disclosure, the parameter processing rules for input parameters include: parameter validation and parameter passing rules during interface method invocation.
[0119] In some embodiments of this disclosure, running configuration rules includes: adding a directory page to the target test application and adding an access entry for each functional unit on the directory page.
[0120] In some embodiments of this disclosure, the runtime configuration rules also include system registration configuration information.
[0121] In some embodiments of this disclosure, the application generation module 602 is further configured to iteratively optimize the initial prompt information based on multiple different interface documents, and input the optimized initial prompt information into the large language model to generate a test application. After each test application is generated, the application is run and verified until the interface document corresponding to the large language model generates a test application that meets the preset running requirements.
[0122] Corresponding to the automated testing method provided in this disclosure, this disclosure also provides an automated testing apparatus. Specifically, in conjunction with... Figure 7 The automated testing device shown includes an acquisition module 701, a planning generation module 702, and a testing module 703.
[0123] The acquisition module 701 is used to acquire the target test application and test cases, wherein the target test application and test cases are generated based on the application generation method for testing the functions of software development kits disclosed herein; The planning generation module 702 is used to input test cases into the test case interpreter agent to generate test case execution plans; Test module 703 is used to input test case execution plan, target test application and test cases into visual operation agent, so that visual operation agent can operate the interface of target test application according to test case execution plan and test cases and generate test results.
[0124] In some embodiments of this disclosure, the test module 703 is further configured to collect current interface state information and generate a result image after each test case is executed; input the result image into the image verification agent so that the image verification agent can identify and analyze the result image according to a preset result judgment rule and generate a test result.
[0125] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0126] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0127] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0128] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0129] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as application generation methods and / or automated testing methods for testing the functionality of a software development kit. For example, in some embodiments, the application generation methods and automated testing methods for testing the functionality of a software development kit can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the application generation methods and / or automated testing methods for testing the functionality of a software development kit described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured by any other suitable means (e.g., by means of firmware) to perform application generation methods and / or automated testing methods for testing the functionality of the software development kit.
[0130] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0131] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0132] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0133] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0134] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0135] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0136] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0137] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for generating applications to test the functionality of software development kits, characterized in that, include: Obtain the standardized interface documentation, page structure templates, page generation rules, test case templates, and runtime configuration rules corresponding to the running system of the test application for the target software development kit; The standardized interface document, the page structure template, the page generation rules, the test case template, and the runtime configuration rules are used as target prompt information and input into the large language model. The large language model then parses the standardized interface document based on the prompt information to generate a target test application and a set of test cases corresponding to the target test application.
2. The method according to claim 1, wherein, Obtain the standardized interface documentation for the target software development kit, including: Obtain the interface documentation for the target software development kit; In the interface document, the class name of each calling object in the target software development kit and the name of the corresponding interface method are extracted; the functional description information, calling method and parameter value range of the interface method are extracted; and the method for determining the value of the input parameter of the interface method is determined so that the value of the input parameter is determined by the parameter value received at the time of the call, thus obtaining the standardized interface document.
3. The method according to claim 2, wherein, The target test application includes functional units corresponding to the class name, and the set of test cases includes multiple test cases corresponding to each functional unit.
4. The method according to claim 1, wherein, The page structure template includes a page layout template and a page operation logic template; The page layout template includes the layout structure information of the display positions of interactive controls in the application page; The page operation logic template includes the operation processing logic of interactive controls.
5. The method according to claim 1, wherein, The page generation rules include: page control generation rules and page execution logic generation rules; The page control generation rules include interactive control matching rules based on the input parameter type of the interface method; The page execution logic generation rules include at least one of the following: lifecycle management rules corresponding to the test application's running system, parameter processing rules for input parameters, rules for handling default business logic execution exceptions, page interaction control rules, and page execution logic code generation specifications.
6. The method according to claim 5, wherein, The input parameter type includes at least one of the following: input type, enumeration type, and Boolean type.
7. The method according to claim 5, wherein, The parameter processing rules for the input parameters include: parameter validation and parameter passing rules during the interface method call process.
8. The method according to claim 1, wherein, The runtime configuration rules include: adding a directory page to the target test application, and adding an access point for each functional unit on the directory page.
9. The method according to claim 1, wherein, The runtime configuration rules also include system registration configuration information.
10. The method according to claim 1, wherein, Before inputting the target prompt information into the large language model, the method includes: The initial prompt information is iteratively optimized based on multiple different interface documents, and the optimized initial prompt information is input into a large language model to generate a test application. After each test application is generated, it is run and verified until the interface document corresponding to the large language model generates a test application that meets the preset running requirements.
11. An automated testing method, comprising: Obtain the target test application and test cases, wherein the target test application and test cases are generated based on the application generation method for testing the functionality of a software development kit as described in any one of claims 1-10; The test cases are input into the test case interpreter agent to generate a test case execution plan; The test case execution plan, the target test application, and the test cases are input into the visual operation agent, which then operates the interface of the target test application according to the test case execution plan and the test cases, and generates test results.
12. The method according to claim 11, wherein, The visual operation agent operates the interface of the target test application according to the use case execution plan and test cases, and generates test results, including: After each test case is executed, the current interface state information is collected and a result image is generated; The result image is input into the image verification agent, which then performs recognition and analysis on the result image based on preset result judgment rules and generates the test result.
13. An application generation apparatus for testing the functionality of a software development kit, comprising: The acquisition module is used to acquire the standardized interface documents, page structure templates, page generation rules, test case templates, and runtime configuration rules corresponding to the running system of the test application for the target software development kit. The application generation module is used to input the standardized interface document, the page structure template, the page generation rules, the test case template, and the runtime configuration rules as target prompt information into the large language model, so that the large language model parses the standardized interface document based on the prompt information and generates a target test application and a set of test cases corresponding to the target test application.
14. An automated testing device, comprising: The acquisition module is used to acquire the target test application and test cases, wherein the target test application and test cases are generated based on the application generation method for testing the functions of a software development kit as described in any one of claims 1-10; The planning generation module is used to input the test cases into the test case interpreter agent to generate a test case execution plan; The testing module is used to input the test case execution plan, the target test application, and the test cases into the visual operation agent, so that the visual operation agent operates the interface of the target test application according to the test case execution plan and the test cases, and generates test results.
15. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-12.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-12.
17. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-12.