Software testing method, device, computer equipment and storage medium

By building an integrated testing framework, using test case templates and code modification instructions to generate and debug code files, the problem of inefficient acceptance and testing of big data platform products is solved, and an efficient automated testing process is realized, ensuring the stable delivery of platform products.

CN114564385BActive Publication Date: 2025-08-05INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210107231.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2025-08-05
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

The acceptance and testing of big data platform products in the prior art is inefficient and lacks a complete testing framework system, which leads to cumbersome and time-consuming and labor-intensive testing process.

Method used

By obtaining the associated data of the platform product, an integrated testing framework is built, a preset test case template is used to create test cases, and a code modification instruction is obtained according to the platform functions, a code is generated and debugged code files, and finally a periodic automated test is carried out in the test framework.

Benefits of technology

It simplifies the installation, deployment and testing process of platform products, reduces testing time, improves testing efficiency, and ensures the stable and efficient delivery of platform products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114564385B_ABST
    Figure CN114564385B_ABST
Patent Text Reader

Abstract

The present application relates to a software testing method, apparatus, computer equipment and storage medium. The method comprises: obtaining the associated data of the platform product to be tested, storing each associated data in a test framework; creating a test case according to a preset test case template and the platform product, converting the test case into code, and obtaining a first code file; obtaining a code modification instruction according to the function of the platform product, modifying the first code file according to the code modification instruction, obtaining a second code file, and storing the second code file in the test framework; obtaining a periodic test task, running the second code file according to the test task, so as to test the test case in the test framework and obtain a test report. The present method simplifies the platform product installation process and the test process by using an integrated test framework, reduces the test time, and improves the test efficiency, thereby ensuring the stable and efficient delivery of the platform product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to a software testing method, apparatus, computer equipment, and storage medium. Background Art

[0002] At present, big data technology has penetrated into all areas of society. The broad application prospects of big data have also stimulated the development of big data service providers. Big data platform products based on open source projects such as Hadoop and Spark are also constantly iterating and upgrading, which puts more requirements on the testing and delivery of different versions of platform products.

[0003] Platform products often integrate multiple functional services. During the delivery process of platform products, too much time and energy will be consumed in tedious manual testing. In addition, there is no complete testing framework system for the construction of the platform product testing system, which cannot meet the requirements of the platform product testing system. How to efficiently implement the acceptance test of platform products has also become a major problem. Summary of the Invention

[0004] Based on this, a software testing method, apparatus, computer equipment and storage medium are provided to solve the problem of low efficiency in platform product acceptance testing in the prior art.

[0005] In one aspect, a software testing method is provided, comprising:

[0006] Obtaining relevant data of the platform product to be tested, and storing each relevant data in the test framework;

[0007] Creating a test case according to a preset test case template and the platform product, and converting the test case into code to obtain a first code file;

[0008] Acquire a code modification instruction according to the function of the platform product, modify the first code file according to the code modification instruction to obtain a second code file, and store the second code file in the test framework;

[0009] A periodic test task is obtained, and the second code file is run according to the test task to test the test case in the test framework and obtain a test report.

[0010] In one embodiment, a test case is created according to a preset test case template and the platform product, and the test case is converted into code to obtain a first code file, including:

[0011] According to the test case, fields are created in a standard format, and the fields are added to a preset code template accordingly to obtain a first code file, wherein the fields include at least one of the following: use case name, test steps, expected test results, and use case author.

[0012] In one embodiment, modifying the first code file according to the code modification instruction to obtain the second code file includes:

[0013] acquiring first code data according to the first code file;

[0014] Second code data for implementing each test step is added to the first code data to obtain a second code file.

[0015] In one embodiment, after obtaining the second code file, the method further includes:

[0016] Debugging the second code file, wherein the debugging process includes: running the second code file in the test framework and detecting whether there are errors in the running process;

[0017] If so, output an error message, determine the cause of the error based on the error message, and correct the error;

[0018] If not, save the second code file.

[0019] In one embodiment, before obtaining the associated data of the platform product to be tested, the method further includes:

[0020] Obtain cluster parameters, create a virtual machine for running the platform product based on the cluster parameters, and install the corresponding operating system based on the cluster parameters to complete the configuration of the operating environment of the platform product, wherein the cluster parameters include at least one of the following: the number of nodes to be tested, the number of clusters to be tested, the correspondence between the clusters to be tested and the nodes to be tested, and the type of the cluster to be tested.

[0021] In one embodiment, the method further includes installing a corresponding operating system according to the cluster parameters:

[0022] Obtaining an installation program based on the version information of the platform product;

[0023] The platform product is installed by running the installation program, a configuration file of the cluster to be tested is obtained, and components for supporting the functions of the platform product are installed in the cluster to be tested according to the configuration file.

[0024] In one embodiment, obtaining a periodic test task includes:

[0025] Creating a baseline library for managing the test cases, and recording the test cases in the test task in the baseline library according to corresponding periods, wherein the data recorded in the baseline library also includes the number of the test cases and the number of test cases that have passed the second code file test;

[0026] The test efficiency of the second code file in the test framework is calculated according to the number of the test cases and the number of test cases tested by the second code file.

[0027] In another aspect, a software testing device is provided, comprising:

[0028] A construction module is used to obtain the associated data of the platform product to be tested, and store each of the associated data in the test framework;

[0029] A conversion module, configured to create a test case according to a preset test case template and the platform product, and perform code conversion on the test case to obtain a first code file;

[0030] a modification module, configured to obtain a code modification instruction according to the function of the platform product, modify the first code file according to the code modification instruction to obtain a second code file, and store the second code file in the test framework;

[0031] The test module is used to obtain periodic test tasks, run the second code file according to the test tasks, test the test cases in the test framework, and obtain a test report.

[0032] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

[0033] Obtaining relevant data of the platform product to be tested, and storing each relevant data in the test framework;

[0034] Creating a test case according to a preset test case template and the platform product, and converting the test case into code to obtain a first code file;

[0035] Acquire a code modification instruction according to the function of the platform product, modify the first code file according to the code modification instruction to obtain a second code file, and store the second code file in the test framework;

[0036] A periodic test task is obtained, and the second code file is run according to the test task to test the test case in the test framework and obtain a test report.

[0037] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0038] Obtaining relevant data of the platform product to be tested, and storing each relevant data in the test framework;

[0039] Creating a test case according to a preset test case template and the platform product, and converting the test case into code to obtain a first code file;

[0040] Acquire a code modification instruction according to the function of the platform product, modify the first code file according to the code modification instruction to obtain a second code file, and store the second code file in the test framework;

[0041] A periodic test task is obtained, and the second code file is run according to the test task to test the test case in the test framework and obtain a test report.

[0042] The above-mentioned software testing method, device, computer equipment and storage medium, by obtaining the associated data of the platform product to be tested, and storing each of the associated data separately in the test framework, construct an integrated testing method; by creating a test case according to a preset test case template and the platform product, the test case is converted into code to obtain a first code file, thereby reducing the tedious process of manually executing the test case; by obtaining code modification instructions according to the function of the platform product, modifying the first code file according to the code modification instructions to obtain a second code file, and storing the second code file in the test framework, the test framework is adaptively improved; by obtaining periodic test tasks, running the second code file according to the test tasks to test the test case in the test framework, obtaining a test report, and reducing a large amount of time consumed by manual testing. Through the above-mentioned software testing method, the integrated testing framework is used to simplify the tedious processes of manual installation and deployment of platform products, manual execution of tests and recording of test results, etc., reduce testing time, improve testing efficiency, and thus ensure the stable and efficient delivery of platform products. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 An application environment diagram of a software testing method in one embodiment;

[0044] Figure 2 1 is a flowchart of a software testing method according to an embodiment;

[0045] Figure 3 A schematic diagram of a process for debugging a second code file in one embodiment;

[0046] Figure 4 A schematic diagram of the process of configuring the operating environment and installing the platform product in one embodiment;

[0047] Figure 5 is a structural block diagram of a software testing device in one embodiment;

[0048] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0050] At present, platform products often integrate multiple services. During the delivery of platform products, too much time and energy will be spent on tedious manual testing. In addition, there is no complete testing framework system for the construction of the testing system of platform products, which cannot meet the needs of the testing system of platform products. How to efficiently implement the acceptance test of platform products has also become a major problem. The software testing method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. By obtaining the relevant data of the platform product to be tested, creating test cases according to the preset test case template and the platform product, obtaining and improving the code files used to implement the test functions, an integrated test framework is constructed to perform periodic automated testing on the platform software. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented as an independent server or a server cluster composed of multiple servers. The network communication method can be but is not limited to a link method such as a local area network or the Internet.

[0051] In one embodiment, Figure 2 As shown, a software testing method is provided, which is applied to Figure 1 The following steps are used to illustrate how a terminal in the example above initiates a test to a server cluster:

[0052] Step S1: Obtain relevant data of the platform product to be tested, and store each piece of relevant data in the test framework.

[0053] Among them, the associated data includes: cluster configuration information, related test data, and function methods used to support test functions. It should be noted that the test framework has multiple directories for storing data, including: configuration file directory, data file directory, keyword directory, test case directory and test report generation directory.

[0054] Specifically, after obtaining the associated data of the platform product to be tested, the associated data is stored in the corresponding directory of the test framework. For example, the configuration information of the cluster is stored in the configuration file directory, the relevant test data is stored in the data file directory, and the function methods used to support the test function are classified according to the keyword type and stored in the keyword directory. It should be noted that different function methods include different keywords, so the function methods can be classified according to the type of keyword. For example, according to the keyword type, the function methods can be divided into Secure Shell Protocol (SSH), Application Programming Interface (API), User Interface (UI), and Sample (Demo). Through structured classification management, the test framework is easy to maintain.

[0055] Step S2: Create a test case according to a preset test case template and the platform product, and convert the test case into code to obtain a first code file.

[0056] Among them, a test case refers to a description of the test task for the platform product, reflecting the test plan, method, technology and strategy. During the testing process, the test case is executed to determine whether the platform product meets specific requirements.

[0057] Specifically, a test case template is pre-set, and the relevant information of the platform product is filled into the test case template to obtain a test case. According to the identifier in the test case, the data in the test case is filled into the corresponding code template to obtain a first code file.

[0058] Step S3: Obtain code modification instructions according to the function of the platform product, modify the first code file according to the code modification instructions to obtain a second code file, and store the second code file in the test framework.

[0059] The code modification instructions include but are not limited to: adding, deleting and modifying, and the first code file includes but is not limited to: data corresponding to the test case and basic execution logic.

[0060] Specifically, in the test framework, a corresponding test case directory is created according to different test cases, and each test case is corresponded to the work number of the responsible person, and the code modification instructions are obtained. The function code to be implemented is modified in the first code file. This can be done by adding code instructions. In the first code file, the function code to be implemented is added so that the data corresponding to the test case, the basic execution logic and the function code to be implemented are interconnected to ensure the correct execution and / or judgment of the function. The second code file is also encapsulated according to the test framework, and the second code file is stored in the test framework.

[0061] Step S4: Obtain a periodic test task, run the second code file according to the test task, test the test case in the test framework, and obtain a test report.

[0062] Among them, the testing tasks include the planning and implementation of testing plans for platform products.

[0063] Specifically, according to the test task, the second code file is run in the test framework, the test case is tested, and a test report is generated according to the test result.

[0064] For example, the testing task may be performed by a continuous integration (CI) platform. Continuous integration is a software development practice that can verify software through automated builds. The automated build process includes compilation, release, and automated testing.

[0065] According to the test task, a test project is created in the CI platform, and the test framework and other data are uploaded to the CI platform. The CI platform periodically executes the test task through the test framework. Taking the ITMS platform as an example, a test project is created in the platform, and a test case matrix table is configured according to the test cases to be executed. The test case matrix table matches the second code file, thereby ensuring that the test cases to be executed match the second code file.

[0066] In the above software testing method, an integrated testing method is constructed by obtaining the associated data of the platform product to be tested and storing each of the associated data in the test framework respectively; by creating a test case according to a preset test case template and the platform product, the test case is converted into code to obtain a first code file, thereby reducing the tedious process of manually executing the test case; by obtaining code modification instructions according to the function of the platform product, modifying the first code file according to the code modification instructions to obtain a second code file, and storing the second code file in the test framework, the test framework is adaptively improved; by obtaining periodic test tasks, running the second code file according to the test tasks to test the test case in the test framework, obtaining a test report, and reducing a large amount of time consumed by manual testing. Through the above software testing method, the integrated testing framework is used to simplify the tedious processes of manual installation and deployment of platform products, manual execution of tests, and recording of test results, thereby reducing testing time and improving testing efficiency, thereby ensuring the stable and efficient delivery of platform products.

[0067] In one embodiment, a test case is created according to a preset test case template and the platform product, and the test case is converted into code to obtain a first code file, including:

[0068] According to the test case, fields are created in a standard format, and the fields are added to a preset code template accordingly to obtain a first code file, wherein the fields include at least one of the following: use case name, test steps, expected test results, and use case author.

[0069] It should be noted that corresponding data can be added to the field to complete the creation of the field, thereby obtaining a test case. The field is used as an identifier, the data in the field is converted into a data type, and then added to the preset code template accordingly to obtain the first code file.

[0070] To illustrate this, when testing in a Java programming environment, the above conversion process can be built into a conversion tool to form a Java Archive File (JAR), i.e., a JAR package. The test cases are converted through the JAR package of the conversion tool, thereby improving the efficiency of the conversion process.

[0071] In one embodiment, modifying the first code file according to the code modification instruction to obtain the second code file includes:

[0072] acquiring first code data according to the first code file;

[0073] Second code data for implementing each test step is added to the first code data to obtain a second code file.

[0074] It should be noted that the first code file includes first code data, which is converted through fields. The first code data includes: data corresponding to each field and basic execution logic. It can be understood that the first code data with only basic execution logic cannot fully realize the test function. Therefore, the second code data for realizing the complete test function can be added to the first code data to obtain the second code file. The platform product can be fully tested by running the second code file in the test framework.

[0075] In one embodiment, after obtaining the second code file, the method further includes:

[0076] Debugging the second code file, wherein the debugging process includes: running the second code file in the test framework and detecting whether there are errors in the running process;

[0077] If so, output an error message, determine the cause of the error based on the error message, and correct the error;

[0078] If not, save the second code file.

[0079] It is understandable that, in order to ensure stability during the test, after obtaining the second code file, the second code file should be debugged to detect whether there are any errors in the second code file during its operation.

[0080] Specifically, if Figure 3 As shown, Figure 3 A schematic diagram of a process for debugging a second code file in one embodiment is shown, wherein the second code file is run in the test framework to detect whether there are errors during the running process;

[0081] If so, output an error message, determine the cause of the error based on the error message, and correct the error;

[0082] If not, save the second code file.

[0083] It should be noted that the error correction is completed only when no error message is reported when the corrected second code file is run. Otherwise, the second code file should continue to be debugged and corrected.

[0084] In one embodiment, before obtaining the associated data of the platform product to be tested, the method further includes:

[0085] Obtain cluster parameters, create a virtual machine for running the platform product based on the cluster parameters, and install the corresponding operating system based on the cluster parameters to complete the configuration of the operating environment of the platform product, wherein the cluster parameters include at least one of the following: the number of nodes to be tested, the number of clusters to be tested, the correspondence between the clusters to be tested and the nodes to be tested, and the type of the cluster to be tested.

[0086] It is understandable that before testing a platform product, a test environment suitable for the platform product should be prepared and cluster parameters should be obtained. The cluster parameters include: the number of nodes to be tested, the number of clusters to be tested, the correspondence between the clusters to be tested and the nodes to be tested, and the type of the cluster to be tested. Among them, the correspondence between the clusters to be tested and the nodes to be tested mainly includes how many nodes each cluster corresponds to.

[0087] Create a virtual machine for testing platform products based on cluster parameters. A virtual machine is a complete computer system with complete hardware system functions, running in a completely isolated environment, simulated by software. Depending on the type of cluster under test, install different operating systems in the virtual machine, such as Red Hat and CentOS. Then check the current test environment to ensure that the test environment is configured correctly.

[0088] In one embodiment, the method further includes installing a corresponding operating system according to the cluster parameters:

[0089] Obtaining an installation program based on the version information of the platform product;

[0090] The platform product is installed by running the installation program, a configuration file of the cluster to be tested is obtained, and components for supporting the functions of the platform product are installed in the cluster to be tested according to the configuration file.

[0091] It is understandable that before testing the platform product, the platform product should be installed and deployed, and the corresponding installation program should be obtained according to the version information of the platform product so that this testing method is applicable to testing multiple platform products. After the platform product is successfully installed, the configuration file of the cluster to be tested is obtained, and the components used to support the functions of the platform product are installed in the cluster to be tested so that each cluster can support the functions of the platform product, and a test is initiated to the corresponding cluster during the test process.

[0092] For example, Figure 4 As shown, Figure 4 This is a flowchart of configuring an operating environment and installing a platform product in an embodiment, and the two embodiments of configuring an operating environment and installing a platform product are illustrated by this flowchart.

[0093] Combining the above embodiments with Figure 4 It is understandable that before obtaining the associated data of the platform product to be tested, the process of configuring the operating environment and installing the platform product is also included.

[0094] Step 401: Obtain cluster parameters, create a virtual machine for running the platform product according to the cluster parameters, and install the corresponding operating system according to the cluster parameters;

[0095] Step 402: Obtain an installation program based on the version information of the platform product, and install the platform product by running the installation program;

[0096] Step 403: Obtain a configuration file of the cluster to be tested, and install components for supporting the platform product functions in the cluster to be tested according to the configuration file.

[0097] In one embodiment, obtaining a periodic test task includes:

[0098] Creating a baseline library for managing the test cases, and recording the test cases in the test task in the baseline library according to corresponding periods, wherein the data recorded in the baseline library also includes the number of the test cases and the number of test cases that have passed the second code file test;

[0099] The test efficiency of the second code file in the test framework is calculated according to the number of the test cases and the number of test cases tested by the second code file.

[0100] Among them, the baseline library is a storage warehouse composed of baselines of the same category. The baseline refers to a snapshot of each version of the product at a specific period. It provides a formal standard. Subsequent work will be based on this standard, and this standard can only be changed after authorization. After an initial baseline is established, each subsequent change to it will be recorded as a difference until the next baseline is built. By establishing a baseline, the record of each work content can be tracked and kept synchronized with changes in the project.

[0101] It is understandable that by establishing a baseline library, the test cases in each released test task are recorded in the baseline library according to the execution cycle, which facilitates the subsequent management of each test case.

[0102] It should also be noted that the number of test cases recorded in the baseline library refers to the total number of test cases after the test task is released. The total number of test cases is matched with the number of test cases after passing the second code file test, and the pass rate of the test cases tested by the second code file is calculated. In this way, the overall automation test implementation rate and test quality under this test framework can be understood.

[0103] It should be understood that although Figure 2-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2-4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0104] In one embodiment, Figure 5 As shown, a software testing device is provided, comprising: a construction module, a conversion module, a modification module and a testing module, wherein:

[0105] A construction module is used to obtain the associated data of the platform product to be tested, and store each of the associated data in the test framework;

[0106] A conversion module, configured to create a test case according to a preset test case template and the platform product, and perform code conversion on the test case to obtain a first code file;

[0107] a modification module, configured to obtain a code modification instruction according to the function of the platform product, modify the first code file from the conversion module according to the code modification instruction to obtain a second code file, and store the second code file in the test framework constructed by the construction module;

[0108] A test module is used to obtain periodic test tasks, run the second code file from the modification module according to the test tasks, so as to test the test case in the test framework constructed by the construction module, and obtain a test report issued by the test module after the test case is tested.

[0109] In one embodiment, the method includes:

[0110] According to the test case, fields are created in a standard format, and the fields are added to a preset code template accordingly to obtain a first code file, wherein the fields include at least one of the following: use case name, test steps, expected test results, and use case author.

[0111] In one embodiment, the method includes:

[0112] acquiring first code data according to the first code file;

[0113] Second code data for implementing each test step is added to the first code data to obtain a second code file.

[0114] In one embodiment, it further includes:

[0115] Debugging the second code file, wherein the debugging process includes: running the second code file in the test framework and detecting whether there are errors in the running process;

[0116] If so, output an error message, determine the cause of the error based on the error message, and correct the error;

[0117] If not, save the second code file.

[0118] In one embodiment, it further includes:

[0119] The construction module is also used to obtain cluster parameters, create a virtual machine for running the platform product according to the cluster parameters, and install the corresponding operating system according to the cluster parameters to complete the configuration of the operating environment of the platform product, wherein the cluster parameters include at least one of the following: the number of nodes to be tested, the number of clusters to be tested, the correspondence between the clusters to be tested and the nodes to be tested, and the type of the cluster to be tested.

[0120] In one embodiment, it further includes:

[0121] The construction module is further used to obtain an installation program according to the version information of the platform product;

[0122] The platform product is installed by running the installation program, a configuration file of the cluster to be tested is obtained, and components for supporting the functions of the platform product are installed in the cluster to be tested according to the configuration file.

[0123] In one embodiment, the method includes:

[0124] Creating a baseline library for managing the test cases, and recording the test cases in the test task in the baseline library according to corresponding periods, wherein the data recorded in the baseline library also includes the number of the test cases and the number of test cases that have passed the second code file test;

[0125] The test efficiency of the second code file in the test framework is calculated according to the number of the test cases and the number of test cases tested by the second code file.

[0126] For the specific definition of the software testing device, please refer to the definition of the software testing method above, and will not be repeated here. Each module in the above-mentioned software testing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0127] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store test-related data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a software testing method is implemented.

[0128] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0129] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:

[0130] Obtaining relevant data of the platform product to be tested, and storing each relevant data in the test framework;

[0131] Creating a test case according to a preset test case template and the platform product, and converting the test case into code to obtain a first code file;

[0132] Acquire a code modification instruction according to the function of the platform product, modify the first code file according to the code modification instruction to obtain a second code file, and store the second code file in the test framework;

[0133] A periodic test task is obtained, and the second code file is run according to the test task to test the test case in the test framework and obtain a test report.

[0134] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0135] According to the test case, fields are created in a standard format, and the fields are added to a preset code template accordingly to obtain a first code file, wherein the fields include at least one of the following: use case name, test steps, expected test results, and use case author.

[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0137] acquiring first code data according to the first code file;

[0138] Second code data for implementing each test step is added to the first code data to obtain a second code file.

[0139] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0140] Debugging the second code file, wherein the debugging process includes: running the second code file in the test framework and detecting whether there are errors in the running process;

[0141] If so, output an error message, determine the cause of the error based on the error message, and correct the error;

[0142] If not, save the second code file.

[0143] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0144] Obtain cluster parameters, create a virtual machine for running the platform product based on the cluster parameters, and install the corresponding operating system based on the cluster parameters to complete the configuration of the operating environment of the platform product, wherein the cluster parameters include at least one of the following: the number of nodes to be tested, the number of clusters to be tested, the correspondence between the clusters to be tested and the nodes to be tested, and the type of the cluster to be tested.

[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0146] Obtaining an installation program based on the version information of the platform product;

[0147] The platform product is installed by running the installation program, a configuration file of the cluster to be tested is obtained, and components for supporting the functions of the platform product are installed in the cluster to be tested according to the configuration file.

[0148] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0149] Creating a baseline library for managing the test cases, and recording the test cases in the test task in the baseline library according to corresponding periods, wherein the data recorded in the baseline library also includes the number of the test cases and the number of test cases that have passed the second code file test;

[0150] The test efficiency of the second code file in the test framework is calculated according to the number of the test cases and the number of test cases tested by the second code file.

[0151] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0152] Obtaining relevant data of the platform product to be tested, and storing each relevant data in the test framework;

[0153] Creating a test case according to a preset test case template and the platform product, and converting the test case into code to obtain a first code file;

[0154] Acquire a code modification instruction according to the function of the platform product, modify the first code file according to the code modification instruction to obtain a second code file, and store the second code file in the test framework;

[0155] A periodic test task is obtained, and the second code file is run according to the test task to test the test case in the test framework and obtain a test report.

[0156] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0157] According to the test case, fields are created in a standard format, and the fields are added to a preset code template accordingly to obtain a first code file, wherein the fields include at least one of the following: use case name, test steps, expected test results, and use case author.

[0158] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0159] acquiring first code data according to the first code file;

[0160] Second code data for implementing each test step is added to the first code data to obtain a second code file.

[0161] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0162] Debugging the second code file, wherein the debugging process includes: running the second code file in the test framework and detecting whether there are errors in the running process;

[0163] If so, output an error message, determine the cause of the error based on the error message, and correct the error;

[0164] If not, save the second code file.

[0165] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0166] Obtain cluster parameters, create a virtual machine for running the platform product based on the cluster parameters, and install the corresponding operating system based on the cluster parameters to complete the configuration of the operating environment of the platform product, wherein the cluster parameters include at least one of the following: the number of nodes to be tested, the number of clusters to be tested, the correspondence between the clusters to be tested and the nodes to be tested, and the type of the cluster to be tested.

[0167] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0168] Obtaining an installation program based on the version information of the platform product;

[0169] The platform product is installed by running the installation program, a configuration file of the cluster to be tested is obtained, and components for supporting the functions of the platform product are installed in the cluster to be tested according to the configuration file.

[0170] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0171] Creating a baseline library for managing the test cases, and recording the test cases in the test task in the baseline library according to corresponding periods, wherein the data recorded in the baseline library also includes the number of the test cases and the number of test cases that have passed the second code file test;

[0172] The test efficiency of the second code file in the test framework is calculated according to the number of the test cases and the number of test cases tested by the second code file.

[0173] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0174] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0175] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A software testing method, characterized in that: include: Obtain cluster parameters, create a virtual machine according to the cluster parameters, and install a corresponding operating system according to the cluster parameters to complete the configuration of the operating environment of the platform product; Obtaining the associated data of the platform product to be tested, and storing each of the associated data in a corresponding directory of the test framework, so that the test framework is easy to maintain; Creating a test case according to a preset test case template and the platform product, and converting the test case into code to obtain a first code file; Obtaining a code modification instruction according to the function of the platform product, modifying the function code to be implemented in the first code file according to the code modification instruction so that the data corresponding to the test case, the basic execution logic, and the function code to be implemented are interconnected, obtaining a second code file, and storing the second code file in the test framework; Running the second code file in the test framework to detect whether there are any errors during the running process; If so, output an error message, determine the cause of the error based on the error message, and correct the error; If not, saving the second code file; Obtaining periodic test tasks and creating a baseline library for managing the test cases; wherein the data recorded in the baseline library also includes the number of the test cases and the number of test cases that have passed the second code file test; Recording the test cases in the test task in the baseline library according to corresponding periods; Calculating a test efficiency of the second code file in the test framework according to the number of the test cases and the number of the test cases tested by the second code file; The second code file is run according to the test task to test the test case in the test framework and obtain a test report.

2. The software testing method according to claim 1, wherein: A test case is created according to a preset test case template and the platform product, and the test case is converted into code to obtain a first code file, including: According to the test case, fields are created in a standard format, and the fields are added to a preset code template accordingly to obtain a first code file, wherein the fields include at least one of the following: use case name, test steps, expected test results, and use case author.

3. The software testing method according to claim 1, wherein: Modifying the first code file according to the code modification instruction to obtain a second code file includes: acquiring first code data according to the first code file; Second code data for implementing each test step is added to the first code data to obtain a second code file.

4. The software testing method according to claim 1, wherein: Before obtaining the relevant data of the platform product to be tested, it also includes: The cluster parameters include at least one of the following: the number of nodes to be measured, the number of clusters to be measured, the correspondence between the clusters to be measured and the nodes to be measured, and the type of the cluster to be measured.

5. The software testing method according to claim 4, characterized in that: And installing the corresponding operating system according to the cluster parameters, also includes: Obtaining an installation program based on the version information of the platform product; The platform product is installed by running the installation program, a configuration file of the cluster to be tested is obtained, and components for supporting the functions of the platform product are installed in the cluster to be tested according to the configuration file.

6. A software testing device for implementing the software testing method of claim 1, characterized in that: The device comprises: A construction module is used to obtain the associated data of the platform product to be tested, and store each of the associated data in the test framework; A conversion module, configured to create a test case according to a preset test case template and the platform product, and perform code conversion on the test case to obtain a first code file; a modification module, configured to obtain a code modification instruction according to the function of the platform product, modify the first code file according to the code modification instruction to obtain a second code file, and store the second code file in the test framework; The test module is used to obtain periodic test tasks, run the second code file according to the test tasks, test the test cases in the test framework, and obtain a test report.

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

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

Citation Information

Patent Citations

  • Test case generation method and device, computer equipment and storage medium

    CN112486828A

  • Test method, device, computer equipment and storage medium

    CN113190443A