CN112363951A - Test method for separation of test scene and test data - Google Patents
Test method for separation of test scene and test data Download PDFInfo
- Publication number
- CN112363951A CN112363951A CN202011395393.2A CN202011395393A CN112363951A CN 112363951 A CN112363951 A CN 112363951A CN 202011395393 A CN202011395393 A CN 202011395393A CN 112363951 A CN112363951 A CN 112363951A
- Authority
- CN
- China
- Prior art keywords
- test
- data
- scene
- scenario
- scenes
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a matrix decomposition collaborative filtering method and a matrix decomposition collaborative filtering system for coupling social trust information, which comprise the following steps: splitting the test scenes according to the test requirements, and analyzing the test data required by each test scene; acquiring test data required by each test scene through an automation tool; executing a test through the generated test data and the corresponding test scene to obtain scene test output data; and comparing the test output with an expected result to obtain a test result. The software test is executed by a test method with a test scene separated from test data, so that the data required by the test scene can be quickly acquired, and the test time and efficiency are greatly improved; and test function points can be comprehensively covered, and function missing test is avoided. The testing method is suitable for projects with short iteration cycles and frequent iteration cycles, such as industrial internet projects, ERP projects and the like.
Description
Technical Field
The invention relates to the field of manufacturing industry and the Internet, in particular to a test method for separating a test scene from test data.
Background
With the development of the industrial internet industry, the function iteration of an industrial software system is faster and faster, and in order to not influence the production benefit of a factory, the version release period is shorter and shorter, so that some automatic test tools and scripts are needed to complete the test process. Generally, an automatic testing tool is used, manpower is not consumed, the software testing process can be accelerated, however, in industrial information system management software, a service scene is complex, multi-system, multi-platform and multi-terminal interactive testing is often involved, and a pure automatic tool testing cannot guarantee 100% coverage testing of system functions. Therefore, manual testing is still required to ensure software quality.
In a general industrial information software testing process, a function point of a scene is tested, a large amount of time is spent in processes of document creation, document approval and the like in an early stage, the testing speed is reduced, and the testing efficiency is influenced. Therefore, how to increase the testing speed of the industrial information system becomes a problem to be solved urgently in the field.
Disclosure of Invention
The invention aims to provide a test method for separating a test scene from test data, which separates the test scene process from the test data, uses an automatic tool or a script to acquire the test data required by the test scene as soon as possible, and then tests the test data, thereby ensuring the accuracy and comprehensiveness of the test result and greatly improving the test efficiency.
In order to achieve the purpose, the invention adopts the following technical scheme:
a test method relating to separation of test scenarios and test data, comprising the steps of:
splitting the test scenes according to the test requirements, and analyzing the test data required by each test scene;
acquiring test data required by each test scene through an automation tool;
executing a test through the generated test data and the corresponding test scene to obtain scene test output data;
and comparing the test output with an expected result to obtain a test result.
Further, the splitting of the test scenarios according to the test requirements and the analysis of the test data required by each test scenario include the following steps:
splitting a test scene according to requirements;
analyzing the data relation among all the test scenes;
and analyzing the type of test data and the data source required by each test scene.
Further, the test data types and sources include:
basic data of the system: directly acquiring the data from a data table corresponding to the database through the script;
parameters of the fixed format: filling in when the test scene is executed, and calling through a script when needed;
testing process data: the data are provided by test outputs of other test scenes, new scripts are required to be obtained after the other test scenes are executed, the test outputs of the other test scenes are directly set as global variables, and the data of the type are obtained, and the execution sequence of the scripts of each scene is required to be written in the scripts.
Further, the obtaining of the test data required by each test scenario through the automation tool includes: the automatic test tool executes each test script to generate data corresponding to the test scene, and test service logic is compiled according to the test scene in the automatic script compiling process to control the execution sequence of the test scene.
Further, the step of executing a test on the generated test data and the corresponding test scenario to obtain scenario test output data includes: and executing the test task under the corresponding test scene by using the test data.
Compared with the prior art, the invention has the beneficial effects that:
the test method for separating the test scene from the test data is mainly characterized in that the data required by the test scene is quickly acquired through an automation tool or an automation script, then the acquired test data is applied to the test scene to execute the test to obtain the test output, and finally the test output is compared with the expected result to obtain the test result of the test scene.
The software test is executed by a test method with a test scene separated from test data, so that the data required by the test scene can be quickly acquired, and the test time and efficiency are greatly improved; and test function points can be comprehensively covered, and function missing test is avoided. The testing method is suitable for projects with short iteration cycles and frequent iteration cycles, such as industrial internet projects, ERP projects and the like.
Drawings
FIG. 1 is a flow chart of a test method for separating test scenarios from test data according to the present invention;
FIG. 2 is a flowchart illustrating the step S001 of FIG. 1 in detail;
FIG. 3 is a type classification diagram of the test data in step S001 and step S002 of FIG. 1;
fig. 4 is a flowchart of a complex scenario combining steps S002 and S003 in fig. 1.
Detailed Description
The present invention will be further described with reference to the following examples, which are intended to illustrate only some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, other embodiments used by those skilled in the art without any creative effort belong to the protection scope of the present invention.
Embodiment 1 referring to fig. 1, a test method for separation of a test scenario and test data includes the following steps:
and S001, splitting the test scenes and analyzing the test data required by each test scene.
The main purpose of this step is to split the test scenes, analyze the relation between the scenes, and confirm the execution sequence of each scene in the test.
In an industrial internet project, service scenes are complex and often involve multi-system, multi-platform and multi-terminal interactive tests, so that before the test is executed, documents need to be explained according to requirements, each test scene needs to be split, the logic relation among the test scenes needs to be analyzed, and which test scenes need to be executed preferentially and which test scene data needs to be provided with data by other test scenes is confirmed; and analyzing the data source of each test scene, and acquiring the data source from a database table, or acquiring the execution result of other test scenes, or acquiring the data source randomly according to a certain format.
And confirming the execution sequence of the test scenes through splitting and analyzing the test scenes, thereby determining the execution sequence of the automation scripts.
In step S002, the automated test tool (or script) is used to generate data required for each test scenario.
On the basis of step S001, the main purpose of this step is to generate test scenario data by an automated test tool (script) execution, in preparation for executing a test. In the industrial internet project testing process, some testing scenes need mass production of data, such as statistics and billboard modules, data are simply created manually, a large amount of time can be consumed, and the testing progress is delayed, so that a large amount of data required by testing can be generated in a short time by executing an automatic script, the testing time is saved, and the testing efficiency is improved.
Generally, an automated testing tool executes each test script to generate data corresponding to a test scenario, but during a test process of an industrial internet project, data interaction occurs among many test scenarios, such as: the test output of the previous test scenario is the data required by the next test scenario, so that test service logic can be compiled according to the test scenarios in the automatic script compiling process, and the execution sequence of the test scenarios is controlled.
And S003, executing the test by using the test data and the test scene generated in the step S002 to obtain test output data.
On the basis of step S002, the main purpose of this step is to execute a test task under a corresponding test scenario using the test data obtained in step S002.
In the industrial internet project testing process, some testing scenes belong to important testing points, and the testing can be repeatedly carried out for avoiding missing testing and making mistakes in the production environment. For example, a production station-crossing operation is mainly performed, the operation is mainly performed by bar code station-crossing, the bar code type relates to an SN type, a mac type, an IMEI type and the like, and when data are automatically generated, station-crossing data of various bar code types are generated. When the station-crossing scene is executed, the generated bar codes are directly used, and different bar code station-crossing output data can be quickly and directly acquired.
In general, some data may be applied to different test scenarios. For example, the token output by the login system is required in other test scenarios, so that the test data token is obtained by logging in the test scenario, and then the token is set as a global variable, and the global variable of the token is directly obtained when other test scenarios are executed. So that a service scenario is executed, the resulting output data may be input data that is commonly required by other different test scenarios.
The test output is used here as a criterion for the test result, for comparison with the expected output.
And step S004, comparing the test output of the step S003 with an expected value to obtain a test result of the test scene.
On the basis of step S003, the main purpose of this step is to compare the test scenario output with the expected result pair on the requirement specification, and obtain the corresponding test result.
The test results vary depending on the test output and the desired output. For example, in a production station-crossing scene, the output data is a station-crossing record, and if the expected result is the check station-crossing record, the test result is station-crossing record statistics; if the expected result is yield, then the test result is the number of good products/total number of passes. Therefore, the test result is judged according to the test output and the expected value of the test scene, and the expected value is obtained according to the requirement specification.
In summary, in the software testing method provided by the present invention, the test scenario and the test data are separated, that is, during testing, the test scenario is first split, and the data required by the test scenario is analyzed; then test data are obtained through an automation tool; and testing the test scene by using the acquired data. The effect of test scene multiplexing is achieved, the test process is accelerated, and the test efficiency is improved, so that the test version can be better responded and iterated quickly.
Referring to fig. 2, fig. 2 is a flowchart illustrating step S001 of fig. 1 in detail.
With reference to fig. 1, this reference diagram mainly explains how to split the test scenario in step S001 of fig. 1, and analyze data required by each test scenario.
The implementation of the figure comprises:
and S101, splitting the test scene according to the requirement.
It should be noted that a system requirement specification contains many modules and function points, and a tester needs to subdivide a test scenario according to each test function point, strive for one test scenario to cover one or more test function points, and finally all test scenarios can cover all function points on the requirement specification, so that function point missing test can be avoided.
And step S102, analyzing the data relation among the test scenes.
On the basis of step S101, this step is intended to clear up the data relationship between the respective test scenarios. The test scenarios split in step S101 have data association with each other in the system, for example, the output of scenario a is the test execution data of scenario B, so it is to be analyzed and clarified whether the data required by the execution of each test scenario is provided by the execution output of other test scenarios, and whether the output of this test scenario is the execution input data of other test scenarios, so that when the test scenarios are written, the execution scenarios of each test scenario are written in sequence.
Step S103, analyzing the type and source of the test data required by each test scenario.
On the basis of step S102, this step is intended to clean the data types and data sources required by the respective test scenarios. In an industrial internet test project, test data required by a test scene are system basic data, fixed format data and other test scene output data; therefore, the data type and the data source required by each test scenario need to be fully analyzed, so that when the test script is written, the test script is written according to the data type and the data acquisition source, and the test data obtained by the test script can be ensured to be correct and effective.
Referring to fig. 3, fig. 3 is a type classification diagram of the test data in step S001 and step S002 of fig. 1.
Referring to fig. 1 in combination, this reference diagram mainly explains the type of test data generated in step S002 and the test scenario requirements in step S001 in fig. 1.
Generally, the data required for test scenario execution includes three types:
1. basic data of the system: in industrial internet projects, basic data of customers, suppliers, warehouses, storage spaces, lines, teams and the like are used many times in order systems, production and manufacturing systems and warehouse systems. In the system test scenes, when system basic data are needed, the test script directly obtains the needed test basic data from the corresponding data table of the database, so that the data obtaining is quick and accurate.
2. Fixed format data: in the testing process, certain requirements on length and field types are provided for some testing data required by testing scenes, but the data cannot be repeated, for the testing data, a method for generating corresponding data can be compiled, and the method is called to obtain the required data when a script is executed each time; the data can also be placed in a special test file, such as excel and csv, and parameterized read through a script or directly written into the script, and the script is executed to obtain the required data.
3. Testing process data: the type data is output data of other test scenarios, so that the execution sequence of each test scenario needs to be confirmed when the script is written, and the condition that the output data of the scenario executed first can serve the subsequent test scenarios is ensured. If the test output data is needed in a plurality of test scenes, the test output can be set as a global variable, so that the later test scenes can be called conveniently.
Aiming at different data types, the automatic scripts are different in implementation modes, so that the data types required by each scene need to be determined when the scene is analyzed, and the design of the scripts is facilitated.
Referring to fig. 4, fig. 4 is a flowchart illustrating a complex scenario combining steps S002 and S003 in fig. 1. This is also a common flow chart in industrial internet of things project testing.
In an industrial internet project, test scenes have flow performance, data among the scenes has dependency, so that when test data are generated, a script is rarely designed in a single scene, the script of the whole business process is designed according to a business logic process, and some process data are cross-system and cross-platform. For example, a test warehouse system purchasing warehousing scene needs an order system purchasing order to provide warehousing data; the terminal production manufacturing scene needs a production management platform to provide production data.
In fig. 4, step S201 may be regarded as a first test scenario of the service flow, and the test input a is obtained by executing the test of the test scenario a with the generated test data a without providing data in other test scenarios.
Step S202 is to execute the test scenario B together with the test output a and the test data B obtained in step S201 to obtain a test output B.
Step S203 is to execute the test scenario C together with the test output B and the test data C obtained in step S202 to obtain the test output C, and so on for other scenarios.
Due to the business process relation of the scenes, after the execution of each scene is finished, judging the result of the last test scene sometimes by using script assertion, and executing the next test scene after the result passes; sometimes, in order to ensure the accuracy of the data of the last test scene, the test result is artificially judged, and the next test scene is triggered by hands to continue executing the test when the test is passed.
The above detailed description of the test method for separating test data from test scenarios provided by the present invention is a detailed description of the test flow of the test method, and also a core idea of each test step and a description of the application of the method to some test scenarios with complex business logic in combination with industrial internet projects.
The above description is only a preferred embodiment of the present invention, and the present invention is not limited thereto. It will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit and substance of the invention, and these modifications and improvements are also considered to be within the scope of the invention.
Claims (5)
1. A test method for separation of test scenarios and test data, comprising the steps of:
splitting the test scenes according to the test requirements, and analyzing the test data required by each test scene;
acquiring test data required by each test scene through an automation tool;
executing a test through the generated test data and the corresponding test scene to obtain scene test output data;
and comparing the test output with an expected result to obtain a test result.
2. The method as claimed in claim 1, wherein the step of splitting the test scenarios according to the test requirements and analyzing the test data required by each test scenario comprises the steps of:
splitting a test scene according to requirements;
analyzing the data relation among all the test scenes;
and analyzing the type of test data and the data source required by each test scene.
3. A test method with respect to separation of test scenarios and test data according to claim 2,
the test data types and sources include:
basic data of the system: directly acquiring the data from a data table corresponding to the database through the script;
parameters of the fixed format: filling in when the test scene is executed, and calling through a script when needed;
testing process data: the data are provided by test outputs of other test scenes, new scripts are required to be obtained after the other test scenes are executed, the test outputs of the other test scenes are directly set as global variables, and the data of the type are obtained, and the execution sequence of the scripts of each scene is required to be written in the scripts.
4. The method of claim 2, wherein the obtaining of the test data required by each test scenario through an automation tool comprises: the automatic test tool executes each test script to generate data corresponding to the test scene, and test service logic is compiled according to the test scene in the automatic script compiling process to control the execution sequence of the test scene.
5. The method of claim 1, wherein the generating test data and the corresponding test scenario perform a test to obtain scenario test output data, and the method comprises: and executing the test task under the corresponding test scene by using the test data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011395393.2A CN112363951A (en) | 2020-12-03 | 2020-12-03 | Test method for separation of test scene and test data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011395393.2A CN112363951A (en) | 2020-12-03 | 2020-12-03 | Test method for separation of test scene and test data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112363951A true CN112363951A (en) | 2021-02-12 |
Family
ID=74535076
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011395393.2A Pending CN112363951A (en) | 2020-12-03 | 2020-12-03 | Test method for separation of test scene and test data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112363951A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107368428A (en) * | 2017-09-07 | 2017-11-21 | 马上消费金融股份有限公司 | Software testing method and software testing system |
US9858175B1 (en) * | 2016-09-28 | 2018-01-02 | Wipro Limited | Method and system for generation a valid set of test configurations for test scenarios |
US20180095866A1 (en) * | 2016-09-30 | 2018-04-05 | Wipro Limited | Method and system for automatically generating test data for testing applications |
CN109614310A (en) * | 2018-10-22 | 2019-04-12 | 中国平安财产保险股份有限公司 | Management method, device, computer equipment and the storage medium of test interface |
CN110162458A (en) * | 2019-04-15 | 2019-08-23 | 深圳壹账通智能科技有限公司 | Test data building method, device and storage medium |
US20200192781A1 (en) * | 2018-12-17 | 2020-06-18 | Paypal, Inc. | Electronic services use-case testing framework |
-
2020
- 2020-12-03 CN CN202011395393.2A patent/CN112363951A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9858175B1 (en) * | 2016-09-28 | 2018-01-02 | Wipro Limited | Method and system for generation a valid set of test configurations for test scenarios |
US20180095866A1 (en) * | 2016-09-30 | 2018-04-05 | Wipro Limited | Method and system for automatically generating test data for testing applications |
CN107368428A (en) * | 2017-09-07 | 2017-11-21 | 马上消费金融股份有限公司 | Software testing method and software testing system |
CN109614310A (en) * | 2018-10-22 | 2019-04-12 | 中国平安财产保险股份有限公司 | Management method, device, computer equipment and the storage medium of test interface |
US20200192781A1 (en) * | 2018-12-17 | 2020-06-18 | Paypal, Inc. | Electronic services use-case testing framework |
CN110162458A (en) * | 2019-04-15 | 2019-08-23 | 深圳壹账通智能科技有限公司 | Test data building method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108614770B (en) | Automatic test assertion method, device, storage medium and equipment | |
CN106294673B (en) | Method and system for analyzing log data in real time by user-defined rule | |
US9411710B2 (en) | Automated regression test case selector and black box test coverage tool for product testing | |
CN107302476B (en) | Automatic testing method and system for testing asynchronous interactive system | |
CN103164328A (en) | Method and device and system for regression testing of service function | |
CN109344053B (en) | Interface coverage test method, system, computer device and storage medium | |
CN111400119A (en) | Multi-project and multi-platform self-adaptive chip design FPGA prototype verification method and system | |
CN112699055B (en) | Software automatic test method and system with lower maintenance cost | |
GB2587432A (en) | System and method for software architecture redesign | |
CN111858356A (en) | UI automatic testing method based on image recognition technology | |
CN111651365B (en) | Automatic interface testing method and device | |
CN109491661B (en) | Universal cross-compiling method and device | |
CN111966597B (en) | Test data generation method and device | |
CN112882941A (en) | Integrated test system and method based on micro-service architecture | |
CN111679979A (en) | Destructive testing method and device | |
EP2913757A1 (en) | Method, system, and computer software product for test automation | |
CN113434405A (en) | Method and device for determining test file, storage medium and electronic device | |
CN112363951A (en) | Test method for separation of test scene and test data | |
CN110597728A (en) | Method, device and system for constructing test data | |
CN114880239A (en) | Interface automation testing framework and method based on data driving | |
CN113672509A (en) | Automatic testing method, device, testing platform and storage medium | |
CA3144852A1 (en) | Automatic generation of integrated test procedures using system test procedures | |
CN113806231A (en) | Code coverage rate analysis method, device, equipment and medium | |
CN110399298A (en) | A kind of test method and device | |
CN113010424B (en) | Interface automatic test processing method, system, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210212 |