Software system testing methods and equipment

By generating M rows and N columns of test data, the problem of poor software system testing results in existing technologies is solved, enabling more comprehensive performance testing and more efficient test data generation, thus improving testing effectiveness and efficiency.

CN115525553BActive Publication Date: 2026-06-30AGRICULTURAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AGRICULTURAL BANK OF CHINA
Filing Date
2022-09-26
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies have poor testing results for software systems, making it difficult to effectively cover the performance of software systems under various attribute behaviors.

Method used

By receiving user-input data query information, the system retrieves raw data from the database, generates M rows and N columns of test data, and uses this test data to perform performance tests on the software system. The test data is generated based on different values ​​of the first attribute and the second attribute. M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N.

Benefits of technology

It improves testing effectiveness, better covers the performance of software systems under various attribute conditions, reduces operational complexity and labor costs, and improves the accuracy and efficiency of test data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115525553B_ABST
    Figure CN115525553B_ABST
Patent Text Reader

Abstract

This disclosure provides a testing method and apparatus for a software system, relating to the field of computer software technology. The method includes: receiving data query information input by a user in an interactive interface; retrieving raw data from a database based on the data query information, the raw data including corresponding values ​​of a first attribute and values ​​of a second attribute, the database storing data required by the software system during operation; generating M rows and N columns of test data based on the raw data, where the number of different values ​​of the first attribute is N, the test data in the first row represents all different values ​​of the first attribute, and the test data in the second to M rows of the Lth column represents all values ​​of the second attribute corresponding to the value of the first attribute in the Lth column; and performing performance testing on the software system using the test data. When executing test cases, testing can be performed on a column-by-column basis, which can better cover the performance of the software system under various attribute conditions, improving the testing effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer software technology, and in particular to a testing method and apparatus for a software system. Background Technology

[0002] Computer software systems are used to provide services to users through software; they can be simply referred to as software systems. For example, a software system can be an internet system, used to provide users with various news, shopping services, social networking services, and so on via the network.

[0003] In existing technologies, automated testing tools can be used to test software systems, detect and analyze abnormal events, and resolve these events. During testing, the automated testing tool inputs test data into pre-set test cases, runs the test cases in the software system, and obtains the test results. A successful test result indicates that the software system does not have the abnormal event corresponding to that test case; otherwise, it indicates that the software system does have the abnormal event corresponding to that test case.

[0004] However, the above-mentioned testing methods are not very effective for testing software systems. Summary of the Invention

[0005] This disclosure provides a software system testing method and device to improve testing results.

[0006] In a first aspect, embodiments of this disclosure provide a method for testing a software system, the method comprising:

[0007] Receive data query information input by the user in the interactive interface;

[0008] The original data is obtained from the database based on the data query information. The original data includes the values ​​of the first attribute and the values ​​of the second attribute that correspond to each other. The database is used to store the data required by the software system during operation.

[0009] M rows and N columns of test data are generated based on the original data. The number of different values ​​of the first attribute is N. The test data in the first row are all the different values ​​of the first attribute. The test data in the second to M rows of the Lth column are all the values ​​of the second attribute corresponding to the value of the first attribute in the Lth column. M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N.

[0010] The software system is used to perform performance testing based on the test data.

[0011] Optionally, the data query information is a database query statement, and the step of obtaining raw data from the database based on the data query information includes:

[0012] Execute the database query statement to retrieve raw data from the database.

[0013] Optionally, the data query information includes: table name, at least two columns of attributes to be queried, attributes for sorting the query results, condition attributes required for the query, and target values ​​for the condition attributes. The step of retrieving raw data from the database based on the data query information includes:

[0014] Generate a database query statement based on the data query information;

[0015] Execute the database query statement to retrieve raw data from the database.

[0016] Optionally, generating M rows and N columns of test data based on the original data includes:

[0017] The original data is clustered according to the value of the first attribute to obtain multiple data classes, and different data classes correspond to different values ​​of the first attribute;

[0018] For each data class, obtain all different values ​​of the second attribute in the data class;

[0019] A series of test data is generated based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to the data class.

[0020] Optionally, before generating a list of test data based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to the data class, the method further includes:

[0021] Each of the data classes is normalized so that the number of different values ​​of the second attribute is the same for each data class.

[0022] Optionally, after generating M rows and N columns of test data based on the original data, the method further includes:

[0023] The system receives storage information input by the user in the interactive interface, including: file format, file name, and storage path.

[0024] A storage file is generated in the storage path according to the file format and the file name;

[0025] The test data is written to the storage file.

[0026] Optionally, before receiving the data query information input by the user in the interactive interface, the method further includes:

[0027] The system receives connection permission information for the database input by the user in the interactive interface. The connection permission information includes: network address, port, user account, password, and database name.

[0028] Connect to the database based on the connection permission information.

[0029] Secondly, embodiments of this disclosure provide a testing apparatus for a software system, comprising:

[0030] The data query information receiving module is used to receive data query information input by the user in the interactive interface;

[0031] The raw data acquisition module is used to acquire raw data from the database according to the data query information. The raw data includes the values ​​of a first attribute and a second attribute that correspond to each other. The database is used to store the data required by the software system during operation.

[0032] The test data generation module is used to generate M rows and N columns of test data based on the original data. The number of different values ​​of the first attribute is N. The test data in the first row are all the different values ​​of the first attribute. The test data in the second to M rows of the Lth column are all the values ​​of the second attribute corresponding to the value of the first attribute in the Lth column. M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N.

[0033] The performance testing module is used to perform performance testing on the software system using the test data.

[0034] Optionally, the data query information is a database query statement, and the raw data acquisition module is further used for:

[0035] Execute the database query statement to retrieve raw data from the database.

[0036] Optionally, the data query information includes: table name, at least two columns of attributes to be queried, attributes for sorting the query results, condition attributes required for the query, and target values ​​for the condition attributes. The raw data acquisition module is further used for:

[0037] Generate a database query statement based on the data query information;

[0038] Execute the database query statement to retrieve raw data from the database.

[0039] Optionally, the test data generation module is further configured to:

[0040] The original data is clustered according to the value of the first attribute to obtain multiple data classes, and different data classes correspond to different values ​​of the first attribute;

[0041] For each data class, obtain all different values ​​of the second attribute in the data class;

[0042] A series of test data is generated based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to the data class.

[0043] Optionally, it also includes:

[0044] The normalization processing module is used to normalize each data class before generating a series of test data based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to each data class, so that the number of different values ​​of the second attribute is the same for each data class.

[0045] Optionally, it also includes:

[0046] The storage information receiving module is used to receive storage information input by the user in the interactive interface after generating M rows and N columns of test data based on the original data. The storage information includes: file format, file name, and storage path.

[0047] A storage file generation module is used to generate a storage file in the storage path according to the file format and the file name;

[0048] The test data writing module is used to write the test data into the storage file.

[0049] Optionally, it also includes:

[0050] The connection permission information receiving module is used to receive the connection permission information of the database entered by the user in the interactive interface before receiving the data query information entered by the user in the interactive interface. The connection permission information includes: network address, port, user account, password, and database name.

[0051] The database connection module is used to connect to the database according to the connection permission information.

[0052] Thirdly, embodiments of this disclosure also provide an electronic device, including: at least one processor and a memory;

[0053] The memory stores computer-executed instructions;

[0054] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to implement the method described in the first aspect.

[0055] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a computing device, cause the computing device to implement the method described in the first aspect.

[0056] Fifthly, embodiments of this disclosure also provide a computer program product for performing the method described in the first aspect.

[0057] The software system testing method and apparatus provided in this disclosure include: receiving data query information input by a user in an interactive interface; obtaining raw data from a database based on the data query information, the raw data including corresponding values ​​of a first attribute and a second attribute, the database being used to store data required by the software system during operation; generating M rows and N columns of test data based on the raw data, where the number of different values ​​of the first attribute is N, the test data in the first row represents all different values ​​of the first attribute, and the test data in the second to M rows of the Lth column represents all values ​​of the second attribute corresponding to the value of the first attribute in the Lth column, M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N; and performing performance testing on the software system using the test data. When executing test cases, testing can be performed on a column of test data as a unit to obtain the performance of the software system when the first attribute has the same value and the second attribute has different values, in order to determine whether different values ​​of the second attribute under the same first attribute value will cause the software system to malfunction, and to obtain the performance impact of the second attribute on the software system. Furthermore, the performance of the software system obtained from test data in different columns can be compared to determine the impact of the primary attribute on the software system's performance. This approach better covers the software system's performance under multiple attribute conditions, improving the effectiveness of the testing. Attached Figure Description

[0058] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the embodiments of the present disclosure.

[0059] Figure 1 This is a schematic diagram of the structure of the software system provided in the embodiments of this disclosure;

[0060] Figure 2 This is a flowchart of the steps of a software system testing method provided in an embodiment of this disclosure;

[0061] Figure 3This is a schematic diagram illustrating a detailed testing process for a software system provided in an embodiment of this disclosure;

[0062] Figure 4 This is a schematic diagram of the structure of a testing device for a software system provided in an embodiment of this disclosure;

[0063] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this disclosure.

[0064] The accompanying drawings have illustrated specific embodiments of the present disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the present disclosure in any way, but rather to illustrate the concepts of the present disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0065] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this disclosure as detailed in the appended claims.

[0066] The embodiments disclosed herein can be applied to the testing process of software systems to test various functions of the software system and ensure that each function of the software system functions normally. Figure 1 This is a schematic diagram of the structure of the software system provided in the embodiments of this disclosure. Figure 1 An example software system is provided with four servers: S1, S2, S3, and S4. Servers S1, S2, S3, and S4 are servers that process data access requests, including but not limited to receiving data access requests and returning response data. Access clients are used to send data access requests to the servers for processing and to receive response data returned by the servers.

[0067] Testing the aforementioned software system can be understood as simulating the access process of the client to the software system. During the testing process, test data for each function can be prepared beforehand, and then input into the corresponding test cases to determine the processing result returned by the software system for that test case. If the processing result is as expected, it indicates that the function of the software system is normal; otherwise, it indicates that the function of the software system is abnormal.

[0068] The testing effectiveness of the above testing scheme is related to the test data used in the test cases. In this embodiment, raw data can be retrieved from the database based on user-input data query information, and processed to obtain M rows and N columns of test data. Different columns of test data correspond to different values ​​of the first attribute. When executing test cases, testing can be performed on a per-column basis to obtain the software system's performance when the first attribute has the same value and the second attribute has different values. This determines whether different values ​​of the second attribute under the same first attribute value will cause software system anomalies, thus obtaining the impact of the second attribute on the software system's performance. Furthermore, the performance of the software system obtained from different columns of test data can be compared to obtain the impact of the first attribute on the software system's performance. In this way, the performance of the software system under multiple attribute values ​​can be better covered, improving the testing effectiveness.

[0069] Furthermore, the method in this embodiment only requires the user to input data query information to generate test data, which has low operational complexity, helps to reduce labor costs, improve the accuracy of test data, and improve the efficiency of generating test data, thereby improving testing efficiency.

[0070] Figure 2 This is a flowchart illustrating the steps of a software system testing method provided in this embodiment. Figure 2 The testing method for the software system shown can be executed by the testing equipment or any other device. The testing equipment can be connected to the management client. Please refer to [link / reference]. Figure 2 As shown, the testing methods for the above software system include:

[0071] S201: Receive data query information entered by the user in the interactive interface.

[0072] The interactive interface can be the interface displayed in the aforementioned management client, used for interaction with the user, including but not limited to: receiving user input and displaying information to the user. User input includes, but is not limited to, the aforementioned data query information. Here, "user" can be understood as personnel who maintain or test the software system.

[0073] The data query information here can be a database query statement or the information needed to generate a database query statement. To prevent modification of the original data in the database, operations such as data modification, data writing, and data deletion are not allowed.

[0074] The database query statement can follow the pattern "SELECT attribute FROM table_name WHERE query_condition". The query condition can be for one or more attributes. When the query condition applies to multiple attributes, it can be connected using "AND" and / or "OR". Furthermore, you can add sorting keywords like "ORDER BY" or keywords like "DISTINCT" to indicate the unique value corresponding to a query attribute. For example, a sample database query statement is "SELECT DISTINCT A, B FROM tbl WHERE B='a'and(C3>20or C3<5))ORDER BY ADESC", which retrieves the distinct values ​​of attributes A and B from the original data in table "tbl" where attribute B is "a" and C3 is greater than 20 or less than 5, and sorts the results by attribute A.

[0075] When the data query information is a database query statement, the user can directly enter the database query statement in the interactive interface. Upon receiving the database query statement, the user can execute the database query statement to retrieve the raw data from the database. The execution result of the database query statement is the raw data retrieved from the database.

[0076] When the data query information includes: table name, at least two columns of attributes to be queried, attributes for sorting the query results, conditional attributes required for the query, and target values ​​for the conditional attributes, the user can input the above data query information in the interactive interface. Upon receiving the above data query information, a database query statement can be generated based on the above data query information; then, the database query statement is executed to retrieve the raw data from the database.

[0077] As can be seen from the foregoing explanation of database query statements, database query statements include the inherent keywords "SELECT" and "FROM". Apart from these, the remaining keywords can be flexibly entered by the user. In other words, the user does not need to enter "SELECT" and "FROM", but needs to enter the aforementioned data query information.

[0078] Taking the database query statement "SELECT DISTINCT A, B FROM tbl WHERE B='a'and(C3>20orC3<5))ORDER BY A DESC" as an example, "tbl" is the table name, "A" and "B" are at least two columns of attributes to be queried, "A" is the attribute to sort the query results, and "B" and "C3" are the condition attributes required for the query. The target value of the condition attribute "B" is "a", and the target value of the condition attribute "C3" is ">20" or "<5".

[0079] In practical applications, input areas can be set for each data query, allowing users to enter data query information in them.

[0080] In summary, the embodiments of this disclosure allow users to directly input database query statements or input key information for generating database query statements. Users capable of writing database query statements can directly use them. Users without the ability to write database query statements can simply input the key information for the database query statement, reducing operational complexity.

[0081] S202: Retrieve raw data from the database based on the data query information. The raw data includes the values ​​of the first attribute and the values ​​of the second attribute that correspond to each other. The database is used to store the data required by the software system during operation.

[0082] The original data refers to the data obtained by executing a database query statement in the database. This database query statement is either directly input by the user or generated based on the user-input data. The original data can include at least two columns of attributes. We define the attribute corresponding to the first row of the test data as the first attribute, and the attributes corresponding to the second to M rows of the test data as the second attributes. The original data can include one or more first attributes and / or one or more second attributes. Each first attribute can generate a set of M rows and N columns of test data. For example, when the original data retrieved by the database query statement includes attributes A and B, A can be used as the first attribute to generate test data. Thus, the first row of test data represents the different values ​​corresponding to the first attribute A, and the second to M rows of test data represent the different values ​​corresponding to the second attribute B.

[0083] It should be noted that the raw data in the database described in this embodiment is the data required by the software system during operation, that is, the data required when test cases are executed. For example, for a software system that queries exam results, the raw data could be an exam number that uniquely identifies a student, and could also include other information such as the exam time.

[0084] S203: Generate M rows and N columns of test data based on the original data. The number of different values ​​of the first attribute is N. The test data in the first row are all the different values ​​of the first attribute. The test data in the second to M rows of the Lth column are all the values ​​of the second attribute corresponding to the values ​​of the first attribute in the Lth column. M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N.

[0085] Table 1 shows the M-row, N-column test data provided in the embodiments of this disclosure, where M=3 and N=6.

[0086] Table 1

[0087] A1 A2 A3 A4 A5 A6 B11 B21 B31 B41 B51 B61 B12 B22 B32 B42 B52 B62

[0088] As shown in Table 1 above, the first row, A1 to A6, represents the six different values ​​of attribute A. Each column of test data represents the corresponding values ​​of attribute B for attribute A at a given value. When attribute A is A1, the corresponding values ​​of attribute B can be B11 or B12. When attribute A is A2, the corresponding values ​​of attribute B can be B21 or B22. When attribute A is A3, the corresponding values ​​of attribute B can be B31 or B32. When attribute A is A4, the corresponding values ​​of attribute B can be B41 or B42. When attribute A is A5, the corresponding values ​​of attribute B can be B51 or B52. When attribute A is A6, the corresponding values ​​of attribute B can be B61 or B62.

[0089] In some implementations, the above test data can be generated through the following steps: First, the original data is clustered according to the value of the first attribute to obtain multiple data classes, with different data classes corresponding to different values ​​of the first attribute; then, for each data class, all different values ​​of the second attribute in the data class are obtained; finally, a series of test data is generated based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to the data class.

[0090] Table 2 is a set of raw data provided in an embodiment of this disclosure.

[0091] Table 2

[0092] A B A1 B11 A1 B12 A2 B21 A3 B31 A1 B13 A4 B41 A5 B51 A6 B61 A6 B62 A2 B22 A3 B32 A3 B33 A4 B42 A5 B52

[0093] As can be seen from Table 2, rows 2 to 14 of the first column contain the 13 values ​​of attribute A, and rows 2 to 14 of the second column contain the 13 values ​​of attribute B.

[0094] Table 3 shows the data classes obtained by clustering the original data in Table 1 provided in the embodiments of this disclosure, so that each data class is stored in a column.

[0095] Table 3

[0096]

[0097]

[0098] As shown in Table 3, each column represents a data class. The first column represents the data class corresponding to attribute A with value A1, which consists of the following three data entries: {value of attribute A: A1, value of attribute B: B11}, {value of attribute A: A1, value of attribute B: B12}, {value of attribute A: A1, value of attribute B: B13}. The second column represents the data class corresponding to attribute A with value A2, which consists of the following two data entries: {value of attribute A: A2, value of attribute B: B21}, {value of attribute A: A2, value of attribute B: B22}. The third column represents the data class corresponding to attribute A with value A3, which consists of the following three data entries: {value of attribute A: A3, value of attribute B: B31}, {value of attribute A: A3, value of attribute B: B32}, {value of attribute A: A3, value of attribute B: B33}. The fourth column represents the data class corresponding to attribute A with a value of A4. This data class consists of the following two data entries: {value of attribute A: A4, value of attribute B: B41}, {value of attribute A: A4, value of attribute B: B42}. The fifth column represents the data class corresponding to attribute A with a value of A5. This data class consists of the following two data entries: {value of attribute A: A5, value of attribute B: B51}, {value of attribute A: A5, value of attribute B: B52}. The sixth column represents the data class corresponding to attribute A with a value of A6. This data class consists of the following two data entries: {value of attribute A: A6, value of attribute B: B61}, {value of attribute A: A6, value of attribute B: B62}.

[0099] Of course, in addition to the row-based data classes shown in Table 3 above, data classes can also be stored in columns, which would result in the data classes shown in Table 4.

[0100] Table 4

[0101] A1 B11 B12 B13 A2 B21 B22 A3 B31 B32 B33 A4 B41 B42 A5 B51 B52 A6 B61 B62

[0102] As can be seen, Table 4 can be transposed to obtain Table 3. From Tables 3 and 4, it can be seen that the number of values ​​for attribute B varies across different columns. Therefore, after obtaining Table 3, it can be normalized. Specifically, normalization is performed on each data class to ensure that the number of different values ​​for the second attribute is the same across all data classes. In other words, for the data classes shown in Table 3, normalization requires deleting some values ​​of attribute B from each column to ensure that the number of values ​​for attribute B is the same across different columns.

[0103] Before the above normalization process, we can first determine the number of attribute B values ​​corresponding to different values ​​of attribute A. Then, we determine the minimum number of attribute B values ​​from these values. Finally, for each value of attribute A, we delete the corresponding attribute B values ​​down to this minimum number. For example, in Table 3, the number of attribute B values ​​corresponding to the values ​​A1 to A6 of attribute A are 3, 2, 3, 2, 2, and 2 respectively, with a minimum number of 2. Therefore, we can delete one attribute B value each for values ​​A1 and A3 to obtain the test data shown in Table 1.

[0104] In some implementations, after generating M rows and N columns of test data, storage information input by the user in the interactive interface can be received. This storage information includes file format, file name, and storage path. Then, a storage file is generated in the storage path according to the file format and file name. Finally, the test data is written to the storage file. In this way, during testing, the pre-generated storage file can be called to perform multiple tests, which helps improve the utilization rate of test data and further reduces the time required for testing.

[0105] The file format can be TXT text file or CSV comma-separated value file format. The filename must conform to Windows operating system filename requirements and cannot contain whitespace characters. The storage path can be a relative path or an absolute path.

[0106] S204: Perform performance testing on the software system using test data.

[0107] Specifically, test data can be input into test cases to run the test cases and perform performance testing on the software system.

[0108] Optionally, prior to S201 above, the system may also receive database connection permission information entered by the user in the interactive interface. The connection permission information includes: network address, port, user account, password, and database name; then, the system connects to the database based on the connection permission information.

[0109] Table 5 shows some relevant attributes of the connection permission information provided in the embodiments of this disclosure.

[0110] Table 5

[0111] Connection permission information Data types Is it mandatory to enter? IP address character type yes port Numerical no User account character type yes password character type yes Database name character type yes

[0112] The network address can be an IP (Internet Protocol) address. This allows users to manually enter the connection permission information to connect to the database before generating test data, thus maximizing the security of the raw data in the database.

[0113] This disclosure embodiment can implement a management client to display the aforementioned interactive interface and provide a backend software program to implement the testing method of the aforementioned software system. The management client and the backend software program can constitute a tool to generate test data. Alternatively, the backend software program can be integrated into a testing tool.

[0114] Figure 3 This is a schematic diagram illustrating a detailed testing process for a software system provided in an embodiment of this disclosure. (Refer to...) Figure 3 As shown, the detailed testing process of the above software system includes S301 to S315.

[0115] S301: Receives database connection permission information entered by the user in the interactive interface. The connection permission information includes: network address, port, user account, password, and database name.

[0116] S302: Connect to the database based on connection permission information.

[0117] After S302 is executed, S303 or S304 to S305 can be executed. After S303 or S305 is executed, S306 and subsequent steps can be executed.

[0118] S303: Receives database query statements entered by the user in the interactive interface.

[0119] S304: Receive the table name, at least two columns of attributes to be queried, the attributes for sorting the query results, the condition attributes required for the query, and the target values ​​of the condition attributes as entered by the user in the interactive interface.

[0120] S305: Generate a database query statement based on the data query information.

[0121] S306: Execute a database query statement to retrieve raw data from the database.

[0122] S307: Retrieve raw data from the database based on data query information. The raw data includes the values ​​of the first attribute and the values ​​of the second attribute that correspond to each other. The database is used to store the data required by the software system during operation.

[0123] S308: Cluster the original data according to the value of the first attribute to obtain multiple data classes, with different data classes corresponding to different values ​​of the first attribute.

[0124] S309: For each data class, obtain all distinct values ​​of the second attribute in the data class.

[0125] S310: Normalize each data class to ensure that the number of different values ​​for the second attribute is the same for each data class.

[0126] S311: Generate a column of test data based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to the data class. The number of different values ​​of the first attribute is N. The test data in the first row are all different values ​​of the first attribute. The test data in the second to M rows of the Lth column are all values ​​of the second attribute corresponding to the value of the first attribute in the Lth column. M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N.

[0127] S312: Receives storage information input by the user in the interactive interface. The storage information includes: file format, file name, and storage path.

[0128] S313: Generate storage files in the storage path based on file format and file name.

[0129] S314: Write the test data to the storage file.

[0130] S315: Perform performance testing on the software system using test data.

[0131] It should be noted that the order of S301 to S315 can be flexibly adjusted if they are independent of each other.

[0132] Corresponding to the above method embodiments, Figure 4 This is a schematic diagram of the structure of a testing device for a software system provided in an embodiment of this disclosure. Please refer to... Figure 4 The testing device 400 for the aforementioned software system includes:

[0133] The data query information receiving module 401 is used to receive data query information input by the user in the interactive interface.

[0134] The raw data acquisition module 402 is used to acquire raw data from the database according to the data query information. The raw data includes the values ​​of a first attribute and a second attribute that correspond to each other. The database is used to store the data required by the software system during operation.

[0135] The test data generation module 403 is used to generate M rows and N columns of test data based on the original data. The number of different values ​​of the first attribute is N. The test data in the first row are all the different values ​​of the first attribute. The test data in the second to M rows of the Lth column are all the values ​​of the second attribute corresponding to the value of the first attribute in the Lth column. M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N.

[0136] The performance testing module 404 is used to perform performance testing on the software system using the test data.

[0137] Optionally, the data query information is a database query statement, and the raw data acquisition module 402 is further used for:

[0138] Execute the database query statement to retrieve raw data from the database.

[0139] Optionally, the data query information includes: table name, at least two columns of attributes to be queried, attributes for sorting the query results, conditional attributes required for the query, and target values ​​for the conditional attributes. The raw data acquisition module 402 is further used for:

[0140] Generate a database query statement based on the data query information.

[0141] Execute the database query statement to retrieve raw data from the database.

[0142] Optionally, the test data generation module 403 is further configured to:

[0143] The original data is clustered according to the value of the first attribute to obtain multiple data classes, and different data classes correspond to different values ​​of the first attribute.

[0144] For each data class, obtain all different values ​​of the second attribute in the data class.

[0145] A series of test data is generated based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to the data class.

[0146] Optionally, it also includes:

[0147] The normalization processing module is used to normalize each data class before generating a series of test data based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to each data class, so that the number of different values ​​of the second attribute is the same for each data class.

[0148] Optionally, it also includes:

[0149] The storage information receiving module is used to receive storage information input by the user in the interactive interface after generating M rows and N columns of test data based on the original data. The storage information includes: file format, file name, and storage path.

[0150] A storage file generation module is used to generate a storage file in the storage path according to the file format and the file name;

[0151] The test data writing module is used to write the test data into the storage file.

[0152] Optionally, it also includes:

[0153] The connection permission information receiving module is used to receive the connection permission information of the database entered by the user in the interactive interface before receiving the data query information entered by the user in the interactive interface. The connection permission information includes: network address, port, user account, password, and database name.

[0154] The database connection module is used to connect to the database according to the connection permission information.

[0155] The above-described apparatus embodiment is an embodiment corresponding to the foregoing method embodiment, and has the same technical effects as the method embodiment. A detailed description of this apparatus embodiment can be found in the detailed description of the foregoing method embodiment, and will not be repeated here.

[0156] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device 600 includes a memory 602 and at least one processor 601.

[0157] Among them, memory 602 stores computer-executed instructions.

[0158] At least one processor 601 executes computer execution instructions stored in memory 602, causing electronic device 600 to implement the aforementioned software system test method.

[0159] In addition, the electronic device may also include a receiver 603 and a transmitter 604, wherein the receiver 603 is used to receive information from other devices or equipment and forward it to the processor 601, and the transmitter 604 is used to send information to other devices or equipment.

[0160] This disclosure also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a computing device, enable the computing device to implement a software system testing method.

[0161] This disclosure also provides a computer program product for executing the testing method of the above-described software system.

[0162] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0163] The sequence numbers of the embodiments disclosed above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0164] The above are merely preferred embodiments of the present disclosure and do not limit the patent scope of the present disclosure. Any equivalent structural or procedural transformations made based on the description and drawings of the present disclosure, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present disclosure.

Claims

1. A testing method for a software system, characterized in that, The method includes: Receive data query information input by the user in the interactive interface; The original data is obtained from the database based on the data query information. The original data includes the values ​​of the first attribute and the values ​​of the second attribute that correspond to each other. The database is used to store the data required by the software system during operation. M rows and N columns of test data are generated based on the original data. The number of different values ​​of the first attribute is N. The test data in the first row are all the different values ​​of the first attribute. The test data in the second to M rows of the Lth column are all the values ​​of the second attribute corresponding to the value of the first attribute in the Lth column. M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N. The software system is used to perform performance testing based on the test data.

2. The method according to claim 1, characterized in that, The data query information is a database query statement, and the step of retrieving raw data from the database based on the data query information includes: Execute the database query statement to retrieve raw data from the database.

3. The method according to claim 1, characterized in that, The data query information includes: table name, at least two columns of attributes to be queried, attributes for sorting the query results, conditional attributes required for the query, and target values ​​for the conditional attributes. The step of retrieving raw data from the database based on the data query information includes: Generate a database query statement based on the data query information; Execute the database query statement to retrieve raw data from the database.

4. The method according to any one of claims 1 to 3, characterized in that, The step of generating M rows and N columns of test data based on the original data includes: The original data is clustered according to the value of the first attribute to obtain multiple data classes, and different data classes correspond to different values ​​of the first attribute; For each data class, obtain all different values ​​of the second attribute in the data class; A series of test data is generated based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to the data class.

5. The method according to claim 4, characterized in that, Before generating a column of test data based on the value of the first attribute corresponding to each data class and all different values ​​of the second attribute corresponding to the data class, the method further includes: Each of the data classes is normalized so that the number of different values ​​of the second attribute is the same for each data class.

6. The method according to any one of claims 1 to 3, characterized in that, After generating M rows and N columns of test data based on the original data, the process further includes: The system receives storage information input by the user in the interactive interface, including: file format, file name, and storage path. A storage file is generated in the storage path according to the file format and the file name; The test data is written to the storage file.

7. The method according to any one of claims 1 to 3, characterized in that, Before receiving the data query information input by the user in the interactive interface, the method further includes: The system receives connection permission information for the database input by the user in the interactive interface. The connection permission information includes: network address, port, user account, password, and database name. Connect to the database based on the connection permission information.

8. A testing apparatus for a software system, characterized in that, include: The data query information receiving module is used to receive data query information input by the user in the interactive interface; The raw data acquisition module is used to acquire raw data from the database according to the data query information. The raw data includes the values ​​of a first attribute and a second attribute that correspond to each other. The database is used to store the data required by the software system during operation. The test data generation module is used to generate M rows and N columns of test data based on the original data. The number of different values ​​of the first attribute is N. The test data in the first row are all the different values ​​of the first attribute. The test data in the second to M rows of the Lth column are all the values ​​of the second attribute corresponding to the value of the first attribute in the Lth column. M and N are positive integers greater than or equal to 2, and L is an integer greater than or equal to 1 and less than or equal to N. The performance testing module is used to perform performance testing on the software system using the test data.

9. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a computing device, cause the computing device to implement the method as described in any one of claims 1 to 7.