A method, apparatus, device, medium for accelerating implementation of automated testing

CN114996158BActive Publication Date: 2026-08-07INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2022-06-29
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003]传统的自动化测试存在以下问题:1.和硬盘交互多,效率低

Benefits of technology

[0049] As can be seen from the above technical solutions, the present invention has the following advantages: it transforms the traditional manual testing method into automation, and achieves the configurability of the automated testing process through dynamic configuration of the automated testing process on the client, thus ensuring the dynamism and flexibility of the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996158B_ABST
    Figure CN114996158B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of server testing, and specifically provides a method, device, equipment and medium for accelerating automatic testing, which comprises the following steps: step 1: creating a running environment; step 2: creating two topologies in the running environment to store case objects and case definition objects respectively; step 3: executing the running environment, and obtaining the case definition object by using the case name during the execution process; step 4: if not affected by concurrency, obtaining the case object from the topology for storing the case object by using the case name, executing the case, and step 5: if affected by concurrency, obtaining the case object from the topology for storing the case definition object by using the case name, creating the case object, returning the created object, and executing the case according to the object. The method saves testing resources, shortens the testing period, and greatly saves human resources by realizing fast automation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of server testing technology, and more specifically to a method, apparatus, equipment, and medium for accelerating automated testing. Background Technology

[0002] Currently, server testing uses simple functional design automated test case models, involves frequent disk interaction, and has limited application scenarios. Traditional automated testing suffers from the following problems: 1. Frequent disk interaction leads to low efficiency. 2. Simple automated test case design limits applicable scenarios. 3. Automated test cases require loading, and finding test cases is inefficient. 4. Automated test case objects need to be manually managed, resulting in low efficiency and inconvenient development. 5. The lack of application caching and layering prevents maximizing efficiency. Summary of the Invention

[0003] Traditional automated testing suffers from the following problems: 1. Excessive interaction with the hard drive, resulting in low efficiency. 2. Relatively simple automated test case design, limiting applicable scenarios. 3. Loading is required when using automated test cases, and test case retrieval is inefficient. 4. Automated test case objects need to be managed manually, leading to low efficiency and inconvenient development. 5. Lack of application caching and layering prevents maximizing efficiency. This invention provides a method, apparatus, device, and medium for accelerating the implementation of automated testing.

[0004] In a first aspect, the present invention provides a method for accelerating automated testing, comprising the following steps:

[0005] Create the runtime environment;

[0006] Create two topologies in the runtime environment to store use case objects and use case definition objects respectively;

[0007] The execution environment is used to retrieve the use case definition object by the use case name during execution.

[0008] When not affected by concurrency, retrieve the use case object by the use case name from the topology where use case objects are stored; execute the use case.

[0009] Furthermore, the execution environment, after the step of retrieving the use case definition object by the use case name during execution, includes:

[0010] Determine if it is affected by concurrency;

[0011] If not affected by concurrency, the execution steps are as follows: retrieve the use case object by its name from the topology where use case objects are stored; execute the use case.

[0012] If affected by concurrency, retrieve the use case object by the use case name from the topology where the use case definition object is stored, create the use case object, return the created object, and execute the use case based on the object.

[0013] Furthermore, the steps to create the runtime environment also include:

[0014] Design use case objects and use case definition objects.

[0015] Furthermore, the steps for designing use case objects and use case definition objects include:

[0016] Abstract an automated test case into a test case object;

[0017] Design a use case definition object to describe the basic information of use cases; the basic information of a use case includes the type of use case, the file, whether it is a shared use case, and the use case name.

[0018] Furthermore, in the execution environment, the steps for retrieving the use case definition object using the use case name during execution include:

[0019] Start the runtime environment and scan the corresponding objects, adding them to the corresponding topology with the hash value of the use case name as the key;

[0020] During execution, the use case definition object is obtained by using the use case name.

[0021] Object-oriented: Abstract an automated test case into an object. The most important thing is the test execution method, and there are other attributes, such as the executor, execution time, execution result, log, etc.

[0022] Memory-based: In order to speed up the operation, the overall resources required by the design are all in memory instead of on the hard drive, thereby speeding up the operation and improving efficiency.

[0023] Multi-layer caching: Currently designed with two layers.

[0024] The first layer is the use case definition type, which is also an object. It is used to describe the basic information of the use case, such as what type of use case it is, the file path, whether it is a shared use case (whether concurrency needs to be considered), and the use case name.

[0025] The second layer consists of automated test case objects, which need to have the required attributes and methods.

[0026] Two topologies are created in memory, and each is stored with the hash value of the test case name as the key. This can speed up the search within a certain space.

[0027] Secondly, the present invention provides a device for accelerating automated testing, including an environment creation module, a topology creation module, an environment execution module, and a test case execution module;

[0028] The environment creation module is used to create the runtime environment;

[0029] The topology creation module is used to create two topologies in the runtime environment to store use case objects and use case definition objects respectively;

[0030] The environment execution module is used to execute the runtime environment. During execution, the test case definition object is obtained by using the test case name.

[0031] The test case execution module is used to retrieve test case objects by name from the topology where test case objects are stored, and execute the test cases when not affected by concurrency.

[0032] Furthermore, the device also includes a judgment module and an object processing module;

[0033] The judgment module is used to determine whether concurrency is a factor. If it is not affected by concurrency, the test case execution module is triggered; if it is affected by concurrency, the object processing module is triggered.

[0034] The object processing module is used to retrieve a test case object by the test case name from the topology where test case definition objects are stored, create the test case object, return the created object, and trigger the test case execution module to execute the test case based on the object.

[0035] Furthermore, the device also includes an object design module for designing use case objects and use case definition objects.

[0036] Furthermore, the object design module is specifically used to abstract an automated test case into a test case object; it designs a test case definition object to describe the basic information of the test case; the basic information of the test case includes the test case type, file name, whether it is a shared test case, and test case name.

[0037] Furthermore, the environment execution module is specifically used to start the runtime environment, scan the corresponding objects and add them to the corresponding topology using the hash value of the test case name as the key; during execution, the test case definition object is obtained using the test case name.

[0038] Object-oriented: Abstract an automated test case into an object. The most important thing is the test execution method, and there are other attributes, such as the executor, execution time, execution result, log, etc.

[0039] Memory-based: In order to speed up the operation, the overall resources required by the design are all in memory instead of on the hard drive, thereby speeding up the operation and improving efficiency.

[0040] Multi-layer caching: Currently designed with two layers.

[0041] The first layer is the use case definition type, which is also an object. It is used to describe the basic information of the use case, such as what type of use case it is, the file path, whether it is a shared use case (whether concurrency needs to be considered), and the use case name.

[0042] The second layer consists of automated test case objects, which need to have the required attributes and methods.

[0043] Two topologies are created in memory, and each is stored with the hash value of the test case name as the key. This can speed up the search within a certain space.

[0044] Thirdly, the present invention also provides an electronic device, the electronic device comprising:

[0045] At least one processor; and,

[0046] A memory communicatively connected to the at least one processor; wherein,

[0047] The memory stores computer program instructions that can be executed by at least one processor to enable the at least one processor to perform the method for accelerating automated testing as described in the first aspect.

[0048] Fourthly, the present invention also provides a non-transitory computer-readable storage medium that stores computer instructions that cause the computer to execute the method for accelerating automated testing as described in the first aspect.

[0049] As can be seen from the above technical solutions, the present invention has the following advantages: it transforms the traditional manual testing method into automation, and achieves the configurability of the automated testing process through dynamic configuration of the automated testing process on the client, thus ensuring the dynamism and flexibility of the testing process.

[0050] 1. Firstly, the increased efficiency shortens the testing cycle, allowing products to be brought to market faster. Testing efficiency is improved without increasing testing costs (testing equipment, etc.).

[0051] 2. Because developing automated tests is more convenient and flexible, it is easier to find problems, improve the overall quality of the product, and enhance the product's competitiveness.

[0052] 3. Saves on testing costs, development costs, and labor costs.

[0053] 4. With reasonable design of test case objects, the number of applicable testing scenarios increases.

[0054] 5. It makes it easier for developers to create automated test objects.

[0055] 6. Greater savings in human and testing resources. The number of test machines used in a single project can be reduced, saving testing resources. Shorter testing cycles and rapid automation greatly conserve human resources.

[0056] Furthermore, the design principle of this invention is reliable, the structure is simple, and it has a very wide range of application prospects.

[0057] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description

[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0059] Figure 1 This is a schematic flowchart of a method according to an embodiment of the present invention.

[0060] Figure 2 This is a schematic flowchart of a method according to another embodiment of the present invention.

[0061] Figure 3 This is a schematic block diagram of an apparatus according to an embodiment of the present invention. Detailed Implementation

[0062] Currently, server testing uses simple functional design automated test case models, involves frequent disk interaction, and has limited application scenarios. Traditional automated testing suffers from the following problems: 1. Frequent disk interaction leads to low efficiency. 2. Simple automated test case design limits applicable scenarios. 3. Loading is required when using automated test cases, and test case retrieval is inefficient. 4. Automated test case objects need to be managed manually, resulting in low efficiency and inconvenient development. 5. Lack of application caching and layering prevents maximizing efficiency. Object-Oriented Approach: An automated test case is abstracted into an object. The most important test execution method is essential, along with other attributes such as the executor, execution time, execution result, and logs. Memory-Based Approach: To accelerate execution, all necessary resources are stored in memory rather than on disk, improving speed and efficiency. Multi-Layer Caching: The current design uses two layers. The first layer is the test case definition type, also an object, describing the basic information of the test case, such as its type, file path, whether it's a shared test case (considering concurrency), and test case name. The second layer is the automated test case object, which includes the required attributes and methods. Two topologies are created in memory, each stored with the hash value of the use case name as the key. This speeds up the search within a certain space. To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.

[0063] like Figure 1 As shown, this embodiment of the invention provides a method for accelerating automated testing, comprising the following steps:

[0064] Step 1: Create the runtime environment;

[0065] Step 2: Create two topologies in the runtime environment to store use case objects and use case definition objects respectively;

[0066] Step 3: Execute the runtime environment. During execution, use the test case name to retrieve the test case definition object.

[0067] Step 4: If not affected by concurrency, retrieve the use case object by its name from the topology where use case objects are stored; execute the use case.

[0068] Step 5: If affected by concurrency, retrieve the use case object by the use case name from the topology where the use case definition objects are stored, create the use case object, return the created object, and execute the use case based on the object.

[0069] Object-Oriented: An automated test case is abstracted into an object. The most important part is the test execution method, along with other attributes such as the executor, execution time, execution result, and logs. Memory-Based: To accelerate execution, all resources used are stored in memory rather than on disk, improving speed and efficiency. Multi-Layer Caching: Currently, a two-layer caching design is used. The first layer is the test case definition type, also an object, describing the basic information of the test case, such as its type, file path, whether it's a shared test case (and whether concurrency needs to be considered), and test case name. The second layer is the automated test case object, containing the required attributes and methods. Two topologies are established in memory, storing the test case name as the key, thus speeding up lookups within a limited space.

[0070] like Figure 2 As shown, this embodiment of the invention provides a method for accelerating automated testing, comprising the following steps:

[0071] S1: Design the use case object and the use case definition object; it should be noted that an automated use case test is abstracted into a use case object.

[0072] Design a use case definition object to describe the basic information of use cases; the basic information of a use case includes the type of use case, the file, whether it is a shared use case, and the use case name.

[0073] S2: Create the runtime environment;

[0074] S3: Create two topologies in the runtime environment to store use case objects and use case definition objects respectively;

[0075] S4: Execute the runtime environment. During execution, use the test case name to retrieve the test case definition object; start the runtime environment, scan the corresponding object and add it to the corresponding topology using the hash value of the test case name as the key; during execution, use the test case name to retrieve the test case definition object.

[0076] S5: Determine if concurrency is a factor;

[0077] If not affected by concurrency, proceed to step S6; if affected by concurrency, proceed to step S7.

[0078] S6: Retrieve the use case object by its name from the topology where the use case objects are stored; proceed to step S8.

[0079] S7: Retrieve the use case object by the use case name from the topology where the use case definition objects are stored, create the use case object, return the created object, and execute step S8;

[0080] S8: Execute the test case.

[0081] Object-oriented: Abstract an automated test case into an object. The most important thing is the test execution method, and there are other attributes, such as the executor, execution time, execution result, log, etc.

[0082] Memory-based: In order to speed up the operation, the overall resources required by the design are all in memory instead of on the hard drive, thereby speeding up the operation and improving efficiency.

[0083] Multi-layer caching: Currently designed with two layers.

[0084] The first layer is the use case definition type, which is also an object. It is used to describe the basic information of the use case, such as what type of use case it is, the file path, whether it is a shared use case (whether concurrency needs to be considered), and the use case name.

[0085] The second layer consists of automated test case objects, which need to have the required attributes and methods.

[0086] Two topologies are created in memory, and each is stored with the hash value of the test case name as the key. This can speed up the search within a certain space.

[0087] Design a test case object to abstract an automated test case into an object. The most important part is the test execution method, and other attributes such as the executor, execution time, execution result, and logs are also required. Design a test case definition object to describe the basic information of the test case, such as its type, file path, whether it's a shared test case (whether concurrency needs to be considered), and name. Design a container, which can be understood as a context environment, to create a runtime environment. Create two topologies in the runtime environment to store the test case definition objects and test case objects respectively, storing them using the hash value of the test case name as the key. This speeds up lookups within a certain space. Start the context environment and scan for and add the corresponding objects to the corresponding topology. During execution, retrieve the object using the test case name. Determine if it's affected by concurrency based on the attributes. If not affected, retrieve the test case object by name from the test case topology and execute the test case. If affected, retrieve the corresponding object by name from the test case definition topology, create the object, and return it. Execute the test case based on the object.

[0088] like Figure 3 As shown, this embodiment of the invention provides an apparatus for accelerating automated testing, including an environment creation module, a topology creation module, an environment execution module, and a test case execution module;

[0089] The environment creation module is used to create the runtime environment;

[0090] The topology creation module is used to create two topologies in the runtime environment to store use case objects and use case definition objects respectively;

[0091] The environment execution module is used to execute the runtime environment. During execution, the test case definition object is obtained by using the test case name.

[0092] The test case execution module is used to retrieve test case objects by name from the topology where test case objects are stored, and execute the test cases when not affected by concurrency.

[0093] The device also includes a judgment module and an object processing module;

[0094] The judgment module is used to determine whether concurrency is a factor. If it is not affected by concurrency, the test case execution module is triggered; if it is affected by concurrency, the object processing module is triggered.

[0095] The object processing module is used to retrieve a test case object by the test case name from the topology where test case definition objects are stored, create the test case object, return the created object, and trigger the test case execution module to execute the test case based on the object.

[0096] The device also includes an object design module for designing use case objects and use case definition objects.

[0097] It should be noted that the object design module is specifically used to abstract an automated test case into a test case object; it designs a test case definition object to describe the basic information of the test case; the basic information of the test case includes the test case type, file name, whether it is a shared test case, and test case name.

[0098] The environment execution module is specifically used to start the runtime environment, scan the corresponding objects and add them to the corresponding topology using the hash value of the test case name as the key; during execution, the test case definition object is obtained using the test case name.

[0099] Object-oriented: Abstract an automated test case into an object. The most important thing is the test execution method, and there are other attributes, such as the executor, execution time, execution result, log, etc.

[0100] Memory-based: In order to speed up the operation, the overall resources required by the design are all in memory instead of on the hard drive, thereby speeding up the operation and improving efficiency.

[0101] Multi-layer caching: Currently designed with two layers.

[0102] The first layer is the use case definition type, which is also an object. It is used to describe the basic information of the use case, such as what type of use case it is, the file path, whether it is a shared use case (whether concurrency needs to be considered), and the use case name.

[0103] The second layer consists of automated test case objects, which need to have the required attributes and methods.

[0104] Two topologies are created in memory, and each is stored with the hash value of the test case name as the key. This can speed up the search within a certain space.

[0105] This invention also provides an electronic device, comprising: a processor, a communication interface, a memory, and a bus, wherein the processor, communication interface, and memory communicate with each other via the bus. The bus can be used for information transmission between the electronic device and sensors. The processor can call logical instructions in the memory to execute the following method: Step 1: Create a runtime environment; Step 2: Create two topologies in the runtime environment to store use case objects and use case definition objects respectively; Step 3: Execute the runtime environment, and during execution, retrieve the use case definition object using the use case name; Step 4: If not affected by concurrency, retrieve the use case object from the topology storing the use case objects using the use case name; execute the use case; Step 5: If affected by concurrency, retrieve the use case object from the topology storing the use case definition object using the use case name, create the use case object, return the created object, and execute the use case based on the object.

[0106] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0107] This invention provides a non-transitory computer-readable storage medium storing computer instructions that cause a computer to execute the methods provided in the above-described method embodiments. For example, the methods include: S1: Designing use case objects and use case definition objects; it should be noted that an automated use case test is abstracted into a use case object; designing a use case definition object to describe the basic information of the use case; wherein, the basic information of the use case includes the use case type, file name, whether it is a shared use case, and use case name. S2: Creating a runtime environment; S3: Creating two topologies in the runtime environment to store the use case objects and use case definition objects respectively; S4: Executing the runtime environment, during execution, using the use case name to retrieve the use case definition object; starting the runtime environment, scanning the corresponding object and adding it to the corresponding topology using the hash value of the use case name as the key; during execution, using the use case name to retrieve the use case definition object;

[0108] S5: Determine if concurrency is a factor; if not, proceed to step S6; if affected by concurrency, proceed to step S7. S6: Obtain the use case object by the use case name from the topology where use case objects are stored; proceed to step S8. S7: Obtain the use case object by the use case name from the topology where use case definition objects are stored, create the use case object, and return the created object; proceed to step S8. S8: Execute the use case.

[0109] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention, and such modifications or substitutions should all be within the scope of the invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should also be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.

Claims

1. A method for accelerating the implementation of automated testing, characterized in that, Includes the following steps: Create the runtime environment; Create two topologies in the runtime environment to store use case objects and use case definition objects respectively; The design steps for use case objects and use case definition objects include: abstracting an automated use case test into a use case object; and designing a use case definition object to describe the basic information of the use case. The execution environment is used to retrieve the use case definition object by the use case name during execution. Determine if it is affected by concurrency; When unaffected by concurrency, retrieve the use case object by its name from the topology where use case objects are stored; execute the use case. When affected by concurrency, retrieve the use case object by the use case name from the topology where the use case definition objects are stored, create the use case object, return the created object, and execute the use case based on the object; The steps involved in retrieving the use case definition object by use case name during execution of the runtime environment include: Start the runtime environment and scan the corresponding objects, adding them to the corresponding topology with the hash value of the use case name as the key; During execution, the use case definition object is obtained by using the use case name.

2. The method for accelerating automated testing according to claim 1, characterized in that, The steps to create the runtime environment also include: Design use case objects and use case definition objects.

3. The method for accelerating automated testing according to claim 2, characterized in that, The basic information of a use case includes the type of use case, file path, whether it is a shared use case, and use case name.

4. A device for accelerating automated testing, characterized in that, It includes an environment creation module, a topology creation module, an environment execution module, and a test case execution module; The environment creation module is used to create the runtime environment; The topology creation module is used to create two topologies in the runtime environment to store use case objects and use case definition objects respectively; The design steps for use case objects and use case definition objects include: abstracting an automated use case test into a use case object; and designing a use case definition object to describe the basic information of the use case. The environment execution module is used to execute the runtime environment. During execution, the test case definition object is obtained by using the test case name. The test case execution module is used to retrieve test case objects by name from the topology where test case objects are stored, and execute the test cases, when not affected by concurrency. The device also includes a judgment module and an object processing module; The judgment module is used to determine whether concurrency is a factor. If it is not affected by concurrency, the test case execution module is triggered; if it is affected by concurrency, the object processing module is triggered. The object processing module is used to retrieve a test case object by the test case name from the topology where test case definition objects are stored, create the test case object, return the created object, and trigger the test case execution module to execute the test case based on the object; The execution environment uses the test case name to retrieve the test case definition object during execution, including: Start the runtime environment and scan the corresponding objects, adding them to the corresponding topology with the hash value of the use case name as the key; During execution, the use case definition object is obtained by using the use case name.

5. The apparatus for accelerating automated testing according to claim 4, characterized in that, The device also includes an object design module for designing use case objects and use case definition objects.

6. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions executable by at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method for accelerating automated testing as described in any one of claims 1 to 3.

7. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the method for accelerating automated testing as described in any one of claims 1 to 3.