Test coverage measurement method based on database table records

By constructing test coverage measurement rules and configuration measurement schemes based on database table records, the problem of lack of automated measurement schemes in the existing technology is solved, efficient and accurate test coverage measurements are achieved, and the efficiency and quality of testing work are improved.

CN119415403APending Publication Date: 2025-02-11中国太平洋人寿保险股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411736242.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The lack of systematic and automated test coverage measurement schemes in the prior art leads to the inability to obtain data on key indicators such as test coverage, defect discovery rate, and test execution efficiency in a timely and accurate manner, which affects the effective monitoring and optimization of the test process.

Method used

By obtaining the database fields corresponding to the test cases and the change data recorded in the database table after the test cases are executed, metric rules are constructed, metric schemes are configured and executed, and metric results are obtained using database automation scanning to achieve efficient and automated test coverage measurement.

Benefits of technology

It solves the problem of lack of systematic and automated measurement solutions during the testing process, and can measure the execution effect and coverage completeness of test cases in a timely and accurate manner, improving the efficiency and quality of testing work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415403A_ABST
    Figure CN119415403A_ABST
Patent Text Reader

Abstract

The invention relates to a database table record-based test coverage measurement method, which comprises the following steps of: obtaining a database field corresponding to a test case and change data recorded by a database table after the test case is executed, and constructing a corresponding measurement rule; performing measurement scheme configuration on the to-be-tested system according to the measurement rule; and executing the configured measurement scheme, and outputting to obtain a measurement result. Compared with the prior art, the association between the test case execution result and the database table record is explored, the measurement rule is constructed, the coverage degree of the test case is measured by using the change of the database table record, and the case execution effect is measured through automatic scanning, so that a more efficient and automatic test execution and measurement scheme can be realized; and the software testing quality and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a test coverage measurement method based on database table records. Background Art

[0002] How to complete the test in the shortest time with the least manpower and resource investment, discover the defects of the software system, and ensure the excellent quality of the software is the goal of current software testing exploration and pursuit. The execution of test cases plays an important role in software testing activities.

[0003] The current test implementation process mainly relies on testers to manually execute each test case. Although this method can ensure the intuitiveness and flexibility of the test to a certain extent, it is also easy to affect the accuracy and consistency of the test results due to human factors (such as fatigue, negligence, etc.). More importantly, the review and confirmation of test results currently mainly rely on manual inspection by test auditors. Due to the limited time and energy of test auditors, it is difficult to conduct a detailed inspection of the execution results of all test cases one by one, which may cause some potential problems to be missed or misjudged.

[0004] It can be seen that there is currently a lack of a systematic and automated measurement solution for the execution of test cases, which makes it impossible to obtain data on key indicators such as test coverage, defect detection rate, and test execution efficiency in a timely and accurate manner, making it difficult to effectively monitor and optimize the test process. This lack of data support makes it quite difficult to evaluate and improve test work, and there is also a lack of clear direction and basis for improving test quality, which is not conducive to completing software testing efficiently and accurately. Summary of the invention

[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a test coverage measurement method based on database table records, to associate test cases with table records in the database to construct measurement rules, to achieve more efficient and automated test execution and measurement solutions, and to improve the quality and efficiency of software testing.

[0006] The purpose of the present invention can be achieved by the following technical solution: A test coverage measurement method based on database table records, comprising the following steps:

[0007] S1. Obtain the database fields corresponding to the test cases, as well as the change data recorded in the database table after executing the test cases, and construct corresponding measurement rules;

[0008] S2. According to the measurement rules, configure the measurement scheme for the system to be tested;

[0009] S3. Execute the configured measurement scheme and output the measurement results.

[0010] Furthermore, the changed data recorded in the database table after executing the test case in step S1 includes newly added data and updated data, which are used to check the execution status of the test case.

[0011] Furthermore, the measurement rules include general rules and personalized rules.

[0012] Furthermore, the general rules differ only in database tables or field information.

[0013] Furthermore, the content of the measurement scheme in step S2 includes: a selected measurement rule, an inspection time range, and the measurement rule involves a time field in the database table representing data changes.

[0014] Furthermore, the step S2 specifically configures one or more different measurement schemes for the system to be tested.

[0015] Furthermore, the step S3 specifically executes the configured measurement scheme by setting a scheduled task, and obtains the measurement result by automatically scanning the database.

[0016] Furthermore, the measurement results in step S3 include overall results and detailed results.

[0017] Furthermore, the overall result includes the system name, the number of test cases, the number of executed test cases, and the test case coverage.

[0018] Furthermore, the detailed results include system name, test case, measurement rule, and whether it passed.

[0019] Compared with the prior art, the present invention has the following advantages:

[0020] The present invention takes into account that there is a certain correlation between the test case and the table records in the database. When the test case is executed, it will trigger the addition or modification of records in the corresponding database table. Therefore, the design uses the addition or update of database table records to check the execution status of the test case, and constructs measurement rules by obtaining the database fields corresponding to the test case and the changes in the database table records after the test case is executed. Then, by configuring the measurement scheme and executing it, the corresponding measurement results can be obtained. This solves the problem of lack of systematic and automated measurement schemes in the testing process, and can timely and accurately measure the execution effect and coverage completeness of the test case, thereby improving the efficiency and quality of the testing work.

[0021] The present invention measures the coverage of test cases by using changes in database table records, and divides measurement rules into general rules and personalized rules, wherein general rules refer to rules applicable to most systems, with only different information such as database tables or fields, and personalized rules applicable to a single system with special test requirements. All general rules and personalized rules constitute all measurement rules of a certain system, and one system correspondingly maintains (adds, deletes, and updates) a set of measurement rule libraries, which can ensure the comprehensiveness and flexibility of measurement rules.

[0022] When configuring the measurement scheme for the system to be tested, the measurement scheme includes selecting the required measurement rules, setting the time range for inspection, and the time field representing the generation of new records or update records in the table involving the corresponding rules. Different measurement schemes can be configured for different systems, and multiple measurement schemes can be configured for the same system. The measurement rules (adding, deleting and updating measurement rules) and the inspection time can be changed at any time, which greatly improves the flexibility of test coverage measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0024] Figure 2 Schematic diagram of the application process of the embodiment. DETAILED DESCRIPTION

[0025] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] Example

[0027] This application collects and analyzes various types of data from historical testing processes to innovatively discover the relationship between test case execution results and database table records. Specifically, when a test case is executed, it will trigger the addition or modification of records in the corresponding database table. Taking the test insurance process as an example, once the relevant test case is executed, a new insurance policy record will be added to the database accordingly. This change intuitively reflects the execution effect of the test case.

[0028] Based on this principle, we can cleverly use the addition or update of database table records to check the execution status of test cases. In other words, by observing the changes in the records in the database table, we can easily determine whether a test case has been executed and what the execution results are. This method is not only intuitive and effective, but also provides a reliable means to measure the execution status of test cases.

[0029] The test coverage measurement scheme proposed in this application is built based on this concept. Starting from the existing test cases of each project, the database fields corresponding to the test cases and the changes in the database table records after the test cases are executed are sorted out to form measurement rules. According to these measurement rules, feasible technical rules are written to automatically scan the database and measure the execution effect and coverage completeness of the test cases.

[0030] like Figure 1 As shown, a test coverage measurement method based on database table records includes the following steps:

[0031] S1. Obtain the database fields corresponding to the test cases, as well as the change data recorded in the database table after executing the test cases, and construct corresponding measurement rules;

[0032] S2. According to the measurement rules, configure the measurement scheme for the system to be tested;

[0033] S3. Execute the configured measurement scheme and output the measurement results.

[0034] The process of applying the above solution in this embodiment is as follows Figure 2 As shown, the main ones are:

[0035] 1. Metric rule maintenance

[0036] Measurement rule maintenance includes the maintenance of the correspondence between test cases and measurement rules and the maintenance of the measurement rule content.

[0037] Measurement rules are generated using test cases. One test case can correspond to multiple measurement rules, and the corresponding relationship between the two is maintained in the system.

[0038] Metric rules are divided into general rules and personalized rules. General rules refer to rules that apply to most systems, with only different information such as database tables or fields. For example, to determine whether a test case for the insurance process is executed, the metric rule adds an insurance record to the database for the corresponding time period, which is converted into a technical rule that the policy status field in the policy table contains at least one enumeration value of the effective status during the corresponding time period; if it is determined whether the cancellation process is executed, the technical rule should be that the policy status field in the policy table contains at least one enumeration value of the cancellation status.

[0039] The above two rules can be combined into a general rule, and you can select different tables and fields to fill in the rule.

[0040] Personalized rules refer to rules that are unique to a certain system. For example, when a certain system tests the image storage function, the storage path involved will be recorded in the path field of the database impact table. The path is fixed and converted into a technical rule to check whether the path field in the image table is consistent with the original fixed path. Such personalized rules are only applicable to a single system.

[0041] Users can add, delete or update rules in the set measurement rule maintenance module. Users can select the required general rules, correspond to database tables and fields, and generate general measurement rules for each system. Personalized rules can be submitted on the set platform for customized development.

[0042] If a rule is no longer applicable, the user can delete it; if there is a need to change it, the user can change it by themselves for general rules and submit corresponding requirements for personalized rules.

[0043] All general rules and personalized rules are combined into all measurement rules of a system, and one system maintains a set of measurement rule bases.

[0044] 2. Metrics solution configuration and execution

[0045] The user configures the measurement scheme for the system to be tested. The scheme includes selecting the required measurement rules, setting the time range for inspection, and the time field in the table corresponding to the rule that represents the time of generating new records or updating records. A system can be configured with multiple measurement schemes, and measurement schemes can be added, deleted, and updated. Updates include adding and deleting measurement rules and changing the inspection time.

[0046] In actual applications, users can manually execute configured measurement schemes or set up scheduled tasks to automatically scan the database.

[0047] 3. Measurement results presentation

[0048] The measurement result presentation includes overall result presentation and detailed result presentation. Overall result includes system name, number of test cases, number of executed test cases, and test case coverage. Detailed result includes system name, test case, measurement rule, and whether it passed.

[0049] Testers can specifically check the incomplete test cases based on the final measurement results to find out the gaps. Auditors can also check whether all test cases have been completed before giving test opinions, which greatly reduces the cost of manual inspection and greatly improves the efficiency and accuracy of the audit.

[0050] In summary, this solution uses the changes in database table records to measure the coverage of test cases, and measures the execution effect of test cases through platform automated scanning, which can effectively solve the problem of lack of systematic and automated measurement solutions in the testing process, and is conducive to timely and accurate acquisition of data on key indicators such as test coverage, defect discovery rate, and test execution efficiency. In addition, test coverage measurement can configure different measurement solutions for different systems to be tested, and multiple sets of measurement solutions can be configured for the same system, and the measurement rules can be changed at any time, which improves the comprehensiveness and flexibility of test coverage measurement.

Claims

1. A test coverage measurement method based on database table records, characterized in that: The following steps are involved: S1. Obtain the database fields corresponding to the test cases, as well as the change data recorded in the database table after executing the test cases, and construct corresponding measurement rules; S2. According to the measurement rules, configure the measurement scheme for the system to be tested; S3. Execute the configured measurement scheme and output the measurement results.

2. A test coverage measurement method based on database table records according to claim 1, characterized in that: The changed data recorded in the database table after executing the test case in step S1 includes newly added data and updated data, which are used to check the execution status of the test case.

3. A test coverage measurement method based on database table records according to claim 1, characterized in that: The measurement rules include general rules and personalized rules.

4. A test coverage measurement method based on database table records according to claim 3, characterized in that: The general rules differ only in the database table or field information.

5. A test coverage measurement method based on database table records according to claim 1, characterized in that: The content of the measurement scheme in step S2 includes: the selected measurement rules, the inspection time range, and the measurement rules involve the time field representing the data change in the database table.

6. A test coverage measurement method based on database table records according to claim 1, characterized in that: The step S2 specifically configures one or more different measurement schemes for the system to be tested.

7. A test coverage measurement method based on database table records according to claim 1, characterized in that: The step S3 specifically executes the configured measurement scheme by setting a scheduled task, and obtains the measurement result by automatically scanning the database.

8. A test coverage measurement method based on database table records according to claim 1, characterized in that: The measurement results in step S3 include overall results and detailed results.

9. A test coverage measurement method based on database table records according to claim 8, characterized in that: The overall results include system name, number of test cases, number of executed test cases, and test case coverage.

10. A test coverage measurement method based on database table records according to claim 9, characterized in that: The detailed results include system name, test case, measurement rule, and whether it passed.