Auxiliary test method, equipment and medium
The auxiliary testing method associates configuration information with the test script to the function button, solving the problem of existing tools supporting a single task, realizing multi-task automated testing, improving efficiency and accuracy, and is suitable for desktop and web testing.
Patent Information
- Application Number
- CN202411905908.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-29
- Filing Date
- 2024-12-23
- Publication Date
- 2025-07-08
AI Technical Summary
The existing desktop assisted testing tools only support a single test task, which causes developers to frequently switch tools, which is very labor-intensive, inefficient, and has high professional skills requirements for developers.
Provides an auxiliary testing method, by obtaining user testing needs, writing test scripts and conducting business configuration, associating configuration information with test scripts into function buttons, realizing automated testing, and supporting the unified management and execution of multiple test tasks.
It improves testing efficiency and accuracy, reduces human operation errors, reduces testing costs, and realizes standardization and modularity of testing, which is suitable for different types of software and system testing.
Smart Images

Figure CN120276974A_ABST
Abstract
Description
[0001] This application claims priority based on the invention patent application filed with the China National Patent Office on December 29, 2023, with the application number 202311867934.0 and the invention title "A Desktop-Assisted Testing Method, Device, and Medium". This application incorporates the entire text of the above-mentioned Chinese patent application by reference. Technical Field
[0002] This application relates to the technical field of software testing, and particularly to an assisted testing method, device, and medium. Background Art
[0003] Currently, during software development and testing, various repetitive and cumbersome tasks often need to be performed, such as installing application programs, taking screenshots, data verification, etc. These tasks usually require manual operation, which is not only inefficient but also error-prone. Therefore, in order to improve testing efficiency and accuracy, an assisted testing tool is needed to assist in completing these tasks.
[0004] However, existing desktop-assisted testing tools usually only support a single testing task, such as installing application programs, data verification, etc. This requires developers to frequently switch tools when performing multiple testing tasks, which not only increases the workload but also reduces work efficiency. In addition, existing desktop-assisted testing tools usually require developers to have certain programming skills, which poses a certain learning threshold for non-professionals. Summary of the Invention
[0005] Embodiments of this application provide an assisted testing method, device, and medium to solve the technical problems that existing desktop-assisted testing tools only support a single testing task, developers need to frequently switch tools, the workload is large, the work efficiency is low, and moreover, they have high professional skill requirements for developers.
[0006] On the one hand, embodiments of this application provide an assisted testing method, including:
[0007] Obtain the test requirements of the user, and determine the application scenario of the corresponding item to be tested according to the test requirements;
[0008] According to the application scenario corresponding to the item to be tested, write a test script for the application scenario, and perform business configuration on the item to be tested in the application scenario to add the corresponding configuration information to the corresponding test script;
[0009] Through a preset configuration information module, determine the configuration information corresponding to the item to be tested, and associate the configuration information with the corresponding test script to a preset function button.
[0010] By writing test scripts in the application scenarios, the embodiments of the present application can automatically test the items to be tested, improving the test efficiency and accuracy; perform business configuration on the test items and add the corresponding configuration information to the test scripts, realizing the unified management and maintenance of the configuration information; quickly determine and associate the configuration information of the items to be tested with the test scripts through the preset configuration information module, and then integrate them into the function buttons, simplifying the complexity of the test operations, enabling testers to execute test tasks more conveniently; directly associate the configuration information with the test scripts and integrate them into the function buttons, reducing errors and omissions in the manual operation process, improving the accuracy and reliability of the test, and ensuring higher accuracy of the test results; the written test scripts and configuration information modules can be reused for different projects or similar application scenarios, reducing the test cost, improving the utilization efficiency of test resources, and promoting the standardization and modularization of the test work.
[0011] In an implementation manner of the present application, after associating the configuration information and the corresponding test scripts to the preset function buttons, the method further includes:
[0012] Determine the function to be implemented corresponding to the test requirements, and determine the function button corresponding to the function to be implemented;
[0013] Trigger the function button to obtain the corresponding configuration information and execute the test script corresponding to the configuration information;
[0014] Run the test cases corresponding to the configuration information and generate the corresponding test reports to achieve auxiliary testing; the auxiliary testing includes desktop testing and web testing.
[0015] By determining the function to be implemented corresponding to the test requirements and its function button in the embodiments of the present application, testers can quickly locate the specific function points to be tested, avoiding the cumbersome process of requirement interpretation and function location, thus significantly improving the efficiency of the test work; trigger the function button to obtain the configuration information and execute the corresponding test script, ensuring that the test process is carried out strictly according to the predetermined configuration, reducing the errors caused by manual operations, and enhancing the accuracy and reliability of the test; run the test cases corresponding to the configuration information and automatically generate test reports, which realizes the automation of the test, greatly reducing the workload of testers, and at the same time improving the consistency and repeatability of the test; the generated test reports record in detail the test process, test results and possible problems, providing a strong basis for subsequent problem tracking and fault location, and helping to quickly discover and solve the problems found in the test; the auxiliary testing covers desktop testing and web testing, which means that this method can be applied to different types of software and system testing, meeting the diverse test requirements and improving the comprehensiveness and coverage of the test.
[0016] In an implementation manner of the present application, after obtaining the test requirements of the user, the method further includes:
[0017] In the class of the window application framework, create a corresponding instance based on the initialization function, and perform corresponding processing operations through static methods; the processing operations include writing messages, printing information, and clearing operations;
[0018] Based on the desktop assistant test tool, create a program instance corresponding to the class of the window application framework to instantiate the class of the window application framework.
[0019] In the embodiment of the present application, in the class of the window application framework, by creating a corresponding instance based on the initialization function, modular design can be conveniently carried out, making the structure of the program clearer and more maintainable; by performing corresponding processing operations through static methods, including writing messages, printing information, and clearing operations, these operations can be conveniently called and managed, improving the readability and reusability of the code; based on the desktop assistant test tool, a program instance corresponding to the class of the window application framework can be created to instantiate the class of the window application framework, so as to conveniently perform testing and verification; through the design and implementation of the class of the window application framework, the functions of the window application can be flexibly extended and customized to meet the changes and extensions of different requirements; through the use of the class of the window application framework, the repetitive code writing work can be reduced, the development efficiency can be improved, and the maintenance cost can be reduced.
[0020] In an implementation manner of the present application, triggering the function button to obtain corresponding configuration information and execute the test script corresponding to the configuration information specifically includes:
[0021] When the application scenario corresponding to the item to be tested is a mobile phone screenshot, save the local directory of the corresponding screenshot, and print the start screenshot operation in the mobile phone screenshot application scenario based on the function to be referenced corresponding to the item to be tested;
[0022] Obtain the current time corresponding to the printing operation, and determine the screenshot file name of the corresponding screenshot file according to the current time;
[0023] Based on the execution of the screenshot command, pull the screenshot file to the local directory, and print the screenshot completion task in the mobile phone screenshot application scenario to complete the mobile phone screenshot operation.
[0024] When saving a screenshot in an embodiment of this application, by specifying a local directory, it is convenient to manage and organize screenshot files, improving the convenience and maintainability of file management; obtaining the current time and using it to determine the screenshot file name can make the file name have timestamp information, facilitating file identification and sorting, and at the same time ensuring the uniqueness and correctness of the file name; by printing information about the screenshot operation, such as the start of the screenshot operation and the screenshot completion task, it is convenient to track and record the status of the screenshot task, improving the transparency and traceability of task management; by executing the screenshot command and pulling the screenshot file to the local directory, the entire process of mobile phone screenshot can be automated, improving the efficiency and accuracy of screenshotting.
[0025] In an implementation manner of this application, triggering the function button to obtain corresponding configuration information and execute the test script corresponding to the configuration information specifically includes:
[0026] In the case where the application scenario is to install an apk package, based on the installation requirements of the apk package, define a corresponding apk package installation function, and based on the apk package installation function, print the start screenshot operation in the application scenario of installing the apk package;
[0027] Based on the preset commands of the Android terminal corresponding to the application scenario of installing the apk package, install the apk package to the corresponding Android terminal and obtain the execution result corresponding to the Android terminal;
[0028] Print the execution result and print the installation completion task of the apk package in the Android terminal to complete the installation operation of the apk package.
[0029] In an embodiment of this application, by defining an apk package installation function, it is convenient to perform the installation operation of the apk package, improving the modularity and reusability of the installation; based on the preset commands of the Android terminal, automatically install the apk package to the corresponding Android terminal, reducing the cumbersome and errors of manual installation, and improving the efficiency and accuracy of the installation; by obtaining and printing the execution result, it is convenient to track the installation status and result of the apk package, improving the transparency and traceability of result management; applicable to various installation scenarios of apk packages, with strong adaptability and scalability, and can be customized and adjusted according to different requirements; by printing information such as the start screenshot operation, execution result, and installation completion task, it can ensure the integrity and consistency of the apk package installation, and improve the credibility and reliability of the installation process.
[0030] In an implementation manner of this application, triggering the function button to obtain corresponding configuration information and execute the test script corresponding to the configuration information specifically includes:
[0031] In the case where the application scenario is a data verification script, corresponding data processing operations are performed on the project to be tested based on a preset line number verification function corresponding to the big data migration task; the data processing operations include: database query and logical judgment;
[0032] In the case where the data processing operation is a database query, the data to be obtained corresponding to the database query request is obtained from the database to obtain a corresponding database query result, and the database query result is stored in a variable;
[0033] In the case where the data processing operation is a logical judgment, the difference quantity is obtained based on the database query result, and a corresponding percentage is calculated according to the difference quantity;
[0034] Based on the magnitude relationship between the percentage and a preset percentage threshold, and the magnitude relationship between the difference quantity and a preset difference threshold, it is determined whether the database query result passes, and in the case of non-pass, the error information in the database is sent to the management personnel to implement the line number verification of the data verification script.
[0035] In the embodiment of the present application, through the data processing operations based on the preset line number verification function, including database query and logical judgment, the data of the project to be tested can be flexibly processed and verified, improving the data processing ability and flexibility; in the case where the data processing operation is a database query, the data to be obtained can be obtained from the database, the database query result is obtained, and the result is stored in a variable, realizing the acquisition and storage of data; in the case where the data processing operation is a logical judgment, the difference quantity is obtained based on the database query result, and a corresponding percentage is calculated according to the difference quantity, providing a key reference basis for subsequent data verification; based on the preset percentage threshold and difference threshold, it can be automatically determined whether the database query result passes, and in the case of non-pass, the error information is sent to the management personnel, realizing the automatic verification of data; through the line number verification of the data verification script, the accuracy and consistency of the data can be ensured, improving the reliability and accuracy of data processing.
[0036] In an implementation manner of the present application, triggering the function button to obtain corresponding configuration information and execute the test script corresponding to the configuration information specifically includes:
[0037] In the case where the application scenario is a data verification script, dimension verification is performed on the database, and an error list is initialized to store error information through the error list;
[0038] Query the data to be queried in the database to obtain a corresponding database query result, and traverse the database query result to determine the order of the formal table and the test table according to the traversal result;
[0039] Generate data query statements corresponding to the test table and the official table, execute the data query statements, obtain the corresponding query results, and store error information in the error list based on the query results.
[0040] In the embodiment of the present application, by performing dimension verification on the database, the integrity and accuracy of data can be ensured, and the reliability of data verification is improved; by initializing an error list to store error information, errors occurring during the verification process can be conveniently managed and tracked, and the efficiency and accuracy of error handling are improved; by querying the data to be queried in the database and determining the order of the official table and the test table according to the traversal results, the efficiency of data query can be optimized, unnecessary query operations can be reduced, and the query performance is improved; by generating data query statements corresponding to the test table and the official table and executing the data query statements to obtain query results, data comparison and verification can be conveniently performed to ensure data consistency and accuracy; storing error information in the error list based on the query results realizes the automated storage and management of error information, reduces the cumbersome manual recording and processing, and improves the efficiency and convenience of error handling.
[0041] In one implementation manner of the present application, after obtaining the test requirements of the user, the method further includes:
[0042] Configure the path information corresponding to the core configuration information document, the path information corresponding to the script event-driven document, and the path information corresponding to the page style document according to the test requirements;
[0043] Determine the startup entry corresponding to the desktop assistance tool, and respectively package each document information into a corresponding running file based on the corresponding path information.
[0044] In the embodiment of the present application, by configuring the path information corresponding to the core configuration information document, the script event-driven document, and the page style document, these documents can be conveniently managed and located, and the efficiency and accuracy of document management are improved; based on the corresponding path information, packaging each document information into a corresponding running file can conveniently integrate and encapsulate relevant documents and configuration information, and improve the portability and maintainability of the files; determining the startup entry corresponding to the desktop assistance tool can ensure the smooth startup and operation during the test, and improve the efficiency and reliability of the test; by configuring path information and packaging running files, different test requirements and scenarios can be flexibly adapted to meet the diverse requirements during the test; through automated path configuration and file packaging processing, the cumbersome and error-prone manual operations can be reduced, and the automation degree and efficiency of the test process are improved.
[0045] On the other hand, an embodiment of the present application also provides an auxiliary testing device, which includes:
[0046] An acquisition module, configured to acquire the testing requirements of a user, and determine the application scenario corresponding to the item to be tested according to the testing requirements;
[0047] A configuration module, configured to write a test script in the application scenario according to the application scenario corresponding to the item to be tested, and perform service configuration on the item to be tested in the application scenario, so as to add corresponding configuration information to the corresponding test script;
[0048] An association module, configured to determine the configuration information corresponding to the item to be tested through a preset configuration information module, and associate the configuration information and the corresponding test script to a preset function button.
[0049] On the other hand, an embodiment of the present application also provides an electronic device, which includes:
[0050] At least one processor;
[0051] And a memory communicatively connected to the at least one processor;
[0052] Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute any one of the above-mentioned auxiliary testing methods.
[0053] On the other hand, an embodiment of the present application also provides a non-volatile computer storage medium, storing computer-executable instructions, and when the computer executes the executable instructions, any one of the above-mentioned auxiliary testing methods is implemented. Description of the Drawings
[0054] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:
[0055] Figure 1 It is a schematic flow chart of an auxiliary testing method provided by an embodiment of the present application;
[0056] Figure 2 It is a schematic internal structure diagram of a remote management device for a swap station database provided by an embodiment of the present application;
[0057] Figure 3 It is a schematic internal structure diagram of an auxiliary testing device provided by an embodiment of the present application. Detailed Embodiments
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments of this application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0059] This application discloses an auxiliary testing method, device, and medium, aiming to solve the problems in the prior art that only support a single testing task, require frequent tool switching, have a large workload, and low efficiency.
[0060] The following will, in conjunction with the drawings, elaborate on the technical solutions provided by each embodiment of this application.
[0061] Figure 1 It is a schematic flowchart of an auxiliary testing method provided by an embodiment of this application.
[0062] The implementation of the analysis method involved in the embodiments of this application can be a terminal device or a server, and this application does not impose special restrictions on this. For the convenience of understanding and description, the following embodiments will be described in detail using a server as an example.
[0063] It should be noted that this server can be a single device or a system composed of multiple devices, that is, a distributed server, and this application does not make specific limitations on this.
[0064] As Figure 1 shown, an auxiliary testing method provided by an embodiment of this application includes:
[0065] 101. Obtain the test requirements of the user, and determine the application scenarios corresponding to the items to be tested according to the test requirements.
[0066] To ensure the quality and stability of the application, it is first necessary to obtain detailed test requirements, which include different test scenarios. It should be noted that the application scenarios in the embodiments of this application are, for example: mobile phone screenshots, installing apk packages, data verification scripts, line number comparison, dimension comparison, metric comparison, clearing results, all comparisons, network debugging, connecting to a mobile phone, device information, updating the device, disconnecting, entering text, ipa scanning code, and apk scanning code.
[0067] In an embodiment of this application, after the server obtains the test requirements of the user, in a certain window application framework, there is a core class for handling messages, information printing, and clearing operations in the application. To implement automated testing, a desktop auxiliary testing tool is used to create an instance of this class and perform relevant processing operations.
[0068] First, an instance of the class of the window application framework is created based on the initialization function. The initialization function is responsible for setting the initial state and configuration required by the class to ensure the correct creation of the instance. Next, static methods are used to perform corresponding processing operations. These operations include writing messages to the application, printing information in the application, and performing clearing operations. Through these methods, it is possible to simulate user operations in the application and verify the functions and performance of the window application framework.
[0069] To implement automated testing, a program instance corresponding to the class of the window application framework is created based on the desktop-assisted testing tool. This instance has the same structure and functions as the instance in the actual application, but it is created for testing purposes. Through this instance, it is possible to simulate the interaction behavior of users in the application and conduct automated testing on it.
[0070] After instantiating the class of the window application framework, it is possible to call the methods of the instance to perform processing operations. For example, it is possible to call the method of writing messages to simulate user input, call the method of printing information to verify the output of the application, and call the method of clearing operations to reset the state of the application.
[0071] Through this embodiment, the class of the window application framework is successfully instantiated and processed using the desktop-assisted testing tool. This improves the efficiency and accuracy of testing and ensures the quality and stability of the application.
[0072] In an embodiment of the present application, after obtaining the test requirements of the user, the server first configures the path information corresponding to the core configuration information document according to the test requirements. These configuration information include the name, version, running environment, test data, etc. of the application. These configuration information are saved in a document and the path information of the document is determined.
[0073] Next, the path information corresponding to the script event-driven document is configured. These scripts and logics are saved in another document and the path information of the document is determined. These script event-driven documents contain the scripts and event-driven logics for automated testing.
[0074] Then, the path information corresponding to the page style document is configured. These styles and layouts are saved in a document and the path information of the document is determined. These page style documents contain the interface styles and layout information of the application.
[0075] Next, the startup entry corresponding to the desktop-assisted tool is determined. This startup entry can be the main interface of the application, the console of the test tool, or the command-line interface, etc. Through this entry, it is possible to start the desktop-assisted testing tool and begin the automated testing process.
[0076] Finally, based on the path information of each document, the core configuration information document, the script event-driven document, and the page style document are respectively packaged into corresponding running files. These running files can be executable files, script files, installation packages, etc., to facilitate the deployment and execution of automated tests.
[0077] Through this embodiment, the software development team successfully used the desktop-assisted testing tool to achieve the configuration and packaging of automated tests. They were able to flexibly configure the core configuration information, script event-driven, and page style documents according to the test requirements and package them into executable test files.
[0078] 102. According to the application scenario corresponding to the project to be tested, write test scripts for the application scenario and perform business configuration on the project to be tested in the application scenario to add the corresponding configuration information to the corresponding test scripts.
[0079] In an embodiment of the present application, for the test scenario of mobile phone screenshots, the server wrote corresponding test scripts. These scripts can simulate the operations of users on the mobile phone and automatically capture screenshots of key interfaces. At the same time, the server performed business configuration on the project to be tested and added configuration information such as the path for saving screenshots and the rules for screenshot file names to the test scripts.
[0080] For the test scenario of installing the apk package, an apk package installation function was defined and corresponding test scripts were written. These scripts can automatically download the apk package and install it on the specified device through the preset commands of the Android terminal. During the installation process, the scripts will record the execution results and print the information of the completed installation task after the installation is completed.
[0081] For the test scenario of data verification scripts, a preset row number verification function was written according to the requirements of the big data migration task. This function can query and perform logical judgments on the data in the database to verify the accuracy and integrity of the data. During the data processing process, the scripts will calculate the difference quantity and percentage and judge whether the test result passes according to the preset threshold. If it does not pass, the scripts will send the error information to the management personnel for further processing.
[0082] After writing the test scripts and completing the business configuration, the configuration information corresponding to the project to be tested was determined through the configuration information module on the desktop-assisted testing tool. These information include the model of the device, the version of the operating system, the network connection method, etc., to ensure that the test environment is consistent with the actual requirements.
[0083] 103. Through the preset configuration information module, determine the configuration information corresponding to the project to be tested and associate the configuration information with the corresponding test scripts to the preset function buttons.
[0084] In an embodiment of the present application, the server first determines the configuration information corresponding to the item to be tested. This configuration information includes the name, version, running environment, test data, etc. of the application. The server adds this configuration information to the desktop-assisted testing tool through the configuration information module on the desktop-assisted testing tool. In this way, the testing tool can simulate the user environment and operations according to this configuration information, so as to perform tests more accurately.
[0085] Next, according to the user's test requirements, the corresponding function buttons are added to the function button module on the desktop-assisted testing tool. These function buttons correspond to the functions to be implemented, such as login, registration, search, adding data, etc. By pressing these function buttons, the corresponding functions can be triggered to be implemented for function testing.
[0086] When a function button is pressed, the desktop-assisted testing tool will record and process the corresponding trigger event, and then determine the function to be implemented according to the correspondence between the configuration information and the function button, and perform the corresponding test operations. For example, if the user presses the login function button, the testing tool will simulate the user to input the username and password and try to perform the login operation. It will also check whether the login process is normal, whether the interface after login is correctly displayed, etc., and record the test results.
[0087] Through this embodiment, the software development team has successfully utilized the desktop-assisted testing tool to realize the automation of function testing, and can quickly and accurately simulate the user environment and operations, and perform the corresponding test operations. This not only improves the test efficiency and accuracy, but also reduces the possibility of manual intervention and errors.
[0088] In an embodiment of the present application, for the need to perform mobile phone screenshot testing to verify the interface and interaction functions of the application, the server first determines that the application scenario corresponding to the item to be tested is mobile phone screenshot, and saves the local directory corresponding to the screenshot, so as to save the screenshot file to the specified location.
[0089] Then, based on the function to be referenced corresponding to the item to be tested, the start screenshot operation in the mobile phone screenshot application scenario is printed. This function can trigger the execution of the screenshot command and print the prompt information for starting the screenshot, so that the testers can understand the test progress.
[0090] Before the screenshot command is executed, the current time corresponding to the print operation is obtained, and the screenshot file name of the corresponding screenshot file is determined according to this time. In this way, each screenshot file will have a unique timestamp as part of the file name, which is convenient for subsequent search and management.
[0091] Then, by executing the screenshot command, the screenshot file is pulled from the mobile phone to the previously saved local directory. This process is automated and does not require manual intervention. Once the screenshot file is pulled to the local directory, the screenshot completion task in the mobile phone screenshot application scenario will be printed to indicate that the screenshot operation has been completed.
[0092] Through this embodiment, the automated testing of mobile phone screenshots is successfully achieved, enabling the quick and accurate acquisition of the application's interface screenshots and saving them to the specified directory. In this way, developers and product managers can intuitively view the actual interface effects of the application for subsequent evaluation and improvement work.
[0093] In an embodiment of the present application, for a new Android application that requires frequent installation and testing of APK packages, to improve efficiency, first, the server defines a corresponding APK package installation function based on the installation requirements of the APK package. This function encapsulates all the steps and logic required for installing the APK package and can install according to the incoming APK package path and other configuration information. At the same time, this function can also print out the prompt information for starting the installation operation so that testers can understand the current installation progress.
[0094] After defining the installation function, the development team installs the APK package onto the corresponding Android terminal based on the preset commands in the desktop-assisted testing tool for Android terminals. These preset commands are pre-configured and can be directly executed on the Android terminal, thus achieving the automatic installation of the APK package. During the installation process, the Android terminal will return the execution results, including whether the installation is successful and the log information during the installation process.
[0095] Once the installation is complete, the development team will print the execution results for testers to view the installation results. If the installation is successful, a prompt message for the completion of the installation task will be printed, indicating that the APK package has been successfully installed on the Android terminal. If the installation fails, an error message will be printed along with the corresponding solution so that testers can handle the problem in a timely manner.
[0096] Through this embodiment, the automated installation and testing of APK packages are successfully achieved, enabling the quick and accurate installation of APK packages and timely obtaining the installation results and error information. This not only improves the testing efficiency and accuracy but also reduces the possibility of manual intervention and errors.
[0097] In an embodiment of the present application, when data migration work is being carried out and it is necessary to verify whether the migrated data is consistent with the original data, in order to ensure the accuracy and integrity of the data, the server first performs corresponding data processing operations on the project to be tested based on the preset row verification function corresponding to the big data migration task. These operations include database queries and logical judgments. The database query is used to obtain the data to be verified from the database, and the logical judgment is used to compare the differences between the migrated data and the original data.
[0098] In the case where the data processing operation is a database query, the data to be obtained corresponding to the database query request is obtained from the database, a query statement is used to retrieve the data to be verified, and the result is stored in a variable for subsequent processing.
[0099] Next, in the case where the data processing operation is a logical judgment, the number of differences is obtained based on the database query result. By comparing each row of the migrated data with the original data, the number of differences is calculated. Then, according to the number of differences, the corresponding percentage is calculated. This percentage represents the accuracy and integrity of the data migration.
[0100] Finally, based on the magnitude relationship between the percentage and the preset percentage threshold, and the magnitude relationship between the number of differences and the preset difference threshold, it is determined whether the database query result passes the verification. If the verification fails, the error information in the database is sent to the management personnel for timely processing and repair of the problems that occur during the data migration process.
[0101] Through this embodiment, the automated test of the data verification script is successfully realized, which can quickly and accurately compare the differences between the migrated data and the original data, and timely discover and repair potential data problems. This not only improves the test efficiency and accuracy, but also ensures the quality and reliability of the data migration.
[0102] In an embodiment of the present application, in the application scenario of the data verification script, in order to ensure the accuracy and integrity of the data, the server first performs dimension verification on the database to check whether the range, format, and rules of the data meet the preset requirements. For example, verify whether the length, type, format, and constraint conditions of the data meet the standards. Through this verification, the correctness and consistency of the data can be ensured.
[0103] Next, an error list is initialized. This list is used to store the error information found during the data verification process. The error list can be a data structure such as an array, list, or set, which is used to store different types and quantities of error information.
[0104] Then, query the data to be queried in the database. Use a query statement to retrieve the data that needs to be verified and ensure the accuracy and integrity of the query results. The query statement can be an SQL statement or other relevant database query languages.
[0105] Next, traverse the database query results, check the data row by row, and perform comparison and verification based on the content and rules of the data. By traversing the query results, the order of the formal table and the test table can be determined for subsequent data comparison and verification.
[0106] When generating the data query statements corresponding to the test table and the formal table, conditional statements, judgment logic, and loop structures can be used to construct the query statements. These statements can be customized according to the attributes and rules of the data to ensure the accuracy and consistency of the data.
[0107] Finally, execute the data query statement and obtain the corresponding query results. Compare the query results with the expected results and record any differences or error messages. These messages will be stored in the error list for subsequent analysis and processing.
[0108] Through this embodiment, the automated test of the data verification script is successfully implemented, which can quickly and accurately check the dimensions and rules of the data and promptly discover and record any potential errors or inconsistencies. This not only improves the test efficiency and accuracy but also ensures the accuracy and integrity of the data.
[0109] In an embodiment of the present application, in a specific software development project, it is decided to adopt an efficient automated test method to improve the test quality and efficiency. This project involves a newly developed office software that includes both desktop applications and web applications, so comprehensive desktop testing and web testing are required.
[0110] First, according to the test requirements of the project, the test team clarified each to-be-implemented function to be tested. For example, a key function: "File upload and download" was determined, which is reflected in both the desktop application and the web application. Then, the test team found the function button corresponding to the "File upload and download" function on the software interface. In the desktop application, this function button is located under the "File" option in the main menu; in the web application, it is located in the navigation bar at the top of the page.
[0111] Then, the testers triggered these two function buttons respectively. After triggering the buttons, the software would pop up the corresponding configuration window, asking the user to select the file to upload or specify the download location. According to the preset test plan, the testers filled in the corresponding parameters in the configuration window and confirmed these configuration information. Subsequently, the test system automatically executed the corresponding test scripts based on these configuration information. In the desktop application, the test scripts simulated the operations of the user selecting a file, uploading the file, and downloading the file; in the web application, the test scripts simulated the operations of the user browsing the web page, clicking the upload button, selecting the file to upload, and triggering the download link.
[0112] After the test scripts were executed, the test system started to run the test cases corresponding to the configuration information. These test cases covered all aspects of the file upload and download functions, including file type support, file size limit, upload and download speed, and error handling, etc. Finally, the test system generated a detailed test report. The report recorded the execution status, test results, and any errors or problems found for each test case. These reports were submitted to the development team for review so that they could quickly locate and fix potential problems.
[0113] The above is the method embodiment proposed by this application. Based on the same inventive concept, this application embodiment also provides an auxiliary test device, and its structure is as Figure 2 shown.
[0114] Figure 2 It is a schematic internal structure diagram of an auxiliary test device provided by this application embodiment. As Figure 2 shown, the device includes:
[0115] An acquisition module 201, configured to acquire the test requirements of the user and determine the application scenario of the corresponding item to be tested according to the test requirements;
[0116] A configuration module 202, configured to write test scripts in the application scenario according to the application scenario corresponding to the item to be tested, and perform business configuration on the item to be tested in the application scenario, so as to add the corresponding configuration information to the corresponding test scripts;
[0117] An association module 203, configured to determine the configuration information corresponding to the item to be tested through a preset configuration information module, and associate the configuration information and the corresponding test scripts to a preset function button.
[0118] Figure 3 It is a schematic internal structure diagram of an electronic device provided by this application embodiment. As Figure 3 shown, the device includes:
[0119] At least one processor;
[0120] and a memory communicatively connected to at least one processor;
[0121] Wherein, the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable at least one processor to execute the auxiliary testing method described in any of the above embodiments.
[0122] In one embodiment of the present application, the above-mentioned processor is capable of executing: obtaining the test requirements of the user, and determining the application scenario corresponding to the item to be tested according to the test requirements;
[0123] According to the application scenario corresponding to the item to be tested, writing a test script for the application scenario, and performing business configuration on the item to be tested in the application scenario to add the corresponding configuration information to the corresponding test script;
[0124] Determine the configuration information corresponding to the item to be tested through a preset configuration information module, and associate the configuration information with the corresponding test script to a preset function button.
[0125] The embodiment of the present application also provides a non-volatile computer storage medium storing computer-executable instructions, and the computer can execute the auxiliary testing method described in any of the above embodiments when executing the executable instructions.
[0126] In one embodiment of the present application, the above-mentioned processor is capable of executing: obtaining the test requirements of the user, and determining the application scenario corresponding to the item to be tested according to the test requirements;
[0127] According to the application scenario corresponding to the item to be tested, writing a test script for the application scenario, and performing business configuration on the item to be tested in the application scenario to add the corresponding configuration information to the corresponding test script;
[0128] Determine the configuration information corresponding to the item to be tested through a preset configuration information module, and associate the configuration information with the corresponding test script to a preset function button.
[0129] Each embodiment in the present application is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key points of each embodiment are the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.
[0130] The above description relates to specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0131] The devices and media provided in the embodiments of the present application correspond one-to-one with the methods. Therefore, the devices and media also have beneficial technical effects similar to those of their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be elaborated here.
[0132] Those skilled in the art will understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0133] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices produce means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0134] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 steps of the functions specified in one block or multiple blocks.
[0136] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0137] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
[0138] Computer-readable media includes permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0139] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, commodity or device comprising the element.
[0140] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. An auxiliary testing method, characterized in that, The method includes: Obtain the test requirements of the user, and determine the application scenario of the item to be tested according to the test requirements; According to the application scenario corresponding to the item to be tested, write a test script for the application scenario, and perform business configuration on the item to be tested in the application scenario, so as to add the corresponding configuration information to the corresponding test script; Through a preset configuration information module, determine the configuration information corresponding to the item to be tested, and associate the configuration information and the corresponding test script to a preset function button.
2. The auxiliary test method according to claim 1, characterized in that, After associating the configuration information and the corresponding test script to the preset function button, the method further includes: Determine the function to be implemented corresponding to the test requirements, and determine the function button corresponding to the function to be implemented; Trigger the function button to obtain the corresponding configuration information and execute the test script corresponding to the configuration information; Run the test case corresponding to the configuration information and generate a corresponding test report to achieve assisted testing; the assisted testing includes desktop testing and web testing.
3. An auxiliary test method according to claim 1, characterized in that, After obtaining the test requirements of the user, the method further includes: In the class of the window application framework, create a corresponding instance based on the initialization function, and perform corresponding processing operations through static methods; the processing operations include writing messages, printing information, and clearing operations; Based on the desktop assisted testing tool, create a program instance corresponding to the class of the window application framework to instantiate the class of the window application framework.
4. An auxiliary test method according to claim 2, wherein The triggering of the function button to obtain the corresponding configuration information and execute the test script corresponding to the configuration information specifically includes: In the case where the application scenario corresponding to the item to be tested is a mobile phone screenshot, save the local directory of the corresponding screenshot, and print the start screenshot operation in the application scenario of the mobile phone screenshot based on the function to be referenced corresponding to the item to be tested; Obtain the current time corresponding to the printing operation, and determine the screenshot file name of the corresponding screenshot file according to the current time; Based on the execution of the screenshot command, pull the screenshot file to the local directory, and print the screenshot completion task in the application scenario of the mobile phone screenshot to complete the mobile phone screenshot operation.
5. An auxiliary test method according to claim 2, characterized in that The triggering of the function button to obtain the corresponding configuration information and execute the test script corresponding to the configuration information specifically includes: In the case where the application scenario is to install an apk package, define a corresponding apk package installation function based on the installation requirements of the apk package, and print the start screenshot operation in the application scenario of installing the apk package based on the apk package installation function; Based on the preset command of the Android terminal corresponding to the application scenario of installing the apk package, install the apk package to the corresponding Android terminal and obtain the execution result corresponding to the Android terminal; Print the execution result and print the installation completion task of the apk package in the Android terminal to complete the installation operation of the apk package.
6. An auxiliary test method according to claim 2, characterized in that, The triggering of the function button to obtain the corresponding configuration information and execute the test script corresponding to the configuration information specifically includes: When the application scenario is a data verification script, corresponding data processing operations are performed on the project to be tested based on a preset line number verification function corresponding to a big data migration task; the data processing operations include: database query and logical judgment; When the data processing operation is a database query, data to be obtained corresponding to a database query request is obtained from the database to obtain a corresponding database query result, and the database query result is stored in a variable; When the data processing operation is a logical judgment, the number of differences is obtained based on the database query result, and a corresponding percentage is calculated according to the number of differences; Based on the size relationship between the percentage and a preset percentage threshold, and the size relationship between the number of differences and a preset difference threshold, it is determined whether the database query result passes, and when it does not pass, error information in the database is sent to the management personnel to implement line number verification of the data verification script.
7. An auxiliary test method according to claim 2, characterized in that Triggering the function button to obtain corresponding configuration information and execute the test script corresponding to the configuration information specifically includes: When the application scenario is a data verification script, dimension verification of the database is performed, and an error list is initialized to store error information through the error list; Querying data to be queried in the database to obtain a corresponding database query result, and traversing the database query result to determine the order of the formal table and the test table according to the traversal result; Generating data query statements corresponding to the test table and the formal table, executing the data query statements, obtaining corresponding query results, and storing error information in the error list based on the query results.
8. An auxiliary test method according to claim 1, characterized in that After obtaining the test requirements of the user, the method further includes: Configuring the path information corresponding to the core configuration information document, the path information corresponding to the script event-driven document, and the path information corresponding to the page style document according to the test requirements; Determining the startup entry corresponding to the desktop auxiliary tool, and respectively packaging each document information into corresponding running files based on the corresponding path information.
9. An auxiliary test device, characterized in that, The device includes: An acquisition module, configured to acquire the test requirements of the user and determine the application scenario of the project to be tested corresponding to the test requirements; A configuration module, configured to write a test script in the application scenario according to the application scenario corresponding to the project to be tested, and perform service configuration on the project to be tested in the application scenario, so as to add corresponding configuration information to the corresponding test script; An association module, configured to determine the configuration information corresponding to the project to be tested through a preset configuration information module, and associate the configuration information and the corresponding test script to a preset function button.
10. An electronic device, characterized in that, The device includes: At least one processor; And a memory communicatively connected to the at least one processor; Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute an auxiliary test method according to any one of claims 1-8.
11. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, When the computer executes the executable instructions, it implements an auxiliary testing method as described in any one of claims 1-8.