Software system interface test method and system, electronic equipment and storage medium

By using large model technology to parse software system interface documents, generate test cases and scripts, and integrate them into the CI/CD process, the problem of inefficiency of traditional testing methods is solved, intelligent and adaptive interface automation testing is realized, and the efficiency is improved Test efficiency and quality.

CN119336638APending Publication Date: 2025-01-21NORTH CHINA DIGITAL HEALTH TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411410023.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

When facing the huge software system interface, traditional manual testing methods are inefficient and difficult to ensure the comprehensiveness and timeliness of testing. The existing automated testing tools lack flexibility and intelligence, making it difficult to deal with complex and changeable testing scenarios.

Method used

By obtaining the software system interface document and demand document, use a pre -built large model analysis document to extract key information. Based on this information application preset test strategy to generate test cases and test script, and integrate the test script into the CI/CD process Execute and generate test reports.

Benefits of technology

It realizes the intelligence and adaptability of automated testing of software interfaces, improves testing efficiency and quality, and reduces testing costs and human errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336638A_ABST
    Figure CN119336638A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a software system interface testing method and system, electronic equipment and a storage medium, and belongs to the field of software testing. The method comprises the steps that a software system interface document and a demand document are obtained, the interface document and the demand document are analyzed through a pre-constructed large model, document key information is extracted, and the document key information comprises but is not limited to interface definition, parameter information and business logic; based on the document key information, applying a preset test strategy to generate a test case, and generating a test script and test data meeting interface parameter requirements according to the test case; and integrating the test script into the CI / CD process, executing the test script, obtaining a test result, and generating a test report according to the test result. By means of the technical scheme, the large model technology can be effectively utilized to achieve software interface automatic testing, the testing efficiency and quality are improved, and the testing cost and human errors are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a software system interface testing method, system, electronic equipment and storage medium. Background Art

[0002] With the rapid development of information technology, software systems are becoming increasingly large and complex, and the number of interfaces is growing exponentially, which not only puts higher demands on software quality, but also brings unprecedented challenges to testing. Although the traditional manual testing method is meticulous, it is incapable and inefficient when facing such a large group of interfaces, and it is difficult to ensure the comprehensiveness and timeliness of the test. Therefore, as an important technological innovation in the field of modern software testing, interface automation testing is becoming increasingly important.

[0003] However, although the automated testing tools on the market can reduce the testing burden to a certain extent, most of them are based on preset rules or templates, lacking sufficient flexibility and intelligence, and are difficult to flexibly respond to complex and changing test scenarios and emergencies in actual projects. This requires us to continue to innovate while exploring interface automated testing technology, and seek more intelligent and adaptive solutions to better adapt to the needs of the rapid development of the software industry. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a software system interface testing method, system, electronic device and storage medium, which are used to fully or at least partially solve the technical problems existing in the above-mentioned prior art.

[0005] In order to achieve the above object, an embodiment of the present invention provides a software system interface testing method, comprising: Obtain software system interface documents and requirement documents, and use the pre-built large model to parse the interface documents and requirement documents to extract key information of the documents, including but not limited to interface definition, parameter information and business logic; Based on the key information of the document, apply the preset test strategy to generate test cases, generate test scripts based on the test cases, and generate test data that meets the interface parameter requirements; Integrate test scripts into the CI / CD process, execute test scripts, obtain test results, and generate test reports based on the test results.

[0006] Optionally, the large model building process includes: Use the Transformers library to load the selected pre-trained NLP large model and its tokenizer; Adjust the learning rate and batch size parameters of the pre-trained NLP large model according to task requirements; Fine-tune the pre-trained NLP large model with adjusted parameters, and use the Adam optimizer to update the parameters of the pre-trained NLP large model to minimize the loss function and obtain the target large model.

[0007] Optionally, based on the key information in the document, apply the preset test strategy to generate test cases, including: According to the interface document, determine the boundary value of each request parameter, design a separate test case for each boundary value, and merge similar test cases to obtain the target test case; According to the target test case, write the basic framework of the test script, where the basic framework of the test script includes but is not limited to initializing the test environment, sending requests, and receiving responses; Fill the input data in the test case into the test script to ensure that each test case can be executed independently; Write assertion statements in the test script to verify whether the response results meet expectations.

[0008] Optionally, generate test scripts based on test cases and generate test data that meets interface parameter requirements, including: According to the parameter constraints in the interface document, determine the test data that meets the requirements. For the boundary value, directly use the boundary value as the test data; Verify the test data after it is generated to ensure that the data meets the requirements of the interface parameters; Integrate the test data into the test script so that the test script sends requests and receives responses correctly.

[0009] Optionally, integrate the test script into the CI / CD process, execute the test script, obtain the test results, and generate a test report based on the test results, including: Configure the code repository in the CI / CD tool and create a new build task or pipeline to execute the test script. Add steps to the build task or pipeline to install and configure the necessary runtime environment. Start the build task or pipeline in the CI / CD process through code submission or scheduled tasks, obtain the execution status, execution time and error information of the test case, and generate a test report.

[0010] On the other hand, the present invention also provides a software system interface testing system, comprising: An acquisition unit is used to acquire software system interface documents and requirement documents, and parse the interface documents and requirement documents using a pre-built large model to extract key information of the documents, where the key information of the documents includes but is not limited to interface definition, parameter information, and business logic; A generation unit, used to generate test cases based on key information of the document and applying preset test strategies, and to generate test scripts and test data that meet the interface parameter requirements according to the test cases; The test unit is used to integrate test scripts into the CI / CD process, execute test scripts, obtain test results, and generate test reports based on the test results.

[0011] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned software system interface testing method when executing the program.

[0012] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above-mentioned software system interface testing method when executed by a processor.

[0013] Through the above technical solution, large model technology can be effectively used to realize automatic testing of software interfaces, improve testing efficiency and quality, and reduce testing costs and human errors.

[0014] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings: Figure 1 It is an implementation flow chart of a software system interface testing method provided by an embodiment of the present invention; Figure 2 It is a structural diagram of a software system interface testing system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0017] See also Figure 1 As shown, it is a flowchart of an implementation of a software system interface testing method provided by an embodiment of the present invention, including the following execution steps: Step 100: Obtain the software system interface document and requirement document, and use the pre-built large model to parse the interface document and requirement document to extract key information of the document, where the key information of the document includes but is not limited to interface definition, parameter information and business logic.

[0018] Preferably, the key information includes the interface document, which usually includes the URL of the API, the request method (such as GET, POST), the request parameters, the return data type and structure, etc.

[0019] In some embodiments, the process of constructing a large model includes the following steps: S1: Use the Transformers library to load the selected pre-trained NLP large model and its word segmenter; S2: Adjust the learning rate and batch size parameters of the pre-trained NLP large model according to task requirements; S3: Fine-tune the pre-trained NLP large model with adjusted parameters, and use the Adam optimizer to update the parameters of the pre-trained NLP large model to minimize the loss function and obtain the target large model.

[0020] Step 101: Based on the key information of the document, a preset test strategy is applied to generate a test case, and a test script is generated according to the test case, and test data that meets the interface parameter requirements is generated.

[0021] In some implementations, the step 101 of generating a test case based on the key information of the document and applying a preset test strategy includes the following sub-steps: S1010: Determine the boundary value of each request parameter according to the interface document, design a separate test case for each boundary value, and merge similar test cases to obtain a target test case; S1011: Writing a basic framework of a test script according to a target test case, wherein the basic framework of the test script includes but is not limited to initializing a test environment, sending a request, and receiving a response; S1012: Fill the input data in the test case into the test script to ensure that each test case can be executed independently; S1013: Write assertion statements in the test script to verify whether the response results meet expectations.

[0022] It should be understood that test cases should cover common operations in the health and medical big data platform, such as data query, data upload, data update, etc. Abnormal scenario testing should include network anomalies, parameter errors, insufficient permissions, etc.

[0023] In some implementations, executing step 101 of generating a test script according to a test case and generating test data that meets the interface parameter requirements includes the following sub-steps: S1: Determine the test data that meets the requirements according to the parameter constraints in the interface document, wherein for the boundary value, the boundary value is directly used as the test data; S2: Verify the test data after it is generated to ensure that the data meets the requirements of the interface parameters; S3: Integrate the test data into the test script so that the test script can correctly send requests and receive responses.

[0024] In some implementations, the test script adopts a standardized format to facilitate integration into an existing automated testing framework. The test script needs to be able to simulate real user operations, send requests, and receive responses.

[0025] In some implementations, the big model automatically generates corresponding test scripts and test data based on the designed test cases. The test scripts use a standardized format to facilitate integration into the existing automated testing framework; the test data is automatically generated based on the interface parameter requirements to ensure the authenticity and effectiveness of the test.

[0026] Step 102: Integrate the test script into the CI / CD process, execute the test script, obtain the test results, and generate a test report based on the test results.

[0027] Specifically, when executing step 102, the following steps may be specifically performed: S1020: Configure the code repository in the CI / CD tool and create a new build task or pipeline for executing the test script, wherein steps are added to the build task or pipeline for installing and configuring the necessary operating environment.

[0028] S1021: Start the build task or pipeline in the CI / CD process through code submission or scheduled tasks, obtain the execution status, execution time and error information of the test case, and generate a test report.

[0029] In some implementations, based on the test results, the big model generates a detailed test report, including key information such as test coverage, details of failed cases, performance indicators, etc. The test report is automatically fed back to relevant developers and testers through preset channels (such as emails, message notifications, etc.) so that problems can be fixed in a timely manner.

[0030] In some implementations, the big model generates a detailed test report based on the test results. The report contains key information such as test coverage, details of failed cases, and performance indicators. The test report is automatically fed back to relevant personnel (developers, testers, product managers, etc.) so that problems can be fixed in a timely manner. The test report should be clear and concise so that relevant personnel can quickly understand the test results and problems. Timely feedback of test reports can shorten the problem fixing cycle and improve product quality.

[0031] Through the above steps, the big model technology can be effectively used to realize the interface automation testing of the health and medical big data platform, improve the testing efficiency and quality, and reduce the testing cost and human errors.

[0032] See also Figure 2 FIG. 1 is a schematic diagram of a software system interface testing system provided by an embodiment of the present invention, comprising: The acquisition unit 20 is used to acquire the software system interface document and the requirement document, and parse the interface document and the requirement document using the pre-built large model to extract the key information of the document, wherein the key information of the document includes but is not limited to the interface definition, parameter information and business logic; A generating unit 21 is used to generate a test case based on the key information of the document and apply a preset test strategy, and to generate a test script according to the test case and to generate test data that meets the interface parameter requirements; The test unit 22 is used to integrate the test script into the CI / CD process, execute the test script, obtain the test results, and generate a test report based on the test results.

[0033] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the software system interface testing method described in any one of the above embodiments when executing the program.

[0034] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the software system interface testing method described in any of the above embodiments are implemented.

[0035] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0036] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0037] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0038] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0039] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0040] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0041] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0042] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0043] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A software system interface testing method, characterized in that: include: Obtain software system interface documents and requirement documents, and use the pre-built large model to parse the interface documents and requirement documents to extract key information of the documents, including but not limited to interface definition, parameter information and business logic; Based on the key information of the document, apply the preset test strategy to generate test cases, generate test scripts based on the test cases, and generate test data that meets the interface parameter requirements; Integrate test scripts into the CI / CD process, execute test scripts, obtain test results, and generate test reports based on the test results.

2. The software system interface testing method according to claim 1, characterized in that: The process of building a large model includes: Use the Transformers library to load the selected pre-trained NLP large model and its tokenizer; Adjust the learning rate and batch size parameters of the pre-trained NLP large model according to task requirements; Fine-tune the pre-trained NLP large model with adjusted parameters, and use the Adam optimizer to update the parameters of the pre-trained NLP large model to minimize the loss function and obtain the target large model.

3. The software system interface testing method according to claim 1, characterized in that: Based on the key information in the document, apply the preset test strategy to generate test cases, including: According to the interface document, determine the boundary value of each request parameter, design a separate test case for each boundary value, and merge similar test cases to obtain the target test case; According to the target test case, write the basic framework of the test script, where the basic framework of the test script includes but is not limited to initializing the test environment, sending requests, and receiving responses; Fill the input data in the test case into the test script to ensure that each test case can be executed independently; Write assertion statements in the test script to verify whether the response results meet expectations.

4. The software system interface testing method according to claim 3, characterized in that: Generate test scripts based on test cases and generate test data that meets interface parameter requirements, including: According to the parameter constraints in the interface document, determine the test data that meets the requirements. For the boundary value, directly use the boundary value as the test data; Verify the test data after it is generated to ensure that the data meets the requirements of the interface parameters; Integrate the test data into the test script so that the test script sends requests and receives responses correctly.

5. The software system interface testing method according to claim 1, characterized in that: Integrate test scripts into the CI / CD process, execute test scripts, obtain test results, and generate test reports based on the test results, including: Configure the code repository in the CI / CD tool and create a new build task or pipeline to execute the test script. Add steps to the build task or pipeline to install and configure the necessary runtime environment. Start the build task or pipeline in the CI / CD process through code submission or scheduled tasks, obtain the execution status, execution time and error information of the test case, and generate a test report.

6. A software system interface testing system, characterized in that: include: An acquisition unit is used to acquire software system interface documents and requirement documents, and parse the interface documents and requirement documents using a pre-built large model to extract key information of the documents, where the key information of the documents includes but is not limited to interface definition, parameter information, and business logic; A generation unit, used to generate test cases based on key information of the document and applying preset test strategies, and to generate test scripts and test data that meet the interface parameter requirements according to the test cases; The test unit is used to integrate test scripts into the CI / CD process, execute test scripts, obtain test results, and generate test reports based on the test results.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the software system interface testing method according to any one of claims 1 to 5 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the software system interface testing method according to any one of claims 1 to 5 are implemented.

Citation Information

Cited By

  • Interface verification and test method and device based on large model, medium and product

    CN121441793A

  • Large model-based interface verification and testing method, device, medium and product

    CN121441793B