Script testing method and device, equipment, medium and product

By obtaining and generating test scripts associated with test requirement information, and using tools such as Jira, Git, and Gerrit for review and tracking, the difficulty of automated test script version management is solved, and the matching check between scripts and software versions is realized, simplifying Management and maintenance processes.

CN118820064APending Publication Date: 2024-10-22CHINA MOBILE M2M +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410472802.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

In the existing technology, automated test scripts change with software versions, resulting in multiple version records of test scripts for the same software or function, making management and maintenance difficult.

Method used

By obtaining the test requirement information of the target software version, generate a test script associated with the test requirement information, and call the test script after passing the review, and obtain the test results to determine the match between the script and the software version, using tools such as Jira, Git, and Gerrit Perform script tracking and auditing.

Benefits of technology

It achieves accurate management and maintenance of multiple versions of test scripts, ensures the match between test scripts and target software versions, and simplifies the script development and maintenance process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820064A_ABST
    Figure CN118820064A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a script testing method and device, equipment, a medium and a product, is applied to a testing tool and comprises the steps that testing requirement information of a target software version is obtained; generating a test script having an association relationship with the test demand information; and under the condition that the test script is approved, calling the test script to obtain a test result of the test script, the test result being used for representing whether the test script is matched with the target software version. According to the embodiment, whether the test script is matched with the software version or not can be accurately checked.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of automated testing technology, and in particular, relates to a script testing method, device, equipment, medium and product. Background Art

[0002] In the prior art, the management of test scripts includes the development, implementation and later maintenance of automated test script cases. At present, with the continuous changes in development requirements, the corresponding automated test scripts will also change accordingly, so that there are multiple versions of automated test scripts corresponding to the same software or the same function. Summary of the invention

[0003] The embodiments of the present application provide a script testing method, apparatus, equipment, medium and product, which can effectively implement the management of multiple versions of test scripts including automated test script case development, implementation and post-maintenance.

[0004] In a first aspect, an embodiment of the present application provides a script testing method, which is applied to a testing tool; the method comprises:

[0005] Obtain test requirement information for the target software version;

[0006] Generate a test script associated with the test requirement information;

[0007] When the test script is approved, the test script is called to obtain the test result of the test script, which is used to indicate whether the test script matches the target software version.

[0008] In an optional embodiment of the first aspect, when the test script is reviewed and approved, before calling the test script and obtaining the test result of the test script, the method further includes:

[0009] The test script is audited a preset number of times to obtain an audit result, which indicates whether the test script has passed the audit.

[0010] In an optional embodiment of the first aspect, after acquiring the test requirement information of the target software version, the method further includes:

[0011] A tracking mark corresponding to the test requirement information is generated, and the tracking mark is used by the test tool to track the test script associated with the test requirement information.

[0012] In an optional embodiment of the first aspect, the method further includes:

[0013] Generates an association identifier between the test script and the target software version.

[0014] In a second aspect, an embodiment of the present application provides a script testing device, which is applied to a testing tool; the device includes:

[0015] An acquisition module is used to obtain the test requirement information of the target software version;

[0016] A generation module, used for generating a test script associated with the test requirement information;

[0017] The calling module is used to call the test script when the test script is reviewed and passed, and obtain the test result of the test script. The test result is used to indicate whether the test script matches the target software version.

[0018] In an optional implementation of the second aspect, the device further includes:

[0019] The audit module is used to audit the test script a preset number of times and obtain the audit result, which indicates whether the test script has passed the audit.

[0020] In an optional implementation of the second aspect, the generating module is further used to generate a tracking identifier corresponding to the test requirement information, and the tracking identifier is used by the testing tool to track the test script associated with the test requirement information.

[0021] In a third aspect, an electronic device is provided, comprising: a memory for storing computer program instructions; and a processor for reading and running the computer program instructions stored in the memory to execute the script testing method provided by any optional implementation in the first aspect.

[0022] In a fourth aspect, a computer storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the script testing method provided by any optional implementation in the first aspect is implemented.

[0023] In a fifth aspect, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the script testing method provided by any optional implementation in the first aspect is implemented.

[0024] In the embodiment of the present application, the test requirement information of the target software version can be obtained, and a test script associated with the test requirement information can be generated. Then, if the test script is approved, the test script is called to obtain the test result of the test script, and the test result is used to characterize whether the test script matches the target software version. In this way, it is possible to accurately check whether the test script matches the software version. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0026] Figure 1 It is a flowchart of a script testing method provided in an embodiment of the present application;

[0027] Figure 2 It is a structural diagram of a script testing device provided in an embodiment of the present application;

[0028] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0030] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0031] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0032] In order to solve the above-mentioned problems in the background technology, the embodiments of the present application provide a script testing method, device, equipment, medium and product, which can obtain the test requirement information of the target software version, and generate a test script associated with the test requirement information, and then, when the test script is approved, call the test script to obtain the test result of the test script, and the test result is used to characterize whether the test script matches the target software version. In this way, it is possible to accurately check whether the test script corresponds to the software version.

[0033] In order to more accurately describe the script testing method provided in the embodiment of the present application, before introducing the script testing method provided in the embodiment of the present application, the testing tools involved in the embodiment of the present application are first described in detail. The testing tools include code review software Gerrit, project and transaction tracking tool Jira, distributed version control system Git, and continuous integration project tool Jenkins and other tools.

[0034] Based on this, the script testing method provided in the embodiment of the present application is not only limited to the functions of adding, deleting and modifying the test script itself, but can also use Jira to track the development of the test script, use Git as the underlying version control system, use Gerrit to perform code review on the test script, and use Jenkins to implement a series of pipeline operations to ensure that the latest modified automated test script can be correctly applied to the corresponding software version.

[0035] The script testing method provided in the embodiment of the present application is described in detail below through specific embodiments in conjunction with the accompanying drawings.

[0036] Figure 1 It is a flowchart of a script testing method provided in an embodiment of the present application.

[0037] like Figure 1 As shown, the execution subject of the script test method can be a test tool. Based on this, the method can specifically include the following steps:

[0038] S110, obtaining test requirement information of the target software version.

[0039] S120, generating a test script associated with the test requirement information;

[0040] S130, when the test script is approved, calling the test script to obtain the test result of the test script.

[0041] The test requirement information may be determined according to the actual situation. In addition, in some embodiments, the test result is used to indicate whether the test script matches the target software version.

[0042] Specifically, the testing tool can obtain the test requirement information of the target software version, and use Git to generate a test script associated with the test requirement information. Then, when the test script is reviewed and approved, Jenkins can be used to call the test script and obtain the test result of the test script.

[0043] It should be noted that Git is an open source distributed version control system that can effectively and quickly handle version management of projects from very small to very large. In this proposal, it is used to manage two libraries, one is the software version library to be tested, and the other is the automated test script library. Automation development technicians develop or modify automated test scripts according to requirements and submit them to the Git library. Use Git's tags to correspond the different versions of the two libraries. Use the commitID generated by each update submission to the library to roll back the software version and its corresponding automated test script related version. At the same time, you can also roll back to the software version and its corresponding automated test script related version through the tag label.

[0044] It should also be noted that Jenkins is used to detect whether the newly developed and modified automated test scripts can be used on the corresponding software version. When the Jenkins platform monitors that the Gerrit platform has completed code review+2, it will automatically trigger the business.

[0045] In the embodiment of the present application, the test requirement information of the target software version can be obtained, and a test script associated with the test requirement information can be generated. Then, if the test script is approved, the test script is called to obtain the test result of the test script, and the test result is used to characterize whether the test script matches the target software version. In this way, it is possible to accurately check whether the test script corresponds to the software version.

[0046] In one embodiment, when the test script is approved, before calling the test script and obtaining the test result of the test script, the method further includes:

[0047] The test script is audited a preset number of times to obtain the audit results.

[0048] The audit result indicates whether the test script has passed the audit.

[0049] In addition, the preset number of times may be determined based on actual experience or circumstances, and is not specifically limited here.

[0050] Specifically, the testing tool can use Gerrit to review the test script a preset number of times to obtain the review results.

[0051] It should be noted that Gerrit is an open source software that uses a web interface for code review. Using a web browser, software programmers in the same team can review each other's modified program code and decide whether to submit, return or continue to modify it. It uses Git as the underlying version control system. In this proposal, you can see the two repositories created and managed by Git in the Gerrit web interface. When the development automation technician submits new modifications to the Git repository, you need to use Gerrit to perform code review first, which is code review+1 and code review+2. Jenkins provides an open and easy-to-use open source software platform that enables software projects to perform continuous integration and is used to monitor continuous and repetitive work. Its main functions include implementing continuous software version release / testing projects and monitoring work performed by external calls.

[0052] In this embodiment, Gerrit can be used to review the test script a preset number of times so as to obtain accurate review results, thereby facilitating subsequent accurate detection of whether the test script matches the target software version.

[0053] In one embodiment, after obtaining the test requirement information of the target software version, the method further includes:

[0054] Generate a traceability identifier corresponding to the test requirement information.

[0055] In some embodiments, the tracking identifier is used by the testing tool to track the test script associated with the test requirement information.

[0056] Specifically, after obtaining the test requirement information of the target software version, the test tool can use Jira to generate a tracking identifier corresponding to the test requirement information.

[0057] It should be noted that Jira is a project and transaction tracking tool, and is widely used in defect tracking, requirement collection, task tracking, project tracking, and agile management. In this proposal, Jira is used to track new requirements for automated development and the progress of automated test script development. Each new requirement will generate a corresponding Jira number. Based on the Jira number, you can see the development progress of the related automated test scripts, whether the development is completed, whether the code review is completed, and whether it has been merged into the Git repository.

[0058] In this embodiment, Jira can be used to generate a tracking identifier corresponding to the test requirement information, so that the corresponding test script can be accurately tracked based on the tracking identifier later.

[0059] In one embodiment, the script testing method mentioned above further includes:

[0060] Generates an association identifier between the test script and the target software version.

[0061] Specifically, when the test tool generates a test script associated with the test requirement information using Git, it also generates an association identifier between the test script and the target software version. The association identifier is used to identify the association relationship between the test script and the target software version.

[0062] In this embodiment, by generating an association identifier between the test script and the target software version, not only can the current automated test script library be viewed, but also the previous automated test script library can be rolled back or obtained without affecting the current test script library. The automated test script library in the present invention is not developed and optimized completely independently. In addition to the addition of new automation requirements, it also changes with the changes in the software version to be tested. This proposal uses the distributed version control system Git. Each time the software version to be tested and the automated test script library are modified and updated, the software version is matched with the automated test script by using a tag. When it is necessary to roll back to the automated test script library corresponding to a previous software version, the tag can be used to roll back and obtain it.

[0063] In order to more accurately describe the script testing method provided in the embodiment of the present application, two Git repositories are created on the Gerrit web page interface. One software version library is named SDK, which is used to store iterative software versions; the other is a code library for storing automated test scripts, named AutoTest. The corresponding relationship between the two versions of different cycles can be established through custom tagging. A project named Test is created on Jira to track the requirement updates, development progress, etc. of automated test scripts. A new business is created on Jenkins, and a trigger is configured. Once this trigger monitors that the code submission of AutoTest has completed code review+2, it triggers the business.

[0064] When technician A proposes the requirement of implementing automated testing for a test case in the Test project on Jira and ensures that it can be carried out stably on the SDK software version of the corresponding stage, the Jira single point is sent to technician B, and a requirement sheet with Jira number Tset-1 is generated. Technician A can track the development progress of the automated test script through Tset-1, and technician B can also track and solve the problem through it when a problem occurs. Technician B receives the new requirement sheet Tset-1 and starts to develop the automated test script. When the development is completed, the corresponding SDK software version is tagged with the version number tag through Git tag, the corresponding Jira single number Tset-1 is noted, and it is submitted to the Git remote library AutoTest (this library can be viewed in Gerrit). At this time, the newly added script has not been actually entered into the library, and Gerrit will generate the corresponding web link. Technician C conducts code review on technician B. If it passes, code review+1 is given, otherwise it is rejected and technician B re-modifies it. After code review+1, technician D conducts code review. If it passes, code review+2 is given. Jenkins configures triggers, and the trigger condition is code review+2 in Gerrit. Once +2 is completed, Jenkins automatically triggers the associated pipeline work. This pipeline task is deployed in server F. Git clones the latest SDK software version library and the latest automated test scripts, burns the relevant versions, calls the automated test scripts, checks whether there are any problems with the automated test scripts themselves, and detects whether the relevant scripts can be applied to the corresponding software versions. If the Jenkins task is completed, Gerrit verified+1 is automatically triggered. At this time, the corresponding changes are truly stored in the library, and the relevant submissions can be seen on the Git library as successful.

[0065] Based on the same inventive concept, the present application embodiment also provides a script testing device. Figure 2 The script testing device provided in the embodiment of the present application is described in detail.

[0066] Figure 2 It is a structural diagram of a script testing device provided in an embodiment of the present application.

[0067] like Figure 2 As shown, the script testing device 200 may include: an acquisition module 210 , a generation module 220 and a calling module 230 .

[0068] An acquisition module is used to obtain the test requirement information of the target software version;

[0069] A generation module, used for generating a test script associated with the test requirement information;

[0070] The calling module is used to call the test script when the test script is reviewed and passed, and obtain the test result of the test script. The test result is used to indicate whether the test script matches the target software version.

[0071] In one embodiment, the apparatus further comprises:

[0072] The audit module is used to audit the test script a preset number of times and obtain the audit result, which indicates whether the test script has passed the audit.

[0073] In one embodiment, the generating module is further used to generate a tracking mark corresponding to the test requirement information, and the tracking mark is used by the testing tool to track the test script associated with the test requirement information.

[0074] In one embodiment, the generation module is further used to generate an association identifier between the test script and the target software version.

[0075] In the embodiment of the present application, the test requirement information of the target software version can be obtained, and a test script associated with the test requirement information can be generated. Then, if the test script is approved, the test script is called to obtain the test result of the test script, and the test result is used to characterize whether the test script matches the target software version. In this way, it is possible to accurately check whether the test script corresponds to the software version.

[0076] Each module in the script testing device provided in the embodiment of the present application can be implemented Figure 1 The method steps of the illustrated embodiment can achieve the corresponding technical effects, and for the sake of brevity, they will not be repeated here.

[0077] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0078] The electronic device may include a processor 301 and a memory 302 storing computer program instructions.

[0079] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0080] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.

[0081] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0082] The processor 301 implements any one of the script testing methods in the above embodiments by reading and executing computer program instructions stored in the memory 302 .

[0083] In one example, the electronic device may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 and communicate with each other.

[0084] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0085] Bus 310 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0086] In addition, in combination with the script testing method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the script testing method provided in the embodiment of the present application is implemented.

[0087] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the script testing method provided in the embodiment of the present application.

[0088] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0089] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0090] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0091] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box 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, or other programmable script test device to produce a machine so that these instructions executed by the processor of the computer or other programmable script test device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0092] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A script testing method, characterized in that: Applied to a test tool, the method comprises: Obtain test requirement information for the target software version; Generate a test script associated with the test requirement information; When the test script passes the review, the test script is called to obtain a test result of the test script, and the test result is used to indicate whether the test script matches the target software version.

2. The method according to claim 1, characterized in that When the test script is approved, before calling the test script and obtaining the test result of the test script, the method further includes: The test script is audited a preset number of times to obtain an audit result, wherein the audit result indicates whether the test script has passed the audit.

3. The method according to claim 1, characterized in that After obtaining the test requirement information of the target software version, the method further includes: A tracking mark corresponding to the test requirement information is generated, and the tracking mark is used by the test tool to track the test script associated with the test requirement information.

4. The method according to claim 1, characterized in that: The method further comprises: Generate an association identifier between the test script and the target software version.

5. A script testing device, characterized in that: Applied to a test tool, the device comprises: An acquisition module is used to obtain the test requirement information of the target software version; A generating module, used for generating a test script associated with the test requirement information; The calling module is used to call the test script when the test script is reviewed and obtain the test result of the test script, and the test result is used to indicate whether the test script matches the target software version.

6. The device according to claim 5, characterized in that The device also includes: The audit module is used to audit the test script for a preset number of times to obtain an audit result, wherein the audit result indicates whether the test script has passed the audit.

7. The device according to claim 5, characterized in that The generating module is further used to generate a tracking mark corresponding to the test requirement information, and the tracking mark is used by the testing tool to track the test script associated with the test requirement information.

8. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the script testing method according to any one of claims 1 to 4.

9. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, which, when executed by a processor, implement the script testing method according to any one of claims 1 to 4.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the script testing method according to any one of claims 1 to 4 is implemented.