In the software performance testing process, the preparation of test data is a very systematic, very large amount of work. How to prepare a large amount of test data that supports different business operations and different test types to meet the requirements of load stress testing is an important topic often faced during performance testing.
China Software Evaluation Center in the history of performance testing process to pay attention to the preparation of performance test data, so as to ensure the smooth performance testing work, but also ensure the accuracy and effectiveness of performance test results. China evaluation in the recent development of a golden project of the non-functional testing project to enable the author to understand the system and complexity of data preparation, so that the author of the performance test data preparation simple induction, I hope to engage in performance testing work of the testers have some reference and references. This article focuses on the most common ways to prepare and prepare data for performance testing.
I. Types of data to be prepared
Before performing a load stress test, it is generally necessary to prepare three kinds of data: initialization data, bedding data (historical data), and parameterized data.
1. Initialization of data preparation
After the installation and deployment of the business system is completed, it is not possible to carry out the load stress test of the related business immediately, and the system initialization is mainly to increase the basic role information, the organization information, the Authority information, the business process setting and other data, which is the basis of the business system to carry out the related business. The data is initialized to identify the state of the data and validate the data for the test case used for testing, and it needs to be imported for testing purposes after the business system is set up and implemented according to the actual operational requirements of the system.
2. Bedding data (historical data)
When the business system is just on the line, due to the relatively small amount of data in the database, the overall response time of the system is very fast, the user experience is better. However, as the business continues, the amount of data in the business System database will increase exponentially, the operational response time of the business system will become more and more long due to the rapid growth of business data in the database, the user experience becomes very difficult to endure, therefore, in the performance test, we need to add a large number of bedding data, To simulate the performance of system-related operations over the next few years in terms of business growth. For example, to test the concurrent query business, it is required that the corresponding database and table have a considerable amount of data and the type of data should be able to cover the entire business.
3. Parametric data
In the load pressure test process, in order to simulate the different virtual user operation of the real load situation, and because most business operations in the business system transaction data can not be reused, therefore, many users need to input information to prepare a large number of parametric data to ensure the normal implementation of load pressure test. Parametric testing involves a lot of scope, for example, the simulation of different user login system, the need to prepare a large number of user names and corresponding password parameter data, simulation of taxpayer tax declaration, need to prepare a large number of taxpayer identification number, taxpayer internal code or taxpayer system identification number and other parameters data, This type of data preparation requires compliance with actual operational requirements and guarantees the correlation between data tables.
Ii. common methods of data preparation
1, for the business system initialization data is generally used by manual creation and data import way to complete, in which the new system or the old and new systems of large differences in such systems need to be created manually, and a legacy system upgrade system can be a large part of the data import to complete the data initialization work.
2, bedding data preparation is usually doubled the way to complete.
Data doubling needs to find out the table structure between the database relationship between the database and the main table and the relationship between the schedule is a one-to-many or many-to-many, for a two-to-many relationship to calculate a master table of a record probably corresponds to the schedule of a number of data, and thus the data doubled. When the data is doubled, the data generated by the CPU's computing power can be used efficiently, and the database will be imported to produce the required bedding data. or by writing and executing stored procedures. There are several principles to prepare for bedding data: 1. The amount of data in a database is several times larger than memory; 2. Data in preparation, to maintain the constraints of the original table; 3. The amount of data in each table should match the actual situation.
3, parametric data preparation is generally used to extract existing data from the database or manually add data to complete the way.
1) Use existing real data in the database. If the test 100 users at the same time the tax declaration, if there are 100 real user account information, no user also has a number of operational groups of taxpayers, then in preparing the data, you can directly call these existing data to complete.
2) manually add preparation data. As an example of login testing, if there are no 100 existing real user account information, then you need to manually create, of course, there are many ways to create, you can use LoadRunner to create, you can write a small program to create, of course, you can also choose to create a manual. However, when the amount of data is large, it is difficult to choose to create manually, such as the Test Boss (Business & operation) system, thousands of virtual users concurrent, if you manually prepare the data is cumbersome. Therefore, for a business with high concurrency, we can use the database background to double the data available data, or can be done by LoadRunner execution concurrency test, such as can be done by performing user registration and concurrent testing to complete the new user creation.
Below is an example of how to create the login account required for concurrency, first of all, according to the actual situation of the system to collate the corresponding table diagram, the system commonly used in the staff, operators, roles and other tables of the diagram clear, 1 is the people, operators, roles, permissions of the table relationship:
Figure 1: Table diagram
After figuring out the corresponding relationship in the table diagram, you can prepare the corresponding background SQL according to the concurrency needs, and for the Chinese Software Evaluation Center, in the process of performing the performance test project, create the login account, generate the worker, the operator, and the SQL example of the corresponding permissions in the background:
Figure 2: Example of creating a login account behind the scenes
These methods are not only suitable for the preparation of parametric data, but also for the preparation of basic data, we can use according to the actual situation of the project, can achieve the goal of rapid preparation of test data. This paper introduces the general practice of data preparation in the course of implementing performance Test project of China Software Evaluation Center, introduces the test data types and the common methods of preparing data, and combining these theories and methods will make our performance test data preparation work more systematic. It also enables the test results to be closer to the results of real production environments.
Go: How to prepare performance test data