Software testing method and device, electronic equipment and storage medium
Through the combination of configuration management layer and general method layer, the testing process is decoupled, and automated testing of multiple performance indicators is achieved, solving the problem of single functions of the existing Android performance testing framework, and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202411148851.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-12-03
AI Technical Summary
The existing Android performance testing framework has a single function and cannot conveniently automate the testing of multiple performance indicators, resulting in low testing efficiency, incomplete coverage, and poor framework scalability.
Through the configuration management layer and the general method layer, the test configuration and test methods are managed separately, the testing process is decoupled, the flexibility and accuracy of software testing are improved, and the configuration management of multiple performance indicators is supported.
It improves the efficiency and accuracy of software testing, enhances the coverage of the test architecture and the diversity of performance indicators, and reduces the degree of dependence on configuration and methodology of the test process.
Smart Images

Figure CN119065975A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a software testing method, device, electronic equipment and storage medium. Background Art
[0002] In the testing process of Android applications, the testing of application performance mainly relies on manual operations and simple automated scripts. For different performance test indicators, developers or testers are required to manually perform multiple rounds of testing. At present, although traditional Android performance testing frameworks, such as Monkey and Instrumentation, have achieved automation to a certain extent, their functions are relatively simple. They can often only perform automated testing on a certain type of performance indicator, and cannot conveniently add function points and test indicators, resulting in low testing efficiency, incomplete coverage of test indicators, and poor framework scalability. Summary of the invention
[0003] The present invention provides a software testing method, device, electronic device and storage medium, which respectively manage the test configuration and the test method through the configuration management layer and the general method layer, realize the decoupling of the test process, reduce the dependence of the test process on the test configuration and the test method, and improve the soul of the software testing method. The configuration management of multiple performance indicators is realized through the configuration management module, which can improve the coverage of the software testing architecture, improve the diversity of software performance indicator testing, and improve the accuracy of software testing.
[0004] According to one aspect of the present invention, a software testing method is provided, wherein the method comprises:
[0005] Obtain pre-configured software test configurations at the configuration management layer according to the common method layer;
[0006] Acquire the general test method set in the general method layer according to the software to be tested;
[0007] A software test result of the software to be tested is generated according to the software test configuration and the general test method.
[0008] According to another aspect of the present invention, there is provided a software testing device, wherein the device comprises:
[0009] A configuration reading module, used for obtaining a pre-configured software test configuration at the configuration management layer according to a common method layer;
[0010] A method acquisition module, used for acquiring a general test method set in the general method layer according to the software to be tested;
[0011] The software testing module is used to generate software testing results of the software to be tested according to the software testing configuration and the general testing method.
[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the software testing method described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the software testing method described in any embodiment of the present invention when executed.
[0017] The technical solution of the embodiment of the present invention obtains the software test configuration in the configuration management layer by calling the general method layer, obtains the corresponding general test method in the general method layer for the software to be tested, tests the software to be tested according to the software test configuration and the general test method, and obtains the software test result. The embodiment of the present invention manages the test configuration and the test method respectively through the configuration management layer and the general method layer, realizes the decoupling of the test process, reduces the dependence of the test process on the test configuration and the test method, can improve the soul of the software test method, realizes the configuration management of multiple performance indicators through the configuration management module, can improve the coverage of the software test architecture, improve the diversity of software performance indicator testing, and can improve the accuracy of software testing.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a flowchart of a software testing method provided according to Embodiment 1 of the present invention;
[0021] Figure 2 is a flowchart of another software testing method provided according to Embodiment 2 of the present invention;
[0022] Figure 3 is a flowchart of another software testing method provided according to Embodiment 3 of the present invention;
[0023] Figure 4 This is an example diagram of a software testing architecture provided according to Embodiment 4 of the present invention;
[0024] Figure 5 is a structural schematic diagram of a software testing device provided according to Embodiment 5 of the present invention;
[0025] Figure 6 It is a structural schematic diagram of an electronic device for implementing the software testing method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 1 is a flowchart of a software testing method provided according to the first embodiment of the present invention. This embodiment is applicable to software testing. The method can be executed by a software testing device. The device can be implemented in the form of hardware and / or software. The device can be configured in a server or a terminal. Figure 1 As shown, the method includes:
[0030] Step 110: Obtain a pre-configured software test configuration at the configuration management layer according to the general method layer.
[0031] Among them, the general method layer can be a software architecture layer that uniformly manages the function methods used in software testing. The general method layer can be configured with test methods for various types of software. The methods configured in the general method layer can include but are not limited to configuration acquisition methods, software detection methods, indicator testing methods, etc. The configuration management layer can manage the configuration used in software testing. The configuration management layer can manage configuration parameters such as test application package information, test commands, test command parameters, data storage field definitions, and data storage addresses. Software test configuration can be a parameter used in the software testing process. The software test configuration can include test application package information, test commands, test command parameters, data storage field definitions, and data storage addresses, etc.
[0032] In an embodiment of the present invention, the general method layer may be pre-configured with a method for reading the software test configuration, and the software test configuration saved in the configuration management layer may be read by calling the method. It can be understood that the software test configuration may be saved in the configuration management layer in the form of a configuration file, and the method for reading the software test configuration configured in the general method layer may specifically include a file reading method, and the file reading method may be used to read software test configurations such as test application package information, test commands, test command parameters, data storage field definitions, and data storage addresses at different locations in the configuration file.
[0033] Step 120: Obtain a general test method set in the general method layer according to the software to be tested.
[0034] The software to be tested may be an application software that needs to be tested, the software to be tested may implement one or more business functions, and the software to be tested may specifically include an Android application or a JAVA application. The general test method may be a test method for testing one or more performance indicators of the software to be tested, and the general test method may test the performance indicators of the software to be tested by triggering test instructions.
[0035] Specifically, one or more corresponding general test methods can be found in the general method layer according to the attribute information such as the type of software to be tested or the business function. The general test method can test different test indicators of the software to be tested. For example, the business function of the software to be tested needs to have requirements on the CPU and memory usage. The general test method for implementing CPU testing and memory usage testing can be found in the general method layer according to the business function of the software to be tested.
[0036] Step 130: Generate software test results for the software to be tested according to the software test configuration and the general test method.
[0037] The software test result may be a test result set generated after the software to be tested is tested. The software test result may include test results of one or more test indicators. The test indicators may be implemented by testing using different general test methods.
[0038] In an embodiment of the present invention, the general test method can be initialized according to the software test configuration. For example, the test application package information, test commands, test command parameters, data storage field definitions, and data storage addresses in the software test configuration can be input as input parameters into the general test method. The software to be tested can be tested by executing the general test method. The processing results of each general test method on the software to be tested can be obtained, and the processing results can be merged into the software test results.
[0039] In the embodiment of the present invention, the software test configuration is obtained at the configuration management layer by calling the general method layer, the corresponding general test method is obtained at the general method layer for the software to be tested, and the software to be tested is tested according to the software test configuration and the general test method to obtain the software test result. In the embodiment of the present invention, the test configuration and the test method are managed respectively by the configuration management layer and the general method layer, so as to realize the decoupling of the test process, reduce the dependence of the test process on the test configuration and the test method, improve the soul of the software test method, realize the configuration management of multiple performance indicators through the configuration management module, improve the coverage of the software test architecture, improve the diversity of software performance indicator testing, and improve the accuracy of software testing.
[0040] Further, based on the above-mentioned embodiment of the invention, the configuration management layer further includes result data storage configuration, and the general method layer further includes a data storage method, and the method further includes:
[0041] Save the software test results according to the result data storage configuration and data storage method.
[0042] The result data storage configuration may be information pre-configured by the configuration management layer, and the result data storage configuration may be used to set the storage of the test results of the software under test, and the result data storage configuration may include data storage field definitions and data storage addresses, etc. The data storage method may control the method of saving the software test results of the software under test.
[0043] In an embodiment of the present invention, the result data storage configuration can also be extracted at the configuration management layer, and the result data storage configuration can be transmitted to the data storage method configured at the general method layer, and the data storage method can be called according to the result data storage configuration, so that the software test results can be saved according to the result data storage configuration.
[0044] In some embodiments of the invention, saving software test results according to the result data storage configuration and the data storage method includes:
[0045] Extract the data storage field and file storage path configured by the configuration management layer as the result data storage configuration; initialize the data storage method of the general method layer according to the result data storage configuration; call the data storage method to read the test result file corresponding to the file storage path, and store the software test results in the data storage field of the test result file.
[0046] In an embodiment of the present invention, the result data storage configuration may include a data storage field and a file storage path. The result data storage configuration such as the data storage field and the file storage path may be input as an input parameter to a data storage method within the general method layer to obtain an initialized data storage method. The data storage method may be called to read the test result file saved on the file storage path, and according to the position of the data storage field in the test result file, the software test results may be stored at that position, thereby realizing the preservation of the software test results.
[0047] Embodiment 2
[0048] Figure 2 is a flowchart of another software testing method provided according to Embodiment 2 of the present invention. This embodiment of the present invention is a specific embodiment of the present invention, and describes the process of obtaining software test configuration and determining a general test method. Figure 2 The method provided in the embodiment of the present invention specifically includes the following steps:
[0049] Step 210: extract the configuration acquisition method of the general method layer configuration.
[0050] Specifically, the general method layer may be accessed, and a configuration acquisition method for reading the configuration in the configuration management layer may be acquired at the general method layer.
[0051] Step 220: Call the configuration acquisition method to read the test application information, test commands, test parameters and result data storage configuration in the software test configuration.
[0052] Among them, the test application information may be the software package information configured related to the test software, and the test application information may include but is not limited to the application name, the startup method name, etc.; the test command may be a command to control the software to be tested for test manipulation, and the test command may specifically include the Android Debug Bride (ADB) command, and the test command may include a command to obtain CPU information, a command to obtain startup time, a command to obtain FPS information, a command to obtain memory information, and a command to simulate operations on the software, etc. The test parameter may be the parameter information required for the execution of the test command, and the test parameter may be configured for different software to be tested; the result data storage configuration may be a parameter for configuring the storage of the test results of the software to be tested, and the result data storage configuration may include data storage fields and file storage paths, etc.
[0053] In the embodiment of the present invention, the configuration acquisition method can be called to parse the configuration file in the configuration management layer, and the software test configuration such as test application information, test commands, test parameters and result data storage configuration can be extracted from the configuration file.
[0054] Step 230: extract the software inspection method corresponding to the software type of the software to be tested in the general method layer, wherein the software inspection method at least includes: a device information acquisition method, a software installation inspection method, a running inspection method, and a software operation inspection method.
[0055] Among them, the software inspection method can be a method for inspecting the running status of the software to be tested, and the software inspection method can be used to prevent the software to be tested from not being in the detection state. The software inspection method can include inspecting the installation status, running status, and operation response status of the software to be tested, so as to determine whether the functions of the software to be tested are executed normally. The device information acquisition method can be a program method for reading the hardware device installed by the software to be tested, the software installation inspection method can be a program method for inspecting the installation status of the software to be tested on the hardware, the operation inspection method can be a program method for inspecting the running status of the software to be tested, and the software operation inspection method can be a program method for inspecting the operation response status of the software to be tested, and the software to be tested can control the startup, shutdown, and background hanging operations.
[0056] In an embodiment of the present invention, the type of software to be tested may be a parameter that identifies the business function of the software to be tested. For example, the type of software to be tested may include a browser, video software, document processing software, etc. Corresponding software inspection methods can be obtained in the general method layer for different types of software to be tested. The software inspection method may be composed of a device information acquisition method, a software installation inspection method, an operation inspection method, and a software operation inspection method, etc. The installation status, operation status, and operation response status of the software to be tested may be inspected to ensure that the software to be tested is correctly installed and that the corresponding test environment is capable of testing the performance indicators of the software to be tested.
[0057] Step 240, extracting corresponding indicator test methods in the general method layer according to the software detection indicators of the general method layer, wherein the indicator test methods include: at least one of a CPU command test calling method, a startup time command test calling method, a picture frame transmission per second command test calling method, a memory command test calling method, and a simulation operation command test calling method.
[0058] Among them, the software detection index can be a performance index for detecting the software to be tested. The software detection index can include at least one of a central processing unit (CPU) command test calling method, a startup time command test calling method, a frame per second (FPS) command test calling method, a memory command test calling method, and a simulation operation command test calling method. Different types of software to be tested may have different software detection indicators. For example, the software to be tested of the video software type needs to detect the startup time, while the software to be tested of the document processing software type needs to detect the memory occupancy.
[0059] In an embodiment of the present invention, the software detection index of the software to be tested can be determined, and the software detection index can be determined by the software type of the software to be tested or specified by the user. According to the software detection index, the CPU command test calling method, the startup time command test calling method, the FPS command test calling method, the memory command test calling method, the simulation operation command test calling method, etc. for detecting the software detection index can be extracted at the general method layer. Among them, the CPU command test calling method can detect the CPU index of the software to be tested, the startup time command test calling method can detect the startup time index of the software to be tested, the FPS command test calling method can detect the FPS index of the software to be tested, and the memory command test calling method can detect the memory occupancy index of the software to be tested. Different software to be tested can have different software detection indicators. Therefore, indicator test methods corresponding to different software detection indicators can be obtained at the general method layer.
[0060] Step 250: Use the software detection method and the indicator testing method as a general testing method.
[0061] In the embodiment of the present invention, the software detection method and the indicator detection method obtained for the method to be tested at the general method layer can be used as general test methods for testing the software to be tested.
[0062] Step 260: Generate software test results for the software to be tested according to the software test configuration and the general test method.
[0063] In the embodiment of the present invention, by extracting the configuration acquisition method of the general method layer, calling the configuration acquisition method to acquire test application information, test commands, test parameters and result data storage configuration at the configuration management layer, respectively acquiring software detection methods and index test methods at the general method layer according to the software type of the software to be tested and the software detection index, calling the general test methods such as the software detection method and the index test method through the test application information, test commands, test parameters and result data storage configuration, and obtaining the software test result of the software to be tested. In the embodiment of the present invention, the software itself and the software detection method and the index test method for software performance index detection are respectively saved through the general method layer, and the software detection method is used to ensure that the software to be tested is running normally in the specified operating environment, and the accuracy of the subsequent detection by the index test method is guaranteed, and the performance index is ensured not to be affected by the test operating environment, which can improve the accuracy of the performance index test of the software to be tested. In addition, the performance index test process is decoupled through the general method layer and the configuration management layer, which can reduce the dependence between the configuration and the detection method, improve the flexibility of the software performance index detection, and enhance the scalability of the performance index test.
[0064] Embodiment 3
[0065] Figure 3 is a flowchart of another software testing method provided according to Embodiment 3 of the present invention. The embodiment of the present invention is a specific embodiment based on the above embodiment, and describes the execution process of the software test. Figure 3 The method provided in the embodiment of the present invention specifically includes the following steps:
[0066] Step 310: Obtain a pre-configured software test configuration at the configuration management layer according to the general method layer.
[0067] Step 320: Obtain the general test method set in the general method layer according to the software to be tested.
[0068] Step 330: pass the software test configuration into the command assembly method of the general method layer, and call the command assembly method to assemble the test commands and test parameters of the software test configuration into indicator test commands.
[0069] Among them, the command assembly method can control the method of assembling test commands and test parameters in the software test configuration.
[0070] In an embodiment of the present invention, the software test configuration can be input into the command assembly method of the general method layer to obtain an initialized command assembly method, and the command assembly method is executed to fill the test parameters in the software test configuration into the test command to obtain an index test command. The index test command may include test parameters and test commands. The index test command may include multiple commands, including commands for testing CPU indicators, commands for testing startup time indicators, commands for testing FPS indicators, commands for testing memory usage indicators, etc. The index test command may include ADB commands.
[0071] Step 340: Transmit the indicator test command to the general test method to obtain an initialized general test method.
[0072] In an embodiment of the present invention, an indicator test command can be sent to a general test method. For example, a command for testing a CPU indicator, a command for testing a startup time indicator, a command for testing an FPS indicator, and a command for testing a memory occupancy indicator can be sequentially transmitted to indicator test methods such as a central processing unit command test calling method, a startup time command test calling method, a picture frames per second command test calling method, a memory command test calling method, and a simulation operation command test calling method, thereby initializing the general test method using the indicator test command.
[0073] Step 350: Execute the general testing method to obtain software testing results.
[0074] In an embodiment of the present invention, by calling indicator test methods such as a central processing unit command test calling method, a startup time command test calling method, a picture frames per second command test calling method, a memory command test calling method, and a simulation operation command test calling method, the CPU, FPS, startup time, memory and other indicators of the software to be tested can be tested, and the generated test results can be used as software test results of the software to be tested.
[0075] In an embodiment of the present invention, a software test configuration is obtained at the configuration management layer by calling a general method layer, a corresponding general test method is obtained at the general method layer for the software to be tested, a command assembly method of the general method layer is initialized according to the software test configuration, the command assembly method is called to assemble the test command and the test parameters into an indicator test command, the indicator test command is input into the general test method, and at least one performance indicator of the software to be tested is tested by calling the general test method, thereby obtaining a software test result. In an embodiment of the present invention, the test configuration and the test method are respectively managed by the configuration management layer and the general method layer, so as to achieve decoupling of the test process, reduce the dependence of the test process on the test configuration and the test method, and improve the soul of the software test method. Configuration management of multiple performance indicators is achieved through the configuration management module, which can improve the coverage of the software test architecture, improve the diversity of software performance indicator testing, and improve the accuracy of software testing.
[0076] Further, based on the above-mentioned embodiment of the invention, executing the general testing method to obtain the software testing result includes:
[0077] Execute the software inspection method in the general test method, and perform at least one of device information acquisition, software installation inspection, operation inspection and software operation inspection on the software to be tested according to the software inspection method; extract the indicator test method in the general test method, call the indicator test method to trigger the software to be tested to execute the indicator test command; measure the performance indicator of the software to be tested during the execution of the indicator test command as the software test result.
[0078] In an embodiment of the present invention, the software detection method in the general testing method can be executed, and equipment information acquisition, software installation check, operation check and software operation check and other checks can be performed in sequence to ensure that the performance indicator detection environment of the software to be tested meets the minimum requirements and the accuracy of performance indicator extraction is ensured. After the software to be tested is detected by the software detection method, the indicator testing method can be called, and the indicator testing method can be used to trigger the software to be tested to execute the indicator testing command. The CPU, startup time, FPS, memory and other performance indicators of the software to be tested can be detected, and the performance indicators of the software to be tested in the process of executing the indicator testing command can be extracted, and each performance indicator can be combined into a software test result.
[0079] Embodiment 4
[0080] Figure 4 is an example diagram of a software testing architecture provided according to Embodiment 4 of the present invention, see Figure 4In the embodiment of the present invention, the software test architecture may include a configuration management layer, a general method layer, and a test execution layer, wherein the configuration management layer may adopt an hjson format file to store and manage configuration information such as ADB commands, test application package information, and ADB command parameters through the hjs format file. The configuration management layer may also define data storage fields to ensure the readability of the test results. The configuration management layer sets the storage location of the software test results by setting the data storage path.
[0081] The general method layer may include multiple methods for software testing, including but not limited to ADB command configuration acquisition method, APP inspection method, ADB command assembly method, ADB command calling method, data storage method, and other processing methods. Among them, the ADB command configuration acquisition method is used to obtain the configuration of the file record under the configuration management layer; the APP inspection method may include obtaining test equipment information, checking software installation status, detecting software operation status, and checking APP startup, shutdown, hanging into the background and other operations; the ADB command assembly method is used to assemble ADB commands required for different indicator tests, and the ADB command calling method includes the calling method of ADB commands required by different indicators and the data collection method of different indicators; the data storage method is used to store the test results in the form of data files; other processing methods are used to perform other processing on the software to be tested, such as date processing, etc.
[0082] The test execution layer can implement the testing of different performance indicators of the software to be tested by calling the general method layer and the configuration management layer. Taking the CPU indicator test of the software to be tested as an example, the testing process may include the following steps:
[0083] 1) By calling the ADB command configuration acquisition method in the general method layer, the test application package information, ADB command, and ADB command configuration of the configuration management layer are obtained by investigating the ADB configuration acquisition method.
[0084] 2) The test application information obtained in step 1) and the determined test environment are passed to the APP check method of the general method layer, the APP check method is initialized, and the APP check method is called to determine whether the application of the test environment corresponding to the software to be tested is installed on the test device. If it is installed, continue to run downward; otherwise, throw an exception.
[0085] 3) The configuration obtained in step 1) is passed to the ADB command assembly method of the general method layer, the ADB command assembly method is initialized, and the command assembly method for obtaining CPU indicators is called to obtain a complete ADB command.
[0086] 4) By calling the APP check method in the general method layer, close and / or start the APP according to the needs of the software to be tested, and by checking or setting (window running, hanging in the background, etc.) the application running status to ensure the original state of the software to be tested and set the required test environment.
[0087] 5) The ADB command obtained in step 3) is passed to the ADB command calling method of the general method layer, the ADB command calling method is initialized, and the ADB command calling method is called to run the ADB command and data collection method for obtaining the CPU index, the ADB command is called to trigger the software under test to test the CPU index, and the CPU index data is collected according to the data collection method.
[0088] 6) The fields required in Excel and the local storage path of the Excel file are obtained by calling the data storage field and file storage path acquisition methods in the general method layer.
[0089] 7) The CPU indicator data obtained through step 5) and the CPU data storage field definition and CPU data file storage local path obtained through step 6) are passed into the data storage method of the general method layer. Through the execution of the data storage method, the CPU indicator data is stored in the corresponding file of the local path, and the CPU indicator data is stored according to the data storage field.
[0090] 8) Follow the above steps to obtain the CPU indicator data when the APP is running.
[0091] In an embodiment of the present invention, a software testing framework is provided that can be designed using a layered approach. ADB commands and parameter configuration, calling, processing, storage and other elements are decoupled, and each performance indicator is developed as an independent test module, which is convenient for later maintenance and expansion. The performance testing method can cover multiple indicators, including multiple client key performance indicators such as CPU occupancy, memory usage, FPS, hot and cold start time, etc., which is convenient for comprehensive evaluation of application client performance. Custom configuration can be achieved, and the framework provides a wealth of configuration options, allowing testers to customize test parameters and processes, and develop methods that meet different test scenarios and requirements.
[0092] Embodiment 3
[0093] Figure 5 Schematic diagram of the structure of a software testing device provided according to Embodiment 5 of the present invention. Figure 5 As shown, the device includes: a configuration reading module 410 , a method acquisition module 420 and a software testing module 430 .
[0094] The configuration reading module 410 is used to obtain the pre-configured software test configuration at the configuration management layer according to the general method layer.
[0095] The method acquisition module 420 is used to acquire the general test method set in the general method layer according to the software to be tested.
[0096] The software testing module 430 is used to generate a software testing result of the software to be tested according to the software testing configuration and the general testing method.
[0097] In the embodiment of the present invention, the configuration reading module calls the general method layer to obtain the software test configuration at the configuration management layer, the method acquisition module obtains the corresponding general test method at the general method layer for the software to be tested, and the software testing module tests the software to be tested according to the software test configuration and the general test method to obtain the software test result. In the embodiment of the present invention, the test configuration and the test method are managed respectively by the configuration management layer and the general method layer, so as to realize the decoupling of the test process, reduce the dependence of the test process on the test configuration and the test method, and improve the soul of the software testing method. The configuration management module realizes the configuration management of multiple performance indicators, which can improve the coverage of the software testing architecture, improve the diversity of software performance indicator testing, and improve the accuracy of software testing.
[0098] In some inventive embodiments, the configuration reading module 410 includes:
[0099] The configuration method unit is used to extract the configuration acquisition method of the general method layer configuration.
[0100] The configuration parameter unit is used to call the configuration acquisition method to read the test application information, test commands, test parameters and result data storage configuration in the software test configuration.
[0101] In some other inventive embodiments, the method acquisition module 420 includes:
[0102] The general method unit is used to extract the software inspection method corresponding to the software type of the software to be tested in the general method layer, wherein the software inspection method at least includes: a device information acquisition method, a software installation inspection method, a running inspection method and a software operation inspection method.
[0103] An indicator method unit is used to extract corresponding indicator test methods in the general method layer according to the software detection indicators of the general method layer, wherein the indicator test methods include: at least one of a central processing unit command test calling method, a startup time command test calling method, a picture frame transmission per second command test calling method, a memory command test calling method, and a simulation operation command test calling method.
[0104] A general method unit is used to use the software detection method and the indicator testing method as the general testing method.
[0105] In some other inventive embodiments, the software testing module 430 includes:
[0106] An assembly initialization unit is used to pass the software test configuration into the command assembly method of the general method layer.
[0107] A command assembling unit is used to call the command assembling method to assemble the test commands and test parameters of the software test configuration into an indicator test command.
[0108] The universal initialization unit is used to transmit the index test command to the universal test method to obtain the initialized universal test method.
[0109] The general execution unit is used to execute the general test method to obtain the software test result.
[0110] On the basis of the above-mentioned embodiments of the invention, the general execution unit is specifically used to: execute the software inspection method in the general testing method, and perform at least one of device information acquisition, software installation inspection, operation inspection and software operation inspection on the software to be tested according to the software inspection method; extract the indicator testing method in the general testing method, and call the indicator testing method to trigger the software to be tested to execute the indicator testing command; measure the performance indicators of the software to be tested during the execution of the indicator testing command as the software testing results.
[0111] In some embodiments of the invention, the configuration management layer also includes a result data storage configuration, and the general method layer also includes a data storage method. Accordingly, the device also includes: a storage processing module, which is used to save the software testing results according to the result data storage configuration and the data storage method.
[0112] Based on the above-mentioned embodiments of the invention, the storage processing module is specifically used to: extract the data storage field and file storage path configured by the configuration management layer as the result data storage configuration; initialize the data storage method of the general method layer according to the result data storage configuration; call the data storage method to read the test result file corresponding to the file storage path, and store the software test results in the data storage field of the test result file.
[0113] The software testing device provided in the embodiment of the present invention can execute the software testing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0114] Embodiment 6
[0115] Figure 6It is a schematic diagram of the structure of an electronic device for implementing the software testing method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0116] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0117] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0118] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a software testing method.
[0119] In some embodiments, the software testing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the software testing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the software testing method in any other appropriate manner (e.g., by means of firmware).
[0120] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0121] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0122] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0123] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0124] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0125] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0126] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0127] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A software testing method, It is characterized in that The method comprises: Obtain pre-configured software test configurations at the configuration management layer according to the common method layer; Acquire the general test method set in the general method layer according to the software to be tested; A software test result of the software to be tested is generated according to the software test configuration and the general test method.
2. The method according to claim 1, It is characterized in that The step of obtaining a pre-configured software test configuration at the configuration management layer according to the general method layer includes: Extract the configuration acquisition method of the general method layer configuration; The configuration acquisition method is called to read the test application information, test commands, test parameters and result data storage configuration in the software test configuration.
3. The method according to claim 1, It is characterized in that The method of obtaining the general test method set at the general method layer according to the software to be tested includes: Extracting a software inspection method corresponding to the software type of the software to be tested in the general method layer, wherein the software inspection method at least includes: a device information acquisition method, a software installation inspection method, a running inspection method, and a software operation inspection method; Extracting the corresponding indicator test method at the general method layer according to the software detection indicator of the general method layer, wherein the indicator test method includes: at least one of a CPU command test calling method, a startup time command test calling method, a picture frame transmission per second command test calling method, a memory command test calling method, and a simulation operation command test calling method; The software detection method and the indicator testing method are used as the general testing method.
4. The method according to claim 1, It is characterized in that Generating the software test result of the software to be tested according to the software test configuration and the general test method includes: The command assembly method of passing the software test configuration into the general method layer; Calling the command assembling method to assemble the test commands and test parameters of the software test configuration into an indicator test command; Transmitting the index test command to the universal test method to obtain the initialized universal test method; The general testing method is executed to obtain the software testing result.
5. The method according to claim 4, It is characterized in that The executing the general testing method to obtain the software testing result includes: Execute the software inspection method in the general test method, and perform at least one of device information acquisition, software installation inspection, operation inspection, and software operation inspection on the software to be tested according to the software inspection method; Extracting the index test method in the general test method, calling the index test method to trigger the software to be tested to execute the index test command; The performance index of the software to be tested during the execution of the index test command is measured as the software test result.
6. The method according to claim 1, It is characterized in that The configuration management layer further includes result data storage configuration, and the general method layer further includes a data storage method, and the method further includes: The software test results are saved according to the result data storage configuration and the data storage method.
7. The method according to claim 1, It is characterized in that The storing of the software test results according to the result data storage configuration and the data storage method comprises: Extracting the data storage field and file storage path configured by the configuration management layer as the result data storage configuration; Initialize the data storage method of the general method layer according to the result data storage configuration; The data storage method is called to read the test result file corresponding to the file storage path, and the software test result is stored in the data storage field of the test result file.
8. A software testing device, It is characterized in that The device comprises: A configuration reading module, used for obtaining a pre-configured software test configuration at the configuration management layer according to a common method layer; A method acquisition module, used for acquiring a general test method set in the general method layer according to the software to be tested; The software testing module is used to generate software testing results of the software to be tested according to the software testing configuration and the general testing method.
9. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the software testing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the software testing method according to any one of claims 1 to 7 when executed.
