Automated testing method and automated testing device
By constructing test data files and driving big data and interface automation testing, the problem of complex test data construction in data analysis scenarios and the inability to cover big data processing logic in interface tests is solved, efficient automated testing is achieved, reducing manpower investment and improving test quality.
Patent Information
- Application Number
- CN202311648696.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2043-12-04
AI Technical Summary
In data analysis scenarios, there are three difficulties in implementing automated tests: the big data batch processing module is independent of the backend interface, which makes it impossible to cover the processing logic of the big data module through interface automation tests; the test data structure is complex, the associated systems are many, and the business dimensions are wide; the test scenarios are complex, the data correctness verification is difficult, and the traditional way of implementing automated tests is complicated and the workload is huge.
By constructing a test data file, using two-dimensional coordinate analysis method and attribute clustering method to extract keywords and generate keyword dictionaries. Fill in the key field collection and not keyword fields are filled in according to the preset format to obtain the test data file. Then, according to the test data file, big data automation testing and interface automation testing are driven separately to realize the deployment of test cases for data analysis scenarios.
It realizes test data automation structure, big data module automation testing and interface automation testing for data analysis scenarios, solves the problem of complex test data structure and difficult interface testing to cover big data processing logic and data accuracy verification, reduces test manpower investment, and improves the efficiency and quality of automated testing.
Smart Images

Figure CN117827644B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated testing technology, and in particular to an automated testing method and an automated testing device. Background Art
[0002] In the data analysis scenario, the main system receives the data of the related systems through the enterprise data bus, batch processes the data on the big data platform, synchronizes the data to the data aggregation layer, and displays the data on the front end after analysis. The data analysis scenario implemented based on this architecture has three difficulties in the implementation of automated testing: First, because the big data batch processing module is relatively independent of the back-end interface, the processing logic of the big data module cannot be directly covered by interface automated testing in the automated implementation. Second, there are many related systems and wide business dimensions in the data analysis scenario, which leads to complex test data construction. Third, the test scenario is complex and it is difficult to verify the correctness of the data. The automated testing process implemented in the traditional way is complex and the workload is huge.
[0003] In the related art, due to confidentiality requirements during the testing phase, the test scenario cannot obtain the real data pushed by the associated system. In order to fully test the data analysis scenario, testers are required to construct relevant test data according to business logic. Summary of the invention
[0004] The embodiments of the present application provide an automated testing method and an automated testing device to quickly implement automated testing deployment in data analysis scenarios.
[0005] The present application embodiment adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides an automated testing method, wherein the method comprises:
[0007] Construct test data file;
[0008] According to the test data file, big data automated testing and interface automated testing are driven respectively to implement test case deployment for data analysis scenarios.
[0009] In some embodiments, constructing a test data file includes:
[0010] Extract keywords and generate a keyword dictionary based on the full data interface file and data analysis business scenarios;
[0011] Perform keyword attribute analysis according to the keyword dictionary to obtain a keyword attribute analysis file;
[0012] The key field set is filled in according to the keyword attribute analysis file, and the non-keyword fields are filled in according to a preset format to obtain a test data file.
[0013] In some embodiments, extracting keywords and generating a keyword dictionary includes:
[0014] The two-dimensional coordinate analysis method is used, with the horizontal axis representing the frequency of occurrence of each field in the interface file, and the vertical axis representing the importance of each field in the business scenario;
[0015] Calculate the axis area of each field to determine the priority order;
[0016] According to the priority order, extract the fields of high priority tests to generate a keyword dictionary;
[0017] The obtaining of the keyword attribute analysis file includes:
[0018] Use attribute clustering method to analyze keyword dictionary and obtain the attribute relationship between different keywords;
[0019] The keywords are clustered into different clusters according to any one or more attributes of inheritance, inclusion, size, and hierarchy in the attribute relationship, and an attribute analysis file is generated.
[0020] In some embodiments, the method further comprises:
[0021] Generate an XML format data file according to the test data file;
[0022] The XML format data file is stored.
[0023] In some embodiments, driving the big data automated test and the interface automated test respectively according to the test data file includes: the steps of driving the big data automated test according to the test data file:
[0024] According to the XML format data file, trigger the data processing task in the data analysis scenario, and generate first test data according to the test data file;
[0025] Based on the big data processing logic, the XML format data file is used as a data driver to generate first target data;
[0026] Comparing the first test data and the first target data for consistency according to the MD5 value of the data file and the test keyword set;
[0027] If the first test data is consistent with the first target data, the corresponding test case is saved;
[0028] If the first data to be tested is inconsistent with the first target data, a failure report of the test case is generated.
[0029] In some embodiments, the step of driving the big data automated test and the interface automated test according to the test data file includes: the step of driving the interface automated test according to the test data file:
[0030] Generate an interface request parameter file based on the interface parameters to be tested and the data analysis scenario;
[0031] Generate second test data returned by the interface according to the interface request parameter file;
[0032] According to the interface request parameter file, query and match the second target data in the database;
[0033] Comparing the second test data with the second target data to see whether they are consistent according to the data file MD5 value and the test keyword set;
[0034] If the second test data is consistent with the second target data, the corresponding test case passes;
[0035] If the second to-be-tested data is inconsistent with the second target data, a failure report of the test case is generated.
[0036] In some embodiments, searching and matching the second target data in a database according to the interface request parameter file includes:
[0037] According to the interface request parameter file, the data to be tested saved after the big data automated test is searched in the database, and the second target data is obtained by matching.
[0038] In a second aspect, an embodiment of the present application further provides an automated testing device, wherein the device comprises:
[0039] Construction module, used to construct test data files;
[0040] The test module drives the big data automated test and the interface automated test respectively according to the test data file, so as to realize the deployment of test cases for data analysis scenarios.
[0041] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to perform the above method.
[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes the above method.
[0043] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: by constructing a test data file, and then driving the big data automated test and the interface automated test respectively according to the test data file, the test case deployment for the data analysis scenario is realized. Through the above method, the automated construction of test data, the automated testing of big data modules and the automated testing of interfaces in the data analysis scenario are realized, which solves the problems of the difficulty of constructing test data in the data analysis scenario, the inability of interface testing to cover the big data processing logic and the data accuracy verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] 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 of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0045] Figure 1 This is a flow chart of the automated testing method in the embodiment of the present application;
[0046] Figure 2 This is a schematic diagram of the overall process of the automated testing method in the embodiment of the present application;
[0047] Figure 3 This is a schematic diagram of the test data construction process in the automated testing method in an embodiment of the present application;
[0048] Figure 4 This is a schematic diagram of the automated testing process for the big data part in the automated testing method in the embodiment of the present application;
[0049] Figure 5 This is a schematic diagram of the interface automation test process in the automation test method in the embodiment of the present application;
[0050] Figure 6 This is a schematic diagram of the structure of the automated testing device in the embodiment of the present application;
[0051] Figure 7 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0053] The technical terms in the embodiments of this application are as follows:
[0054] Two-dimensional coordinate analysis method: Use key information to form horizontal and vertical coordinates, and screen out high-value indicators through quantitative coordinate analysis.
[0055] Attribute clustering analysis method: According to the data attributes, large-scale data sets are divided into several clusters, the data within the clusters are similar to each other, and the data between clusters are different from each other.
[0056] RF (Robot Framework): Developed based on Python language, it is an open source and extensible automated testing framework that supports keyword-driven testing.
[0057] KDT (Keyword-driven testing): Keyword-driven, the test logic is encapsulated in the data file in the form of keywords, and the testing tool implements automated testing by interpreting keywords.
[0058] DDT (Data-Driven Tests): Data-driven, reads test data from a data file and then passes it into the test script through variables.
[0059] MD5 (Message-Digest Algorithm): A cryptographic hash function that generates a 128-bit hash value for input information to ensure the integrity of information transmission.
[0060] Common automated testing techniques are mainly divided into three categories: recording and playback testing, script testing, and data-driven testing. Recording and playback testing generates test scripts by recording the operation process. The operation is simple, but each test scenario needs to be recorded one by one, and test case reuse is not possible. Script testing uses programming languages to write automated test cases containing logical sequences, which has high maintenance costs. If the scenario implementation logic changes, the test scripts need to be modified one by one. Data-driven testing parameters the data files into the test scripts. Different data files correspond to different test cases, which greatly improves the utilization rate of test scripts and reduces test maintenance costs.
[0061] Combining the advantages and disadvantages of the above-mentioned commonly used testing methods, the inventors considered using a combination of automated test data construction and data-driven testing to achieve automated testing of data analysis scenarios, in order to solve the problems of complex test data construction and difficult data accuracy verification in data analysis scenario testing.
[0062] In view of the above-mentioned deficiencies, the automated testing method in the embodiment of the present application constructs test data in an automated manner, reduces the reliance on associated system data during the test phase, and improves test efficiency. In the process of generating test data, XML, a common data exchange language widely used in the industry, is adopted, which provides convenience for the implementation of data analysis scenarios. In the data analysis scenario, the verification of the correctness of logical functions and data processing is carried out by implementing automated testing based on the RF framework. This method can quickly implement automated testing of data analysis scenarios, reduce the manpower input of manual testing, and ensure high-quality testing of data analysis scenarios.
[0063] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0064] The present application embodiment provides an automated testing method, such as Figure 1 As shown, a schematic flow chart of an automated testing method in an embodiment of the present application is provided, wherein the method at least includes the following steps S110 to S120:
[0065] Step S110, constructing a test data file.
[0066] Specifically, in the testing of data analysis scenario functions, data correctness is the most important, and testers need to invest a lot of manpower to ensure that the data is correct. When constructing test data files, decoupling from subsequent big data automated testing and interface automated testing can reduce the complexity of test data construction in data analysis scenarios and simplify the construction of test data files.
[0067] Decouple test data construction from big data processing testing and interface testing logic, shorten the test path, and use data-driven and keyword-driven methods in the automated testing process to simplify the automated testing process, making it easier to respond to relevant scenario function upgrades in a timely manner and perform targeted regression testing.
[0068] Step S120, driving big data automated testing and interface automated testing respectively according to the test data file to implement test case deployment for data analysis scenarios.
[0069] like Figure 2 As shown, according to the test data file obtained in the above steps, big data automated testing and interface automated testing are driven in turn, so that the automated test case deployment of data analysis scenarios can be quickly realized, the investment in testing manpower can be reduced, and the efficiency and quality of automated testing of data analysis scenarios can be greatly improved.
[0070] It should be noted that since the constructed test data file does not have the specificity of the data analysis scenario, it needs to be tested by big data automation first. In the data analysis scenario, there are many related systems and a wide range of business dimensions. After the big data automation test, the relevant test data can be constructed and screened according to the business logic. This is conducive to the deployment of test cases for the subsequent interface automation test.
[0071] Through the above method, the data and keyword-driven approach is used in the process of automated testing to reduce the complexity of automated testing and improve the efficiency and quality of iterative regression testing. Automated testing is provided specifically for data analysis scenarios, solving the problems of complex test data structure in data analysis scenarios, the inability of interface testing to cover big data processing logic, and the difficulty in verifying data accuracy. By modifying test data and parameters, the automated test case deployment of data analysis scenarios can be quickly realized, reducing the investment in testing manpower and greatly improving the efficiency and quality of automated testing of data analysis scenarios.
[0072] Different from the related art, which uses sample data analysis to generate test data, the above method uses keyword dictionaries and attribute clustering to construct test data, solving the problem of complex test data construction in data analysis scenarios. Different from the related art, which uses test instructions to execute the test process, the above method uses keyword dictionaries and test data to trigger data analysis scenario automation testing, quickly realizing the deployment of automated test cases for data analysis scenarios, and reducing the investment in testing manpower.
[0073] In one embodiment of the present application, constructing a test data file includes: extracting keywords and generating a keyword dictionary based on a full data interface file and a data analysis business scenario; performing keyword attribute analysis based on the keyword dictionary to obtain a keyword attribute analysis file; filling in a key field set based on the keyword attribute analysis file, and filling in non-keyword fields according to a preset format to obtain a test data file.
[0074] Please refer to Figure 3 ,In the process of constructing test data, keyword and data driven methods are ,adopted to complete test data design and construction.
[0075] The keyword dictionary is designed based on the two-dimensional coordinate analysis method to provide key input parameters for the test data automation construction implementation and generate the keyword dictionary D1. By analyzing the full data interface files and business scenarios, keywords are extracted and the keyword dictionary D1 is generated.
[0076] It should be noted that the above keyword extraction adopts a two-dimensional coordinate analysis method, where the horizontal axis represents the frequency of occurrence of each field in the interface file, and the vertical axis represents the importance of each field in the business scenario. Finally, the coordinate axis area of each field is calculated to determine the priority order, and the fields with high priority tests are extracted to generate the keyword dictionary D1. For example: the frequency of occurrence of field 1, field 2, field 3, and field 4 are 4, 5, 2, and 6 respectively, and are placed on the horizontal axis of the coordinate; the importance of field 1, field 2, field 3, and field 4 are 8, 4, 7, and 9 respectively, and are placed on the vertical axis of the coordinate; the calculated coordinate areas of field 1, field 2, field 3, and field 4 are 32, 20, 14, and 54; then field 4 and field 1 are determined to be high priority fields according to the area and are included in the keyword dictionary D1.
[0077] In one embodiment of the present application, the extraction of keywords and generation of a keyword dictionary includes: using a two-dimensional coordinate analysis method, with the horizontal axis representing the frequency of occurrence of each field in the interface file, and the vertical axis representing the importance of each field in the business scenario; calculating the coordinate axis area of each field to determine the priority order; based on the priority order, extracting fields for high priority tests to generate a keyword dictionary; obtaining a keyword attribute analysis file includes: using an attribute clustering method to analyze the keyword dictionary to obtain attribute relationships between different keywords; clustering the keywords into different clusters based on any one or more attributes of inheritance, inclusion, size, and hierarchy in the attribute relationship to generate an attribute analysis file.
[0078] When keywords are extracted and keyword dictionaries are generated, keyword attribute analysis is performed. The attribute clustering method is used to analyze the keyword dictionary, measure the attribute relationship between different keywords, cluster the keywords into different clusters according to the attributes such as inheritance, inclusion, size, and hierarchy, and generate attribute file N1. Take the data analysis scenario in the financial field as an example, for example: institution keywords, the superior institution includes the subordinate institution; the credit limit is greater than the loan balance, etc.
[0079] The above process uses attribute clustering method to analyze and design test data, measure the attribute relationship between different keywords, and ensure that the test data design is consistent with the business scenario.
[0080] Furthermore, the test data file F2 is designed in a data-driven manner. By comparing the test data file F1 with the keyword dictionary D1, common fields are extracted to generate a key field set K1. The key field set K1 is filled in according to the attribute file N1, and non-key fields can be filled in according to a fixed format, and finally the test data file F2 is generated.
[0081] In one embodiment of the present application, the method further includes: generating an XML format data file according to the test data file; and storing the XML format data file.
[0082] Preferably, the automated data generation platform reads the test data file F2, converts it into an XML format data file X1 according to the test requirements and stores it in the server. The format and quantity of the generated data file X1 are consistent with the design.
[0083] In one embodiment of the present application, big data automated testing and interface automated testing are driven respectively according to the test data file, including: the step of driving the big data automated testing according to the test data file: triggering the data processing task in the data analysis scenario according to the XML format data file, and generating first test data according to the test data file; based on the big data processing logic, using the XML format data file as a data driver to generate first target data; comparing whether the first test data and the first target data are consistent according to the data file MD5 value and the test keyword set; if the first test data and the first target data are consistent, saving the corresponding test case; if the first test data and the first target data are inconsistent, generating a failure report for the test case.
[0084] Please refer to Figure 4 , the constructed test data file X1 drives the automated test process, and finally the test results are judged by keyword comparison.
[0085] First, generate the test data S1. In this step, the XML file X1 is used as input to automatically trigger the data processing task in the data analysis scenario, and generate multiple test data S1 according to the design in the test file F1.
[0086] At the same time, the target data D1 is generated. The generated XML format data file X1 is imported into the big data partial automation test module, which implements the processing logic of the big data module, uses the test data X1 as a driver, pre-processes the data in the XML file, and generates the target data D1.
[0087] Furthermore, it is necessary to compare the test data S1 with the target data D1. According to the required database table fields and the test scenario, determine the test keyword set K2. According to K2 and the MD5 value of the data file, complete the comparison of the test data S1 and the target data D1. If the data comparison of S1 and D1 is consistent, the test case passes and the data is saved to the database. If not, the test case fails and the test report of this case is output.
[0088] It should be noted that the target data D1 is obtained by the big data test module and stored in the database, so that it can be compared with the generated test data S1 to determine whether they are consistent.
[0089] By using the file MD5 value, data file content comparison can be completed in automated testing scenarios, omitting traditional steps such as data parsing and word-by-word comparison, thus simplifying the overall comparison process.
[0090] It can be understood that the above process can modify the test data and related parameters to quickly deploy automated test cases for data analysis scenarios.
[0091] In one embodiment of the present application, the method of driving big data automated testing and interface automated testing according to the test data file includes: the step of driving the interface automated testing according to the test data file: generating an interface request parameter file according to the interface parameters to be tested and the data analysis scenario; generating second test data returned by the interface according to the interface request parameter file; querying and matching second target data in a database according to the interface request parameter file; comparing whether the second test data is consistent with the second target data according to the data file MD5 value and the test keyword set; if the second test data is consistent with the second target data, the corresponding test case passes; if the second test data is inconsistent with the second target data, a failure report for the test case is generated.
[0092] Developed based on the RF automated testing framework, the interface automated testing is implemented using keyword and data-driven methods.
[0093] Please refer to Figure 5 , the interface test request parameter file F3 is designed first. After analyzing the interface parameters to be tested and combining with the data analysis scenario, the interface request input keyword set K3 is determined. Based on the keywords combined with K3, the interface test request parameter file F3 is designed, which serves as the interface automation test input.
[0094] Furthermore, the test data S2 is generated. This step is implemented using the RF automated test framework, the interface request parameter file S2 is used as the input of this step, an interface request is initiated according to relevant design parameters, and the test data S2 returned by the interface is obtained.
[0095] Finally, by comparing the data to be tested S2 with the pre-acquired target data D2, the keyword screening method is used to determine the keyword set K4 of the interface return result, and the comparison between the data to be tested S2 and the target data D2 is completed based on the keyword set K4 and the MD5 value of the data file. If they are consistent, the test case passes, if they are inconsistent, the case fails, and the test report is output, and the failure reason is given in detail.
[0096] It can be understood that the above process can modify the test data (test data S2) and related parameters (interfaces) to quickly deploy automated test cases for data analysis scenarios.
[0097] In one embodiment of the present application, querying and matching the second target data in the database according to the interface request parameter file includes: querying the data to be tested saved after the big data automated test in the database according to the interface request parameter file, and matching and obtaining the second target data.
[0098] The database is queried according to the parameter design of the interface request file to obtain the target data D2. The target data D2 is generated by preprocessing the data in the XML file using the test data X1 as a driver, and the target data D2 is obtained based on the processing logic of the big data module.
[0099] The present application embodiment also provides an automated testing device 600, such as Figure 6 As shown, a schematic diagram of the structure of an automated testing device in an embodiment of the present application is provided, wherein the device 600 at least includes: a construction module 610 and a testing module 620, wherein:
[0100] In one embodiment of the present application, the construction module 610 is specifically used to: construct a test data file.
[0101] Specifically, in the testing of data analysis scenario functions, data correctness is the most important, and testers need to invest a lot of manpower to ensure that the data is correct. When constructing test data files, decoupling from subsequent big data automated testing and interface automated testing can reduce the complexity of test data construction in data analysis scenarios and simplify the construction of test data files.
[0102] Decouple test data construction from big data processing testing and interface testing logic, shorten the test path, and use data-driven and keyword-driven methods in the automated testing process to simplify the automated testing process, making it easier to respond to relevant scenario function upgrades in a timely manner and perform targeted regression testing.
[0103] In one embodiment of the present application, the test module 620 is specifically used to: drive big data automated testing and interface automated testing respectively according to the test data file, to implement test case deployment for data analysis scenarios.
[0104] According to the test data file obtained in the above module, big data automated testing and interface automated testing are driven in turn, so that the automated test case deployment of data analysis scenarios can be quickly realized, the investment in testing manpower can be reduced, and the efficiency and quality of automated testing of data analysis scenarios can be greatly improved.
[0105] It should be noted that since the constructed test data file does not have the specificity of the data analysis scenario, it needs to be tested by big data automation first. In the data analysis scenario, there are many related systems and a wide range of business dimensions. After the big data automation test, the relevant test data can be constructed and screened according to the business logic. This is conducive to the deployment of test cases for the subsequent interface automation test.
[0106] It can be understood that the above-mentioned automated testing device can implement each step of the automated testing method provided in the above-mentioned embodiment, and the relevant explanations about the automated testing method are applicable to the automated testing device and will not be repeated here.
[0107] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 7 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0108] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0109] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0110] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming an automated test device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0111] Construct test data file;
[0112] According to the test data file, big data automated testing and interface automated testing are driven respectively to implement test case deployment for data analysis scenarios.
[0113] The above application Figure 1 The method performed by the automated test device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0114] The electronic device may also perform Figure 1 The method for executing the automated test device in Figure 1 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0115] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 1 The method performed by the automated testing device in the illustrated embodiment is specifically used to perform:
[0116] Construct test data file;
[0117] According to the test data file, big data automated testing and interface automated testing are driven respectively to implement test case deployment for data analysis scenarios.
[0118] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention 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.) containing computer-usable program code.
[0119] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes 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 a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0120] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0122] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0123] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0124] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape 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 temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0125] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0126] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt 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.
[0127] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. An automated testing method, wherein: The method comprises: Construct test data file; The constructing of the test data file comprises: Extract keywords and generate a keyword dictionary based on the full data interface file and data analysis business scenarios; Perform keyword attribute analysis according to the keyword dictionary to obtain a keyword attribute analysis file; Fill in a key field set according to the keyword attribute analysis file, and fill in non-keyword fields according to a preset format to obtain a test data file; The extracting of keywords and generating a keyword dictionary includes: The two-dimensional coordinate analysis method is used, with the horizontal axis representing the frequency of occurrence of each field in the interface file, and the vertical axis representing the importance of each field in the business scenario; Calculate the axis area of each field to determine the priority order; According to the priority order, extract the fields of high priority tests to generate a keyword dictionary; The obtaining of the keyword attribute analysis file includes: Use attribute clustering method to analyze keyword dictionary and obtain the attribute relationship between different keywords; Clustering keywords into different clusters according to any one or more attributes of inheritance, inclusion, size, and hierarchy in the attribute relationship, and generating an attribute analysis file; According to the test data file, big data automated testing and interface automated testing are driven respectively to implement test case deployment for data analysis scenarios.
2. The method of claim 1, wherein: The method further comprises: Generate an XML format data file according to the test data file; The XML format data file is stored.
3. The method of claim 2, wherein: Driving the big data automated test and the interface automated test respectively according to the test data file includes: driving the big data automated test according to the test data file: According to the XML format data file, trigger the data processing task in the data analysis scenario, and generate first test data according to the test data file; Based on the big data processing logic, the XML format data file is used as a data driver to generate first target data; Comparing the first test data and the first target data for consistency according to the MD5 value of the data file and the test keyword set; If the first test data is consistent with the first target data, the corresponding test case is saved; If the first data to be tested is inconsistent with the first target data, a failure report of the test case is generated.
4. The method of claim 1, wherein: The step of driving the big data automated test and the interface automated test according to the test data file comprises: the step of driving the interface automated test according to the test data file: Generate interface request parameter files based on the interface parameters to be tested and the data analysis scenario; Generate second test data returned by the interface according to the interface request parameter file; According to the interface request parameter file, query and match the second target data in the database; Comparing the second test data with the second target data to see whether they are consistent according to the MD5 value of the data file and the test keyword set; If the second test data is consistent with the second target data, the corresponding test case passes; If the second to-be-tested data is inconsistent with the second target data, a failure report of the test case is generated.
5. The method of claim 4, wherein: The querying and matching the second target data in the database according to the interface request parameter file includes: According to the interface request parameter file, the data to be tested saved after the big data automated test is searched in the database, and the second target data is obtained by matching.
6. An automated testing device, wherein: The device comprises: Construction module, used to construct test data files; The constructing of the test data file comprises: Extract keywords and generate a keyword dictionary based on the full data interface file and data analysis business scenarios; Perform keyword attribute analysis according to the keyword dictionary to obtain a keyword attribute analysis file; Fill in a key field set according to the keyword attribute analysis file, and fill in non-keyword fields according to a preset format to obtain a test data file; The extracting of keywords and generating a keyword dictionary includes: The two-dimensional coordinate analysis method is used, with the horizontal axis representing the frequency of occurrence of each field in the interface file, and the vertical axis representing the importance of each field in the business scenario; Calculate the axis area of each field to determine the priority order; According to the priority order, extract the fields of high priority tests to generate a keyword dictionary; The obtaining of the keyword attribute analysis file includes: Use attribute clustering method to analyze keyword dictionary and obtain the attribute relationship between different keywords; Clustering keywords into different clusters according to any one or more attributes of inheritance, inclusion, size, and hierarchy in the attribute relationship, and generating an attribute analysis file; The test module drives the big data automated test and the interface automated test respectively according to the test data file, so as to realize the deployment of test cases for data analysis scenarios.
7. An electronic device comprising: processor; as well as A memory arranged to store computer executable instructions, which when executed cause the processor to perform the method of any one of claims 1 to 5.
8. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, causes the electronic device to execute any one of the methods of claims 1 to 5.
Citation Information
Patent Citations
Method and device for obtaining correlated keywords of keywords
CN104408191A
Automatic generation system and method for case keywords
CN112286813A
Automatic data creation method and device based on big data testing
CN116383049A