Software testing method and device

By automatically generating and automatically switching software testing environments, using version number vectors and random combination technology, the problem of inefficient software testing in the existing technology is solved, efficient testing environment management is achieved, and the workload of testers is reduced and the workload of testers is improved. Test efficiency.

CN119201666APending Publication Date: 2024-12-27SHANGHAI INFORMATION IND MANAGEMENT CONSULTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310770290.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the prior art, third-party functional testing in the finished software stage is inefficient due to different environments and development stages. Manually modifying the software environment consumes a lot of work and cannot fully improve the efficiency of the test.

Method used

By reading the running environment information of the software to be tested, multiple test environments are automatically generated, and the next environment is automatically loaded after one environment test is completed. The test environment is generated using version number vector and random combination technology to reduce manual intervention.

Benefits of technology

It significantly reduces the workload of testers, improves the efficiency of software testing, and improves the efficiency of version number screening through unique version number expression, reduces the workload of test when there are many versions, while maintaining test representativeness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201666A_ABST
    Figure CN119201666A_ABST
Patent Text Reader

Abstract

The invention relates to a software testing method and device. The method comprises the steps that S1, operation environment information of software to be tested is read; s2, obtaining a plurality of test environments based on the operation environment information; s3, reading a first test environment, and deploying the test environment and the to-be-tested software; s3, prompting to carry out software testing, judging whether traversing of all the testing environments is completed or not after receiving a software testing completion instruction, if yes, completing the testing, and if not, executing the step S4, reading the next testing environment, deploying the testing environment and the to-be-tested software, and returning to the step S3. Compared with the prior art, a plurality of test environments are automatically generated through the operation environment information of the to-be-tested software, and the next environment is automatically loaded after the test of one environment is finished, so that the workload of testers can be greatly reduced, and the test efficiency of the software is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to software testing automation technology, and in particular to a software testing method and device. Background Art

[0002] The software industry often has to go through multiple rounds of testing after the software is developed, including testing in the development phase and third-party functional testing in the finished product phase. The third-party functional testing in the finished product phase can detect more problems because its environment is different from that in the development phase.

[0003] In order to improve the adequacy of the test, in the prior art, for third-party functional testing of the finished software, a large number of virtual machines are deployed on the testing computers to simulate various environments, and different software environments can be simulated for testing. However, in the prior art, the software environment is usually modified manually to test the software to be tested, which is inefficient. Secondly, manual switching will also lead to excessive workload for testers. Summary of the invention

[0004] The purpose of the present invention is to provide a software testing method and device, which automatically generates multiple test environments through the operating environment information of the software to be tested, and automatically loads the next environment after the test of one environment is completed, which can greatly reduce the workload of testers and improve the testing efficiency of software.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] A software testing method, comprising:

[0007] Step S1: Read the operating environment information of the software to be tested;

[0008] Step S2: obtaining multiple test environments based on the operating environment information;

[0009] Step S3: read the first test environment, and deploy the test environment and the software to be tested;

[0010] Step S4: Prompt to perform software testing, and after receiving the software test completion instruction, determine whether the traversal of all test environments is completed. If yes, the test is completed. Otherwise, execute step S5:

[0011] Step S5: read the next test environment, deploy the test environment and the software to be tested, and return to step S4.

[0012] The step S2 specifically includes:

[0013] Step S21: extracting the fields of each environment software in the operating environment information, and parsing to obtain the full name and version number vector of each environment software, wherein the full name and version number vector of the environment software constitute the attribute information of the environment;

[0014] Step S22: Based on the attribute information of each environment software and based on the test environment library, one or more software versions to be deployed are obtained for each environment software;

[0015] Step S23: Based on the to-be-deployed software versions corresponding to the software in each environment, a plurality of test environments are randomly combined.

[0016] The version number vector is a multi-dimensional vector, and its generation process is as follows:

[0017] Step S211: determine whether the version number in the field of the environment software contains a pre-configured characteristic character for representing the interval range. If yes, execute step S212; otherwise, execute step S213;

[0018] Step S212: Generate a version number vector based on the end value of the interval;

[0019] Step S213: Generate a version number vector based on all the version numbers that appear.

[0020] The step S213 specifically includes: taking all the appearing version numbers as an element of the version number vector to generate a version number vector.

[0021] The step S212 specifically includes:

[0022] Step S2121: sort the end values ​​of all intervals from small to large;

[0023] Step S2122: Add a first marking symbol between two end values ​​corresponding to the same interval, and add a second marking symbol between two end values ​​corresponding to different intervals. If the interval corresponding to the last end value is a ray interval, add the first marking symbol after the last end value to obtain a version number sequence;

[0024] Step S2123: Use the obtained version number sequence as a version number vector.

[0025] A software testing device comprises a memory, a processor, and a program stored in the memory, wherein the processor implements the following steps when executing the program:

[0026] Step S1: Read the operating environment information of the software to be tested;

[0027] Step S2: obtaining multiple test environments based on the operating environment information;

[0028] Step S3: read the first test environment, and deploy the test environment and the software to be tested;

[0029] Step S4: Prompt to perform software testing, and after receiving the software test completion instruction, determine whether the traversal of all test environments is completed. If yes, the test is completed. Otherwise, execute step S5:

[0030] Step S5: read the next test environment, deploy the test environment and the software to be tested, and return to step S4.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] 1. Automatically generate multiple test environments based on the running environment information of the software to be tested, and automatically load the next environment after the test in one environment is completed, which can greatly reduce the workload of testers and improve the testing efficiency of the software.

[0033] 2. Determine the software version to be deployed based on the expression of the version number vector, and use a uniquely designed version number vector format to improve the efficiency of version number screening.

[0034] 3. Generate multiple test environments by random combination, which can reduce the workload of testing without reducing representativeness when there are too many versions. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 The figure is a schematic flow chart of the main steps of the method of the present invention. DETAILED DESCRIPTION

[0036] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0037] A software testing method such as Figure 1 As shown, including:

[0038] Step S1: Read the operating environment information of the software to be tested. For each software to be tested, a test entrustment form will be filled in, and the operating environment of the software will be recorded in the entrustment form. Generally, for special software, the application environment filled in is relatively simple, often only a simple specific environment, but in some cases, more environments will be filled in, so that the compatibility of the software can be tested;

[0039] For example, the common ways to fill in the operating environment in the test entrustment table are:

[0040] 1) "software 11.0 / 12.0" means only software 11.0 and software 12.0 are supported

[0041] 2) "software 11.0 and above", or "software 11.0 and above", means software 11.0 and later versions are acceptable. Although "above" and "and above" have different meanings in strict terms, the actual meaning intended by the person filling out the form is the same.

[0042] 3) "software 11.0~software 13.4", or "software 11.0-software 13.4", there are two symbols, - and ~, which have the same meaning, both to, which means that the versions in this range can be in this way of expression. There may be multiple ranges, for example, "software 11.0~software 13.4, software14.0~software 15.3".

[0043] Step S2: Based on the operating environment information, multiple test environments are obtained, specifically including:

[0044] Step S21: extracting the fields of each environment software in the running environment information, and parsing to obtain the full name and version number vector of each environment software, wherein the full name and version number vector of the environment software constitute the attribute information of the environment;

[0045] The version number vector is a multidimensional vector, and its generation process is as follows:

[0046] Step S211: determine whether the version number in the field of the environment software contains a pre-configured characteristic character for representing the interval range. If yes, execute step S212; otherwise, execute step S213;

[0047] Among them, the preconfigured characteristic characters used to represent the interval range are the above-mentioned “and above”, “above”, “~” and “-”.

[0048] Step S212: Generate a version number vector based on the end value of the interval, specifically including:

[0049] Step S2121: sort the end values ​​of all intervals from small to large;

[0050] Step S2122: Add a first marking symbol between two end values ​​corresponding to the same interval, and add a second marking symbol between two end values ​​corresponding to different intervals. If the interval corresponding to the last end value is a ray interval, add the first marking symbol after the last end value to obtain a version number sequence;

[0051] Among them, taking "software 11.0~software 13.4, software 14.0~software 15.3" as an example, there are four end values ​​11.0, 13.4, 14.0 and 15.3. After sorting, a first mark symbol is added between 11.0 and 13.4, 14.0 and 15.3, and a second mark symbol is added between 13.4 and 14.0. In this embodiment, the first mark symbol can be the number 1, and the second mark symbol can be the number 0. Finally, the following version number sequence is obtained: {11.0, 1, 13.4, 0, 14.0, 1, 15.3};

[0052] In addition, taking "software 11.0 and above" as an example, it has one end value 11.0, but this end value is the end value of the ray interval, so it is necessary to add the first marker symbol after the end value, and finally obtain the following version number sequence: {11.0, 1};

[0053] Step S2123: Use the obtained version number sequence as a version number vector.

[0054] Step S213: Generate a version number vector based on all the version numbers that appear, specifically: take all the version numbers that appear as an element of the version number vector to generate a version number vector. For example, "software11.0 / 12.0" has two version numbers 11.0 and 12.0, so the version number vector directly obtained is {11.0, 12.0}

[0055] Step S22: Based on the attribute information of each environment software and based on the test environment library, one or more software versions to be deployed are obtained for each environment software;

[0056] Specifically, this process is to select all versions that belong to the version number range.

[0057] Step S23: Based on the to-be-deployed software versions corresponding to the software in each environment, a plurality of test environments are randomly combined.

[0058] In some embodiments, the process can use full combination, so that the most accurate test results can be obtained. However, in some cases, there are too many full combination methods. Therefore, in this embodiment, a set number of test environments can be obtained by random combination. Using random combination to generate multiple test environments can reduce the workload of testing without reducing representativeness when the number of versions is too large.

[0059] Step S3: read the first test environment, and deploy the test environment and the software to be tested;

[0060] Step S4: Prompt to perform software testing, and after receiving the software test completion instruction, determine whether the traversal of all test environments is completed. If yes, the test is completed. Otherwise, execute step S5:

[0061] Step S5: read the next test environment, deploy the test environment and the software to be tested, and return to step S4.

[0062] If the above functions are implemented in the form of software functional units and sold or used as independent products, they 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 the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

Claims

1. A software testing method, characterized in that: include: Step S1: Read the operating environment information of the software to be tested; Step S2: obtaining multiple test environments based on the operating environment information; Step S3: read the first test environment, and deploy the test environment and the software to be tested; Step S4: Prompt to perform software testing, and after receiving the software test completion instruction, determine whether the traversal of all test environments is completed. If yes, the test is completed. Otherwise, execute step S5: Step S5: read the next test environment, deploy the test environment and the software to be tested, and return to step S4.

2. A software testing method according to claim 1, characterized in that: The step S2 specifically includes: Step S21: extracting the fields of each environment software in the operating environment information, and parsing to obtain the full name and version number vector of each environment software, wherein the full name and version number vector of the environment software constitute the attribute information of the environment; Step S22: Based on the attribute information of each environment software and based on the test environment library, one or more software versions to be deployed are obtained for each environment software; Step S23: Based on the to-be-deployed software versions corresponding to the software in each environment, a plurality of test environments are randomly combined.

3. A software testing method according to claim 2, characterized in that: The version number vector is a multi-dimensional vector, and its generation process is as follows: Step S211: determine whether the version number in the field of the environment software contains a pre-configured characteristic character for representing the interval range. If yes, execute step S212; otherwise, execute step S213; Step S212: Generate a version number vector based on the end value of the interval; Step S213: Generate a version number vector based on all the version numbers that appear.

4. A software testing method according to claim 3, characterized in that: The step S213 specifically includes: taking all the appearing version numbers as an element of the version number vector to generate a version number vector.

5. A software testing method according to claim 3, characterized in that: The step S212 specifically includes: Step S2121: sort the end values ​​of all intervals from small to large; Step S2122: Add a first marking symbol between two end values ​​corresponding to the same interval, and add a second marking symbol between two end values ​​corresponding to different intervals. If the interval corresponding to the last end value is a ray interval, add the first marking symbol after the last end value to obtain a version number sequence; Step S2123: Use the obtained version number sequence as a version number vector.

6. A software testing device, comprising a memory, a processor, and a program stored in the memory, characterized in that: When the processor executes the program, the following steps are implemented: Step S1: Read the operating environment information of the software to be tested; Step S2: obtaining multiple test environments based on the operating environment information; Step S3: read the first test environment, and deploy the test environment and the software to be tested; Step S4: Prompt to perform software testing, and after receiving the software test completion instruction, determine whether the traversal of all test environments is completed. If yes, the test is completed. Otherwise, execute step S5: Step S5: read the next test environment, deploy the test environment and the software to be tested, and return to step S4.

7. The device according to claim 6, characterized in that The step S2 specifically includes: Step S21: extracting the fields of each environment software in the operating environment information, and parsing to obtain the full name and version number vector of each environment software, wherein the full name and version number vector of the environment software constitute the attribute information of the environment; Step S22: Based on the attribute information of each environment software and based on the test environment library, one or more software versions to be deployed are obtained for each environment software; Step S23: Based on the to-be-deployed software versions corresponding to the software in each environment, a plurality of test environments are randomly combined.

8. The device according to claim 7, characterized in that The version number vector is a multi-dimensional vector, and its generation process is as follows: Step S211: determine whether the version number in the field of the environment software contains a pre-configured characteristic character for representing the interval range. If yes, execute step S212; otherwise, execute step S213; Step S212: Generate a version number vector based on the end value of the interval; Step S213: Generate a version number vector based on all the version numbers that appear.

9. The device according to claim 8, characterized in that The step S213 specifically includes: taking all the appearing version numbers as an element of the version number vector to generate a version number vector.

10. The device according to claim 3, characterized in that The step S212 specifically includes: Step S2121: sort the end values ​​of all intervals from small to large; Step S2122: Add a first marking symbol between two end values ​​corresponding to the same interval, and add a second marking symbol between two end values ​​corresponding to different intervals. If the interval corresponding to the last end value is a ray interval, add the first marking symbol after the last end value to obtain a version number sequence; Step S2123: Use the obtained version number sequence as a version number vector.