Intelligent test data generation and traceability system and method based on defect correlation analysis
The intelligent test data generation system based on defect correlation analysis solves the problems of insufficient targeting and inefficient source tracing in traditional test data generation, and realizes efficient and accurate test data generation and rapid source tracing, thereby improving the efficiency and resource utilization of software testing.
Patent Information
- Application Number
- CN202512034322.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional test data generation methods lack specificity, leading to the recurrence of similar defects. The correlation between test data and defects is unclear, making source tracing time-consuming and labor-intensive, with high redundancy and poor adaptability, failing to quickly adapt to system function iterations.
The intelligent test data generation system based on defect correlation analysis builds correlation models through defect data mining and machine learning, generates high-coverage, targeted data, records and traces the source in real time, establishes a four-dimensional correlation archive, and supports iterative optimization.
It improves the relevance and traceability of test data, reduces redundancy, lowers resource consumption, supports rapid system iteration and adaptation, and reduces testing costs.
Smart Images

Figure CN121858446A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of software testing, and more specifically, to an intelligent test data generation and tracing system and method based on defect correlation analysis. Background Technology
[0002] As software systems become increasingly complex, the quality and efficiency of test data have become critical factors affecting software quality. Traditional test data generation methods rely primarily on manual experience or simple rule templates, which have significant shortcomings: 1) Data generation is often haphazard, lacking targeted coverage of historically frequent defect scenarios, leading to the recurrence of similar defects; 2) There is a lack of effective and structured correlation between test data and defects, making it difficult to quickly and accurately pinpoint which set of test data or which data feature caused the defect, resulting in a time-consuming and labor-intensive tracing process; 3) Test data has high redundancy, with a large amount of data repeatedly covering normal scenarios, wasting test resources; 4) Adaptability is poor, as test data cannot be quickly adapted to system function iterations, requiring a large amount of repetitive manual design work.
[0003] While some existing technologies offer automated test data generation tools, most focus on syntax generation or random generation, failing to fully explore and utilize the valuable information contained in historical defect data, and neglecting to establish a two-way, traceable, and intelligent correlation mechanism between test data and defects. Therefore, there is an urgent need for a system and method capable of utilizing historical defect knowledge to intelligently generate high-value test data and achieve efficient and accurate source tracing. Summary of the Invention
[0004] In view of the above-mentioned technical problems in related technologies, the present invention provides an intelligent test data generation and tracing system and method based on defect correlation analysis, which can solve the above problems.
[0005] To achieve the above-mentioned technical objectives, the technical solution of the present invention is implemented as follows: An intelligent test data generation and tracing system based on defect correlation analysis includes: The defect data mining module is used to collect historical software defect data, corresponding test data and system operation logs, and to clean and standardize them to extract the core features of defects. The association model training module, based on machine learning algorithms, constructs an association model between defect features and test data features, and establishes an association rule base between defects and test data. The intelligent test data generation module automatically generates test data, including basic coverage data, defect targeting data, and boundary expansion data, based on system functional requirements, the associated rule base, and the current test scenario. The test data and defect association recording module records the execution results of each set of test data in real time during the test execution process, and establishes and stores a four-dimensional association file containing test data ID, execution path, defect ID and defect characteristics to the traceability database. The defect tracing module is used to quickly locate the test data, data characteristics, and historical similar defect cases that triggered the defect when a new defect is detected, based on the defect feature matching association rule base and tracing database. The iterative optimization module is used to collect new test data and defect association records, and feed them back to the association model training module to update the association rule base and optimize the test data generation logic.
[0006] Furthermore, the software historical defect data collected by the defect data mining module includes defect type, triggering scenario, reproduction steps, and repair plan; the core defect features extracted by the defect data mining module include parameter anomalies, boundary value triggers, and process logic conflicts.
[0007] Furthermore, the test data generated by the intelligent test data generation module supports customization in JSON, XML, or CSV formats to adapt to different test environments.
[0008] Furthermore, the defect tracing module also supports reverse tracing, which allows users to query the defects and their impact range caused by the execution of specific test data corresponding to the test data ID by inputting the test data ID.
[0009] A method for intelligent test data generation and tracing based on defect correlation analysis includes the following steps: S1: Collect historical software defect data, corresponding test data, and system operation logs; perform data cleaning and standardization; and extract core defect features. S2: Based on machine learning algorithms, using historical defect features and corresponding test data features, train and generate an association model, and build a rule base for the association between defects and test data; S3: Based on the current test scenario requirements and the associated rule base, intelligently generate a test dataset containing basic coverage data, defect targeting data, and boundary expansion data; S4: Execute the test dataset and record the execution results of each set of test data in real time, and build and store a four-dimensional associated file containing test data ID, execution path, defect ID and defect characteristics; S5: When a new defect is detected, extract its defect features, match them with the association rule base and the four-dimensional association file, and quickly trace the test data, data features and historical information of similar defects that triggered the defect. S6: Collect new test data, defect association records, and user feedback, and regularly update the association model and association rule base to iteratively optimize the accuracy of test data generation and tracing.
[0010] Furthermore, in step S2, gradient boosting tree is used as the core machine learning algorithm, and the model parameters are optimized through cross-validation.
[0011] Furthermore, in step S3, the defect targeting data is specialized test data with corresponding characteristics generated based on the association rule base for historical high-frequency defect types; the boundary expansion data is potential defect triggering data generated by feature combination expansion based on association rules.
[0012] Furthermore, step S5 also includes a reverse tracing step: by inputting a test data ID, querying the defect records, execution logs, and impact scope triggered by the specific test data corresponding to that test data ID in historical tests.
[0013] The beneficial effects of this invention are as follows: This application intelligently generates high-coverage test data by mining the correlation features between historical defects and test data, and establishes a two-way traceability mechanism between defects and test data, thereby solving the problems of blind test data generation and inefficient defect traceability in traditional testing, and improving the accuracy of software testing and the efficiency of problem location. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a flowchart illustrating an intelligent test data generation and tracing process based on defect correlation analysis, as described in an embodiment of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.
[0017] like Figure 1 As shown, the present invention discloses an intelligent test data generation and tracing system based on defect correlation analysis, characterized in that it includes: The defect data mining module is used to collect historical software defect data, corresponding test data and system operation logs, and to clean and standardize them to extract the core features of defects. The association model training module, based on machine learning algorithms, constructs an association model between defect features and test data features, and establishes an association rule base between defects and test data. The intelligent test data generation module automatically generates test data, including basic coverage data, defect targeting data, and boundary expansion data, based on system functional requirements, the associated rule base, and the current test scenario. The test data and defect association recording module records the execution results of each set of test data in real time during the test execution process, and establishes and stores a four-dimensional association file containing test data ID, execution path, defect ID and defect characteristics to the traceability database. The defect tracing module is used to quickly locate the test data, data characteristics, and historical similar defect cases that triggered the defect when a new defect is detected, based on the defect feature matching association rule base and tracing database. The iterative optimization module is used to collect new test data and defect association records, and feed them back to the association model training module to update the association rule base and optimize the test data generation logic.
[0018] The intelligent test data generation and traceability system of this application generates and traces intelligent test data through the following methods and steps, including: S1: Collect historical software defect data, corresponding test data, and system operation logs; perform data cleaning and standardization; and extract core defect features. S2: Based on machine learning algorithms, using historical defect features and corresponding test data features, train and generate an association model, and build a rule base for the association between defects and test data; S3: Based on the current test scenario requirements and the associated rule base, intelligently generate a test dataset containing basic coverage data, defect targeting data, and boundary expansion data; S4: Execute the test dataset and record the execution results of each set of test data in real time, and build and store a four-dimensional associated file containing test data ID, execution path, defect ID and defect characteristics; S5: When a new defect is detected, extract its defect features, match them with the association rule base and the four-dimensional association file, and quickly trace the test data, data features and historical information of similar defects that triggered the defect. S6: Collect new test data, defect correlation records, and user feedback, and regularly update the correlation model and correlation rule base to iteratively optimize the accuracy of test data generation and tracing. In one specific embodiment of this application, defect data collection can be achieved by interface-connecting with defect management tools such as JIRA and TestRail to obtain historical defect data (including defect ID, type, triggering conditions, reproduction steps, and repair records) in batches; and simultaneously collect corresponding test data files, test case documents, and system operation logs.
[0019] The collected data needs to be preprocessed, including removing duplicate and invalid data (such as defects that have not been reproduced), classifying and labeling defect types (such as parameter errors, boundary overflows, and logical anomalies), extracting key features of the test data (such as data type, value range, and transmission path), and converting unstructured data (such as log text) into structured feature vectors, etc.
[0020] In a specific embodiment of this application, the association model training and optimization specifically includes feature engineering construction, model training, and rule base construction.
[0021] The feature engineering construction involves: building a defect feature set (defect type, triggering module, scope of impact, etc.) and a test data feature set (parameter combination, value range, execution order, etc.), and using Pearson correlation coefficient to filter strongly correlated features.
[0022] The model training process involves using Gradient Boosting Tree (XGBoost) as the core algorithm, taking historical defect features as input and corresponding test data features as output, and optimizing model parameters (learning rate 0.1, tree depth 5, etc.) through five-fold cross-validation to ensure that the model accuracy is ≥85%.
[0023] The rule base is constructed by converting the relationships learned by the model into interpretable rules (such as "Defect type: boundary overflow → test data feature: value ≥ 10000 and is an integer") and storing them in the association rule base.
[0024] In one specific embodiment of this application, the intelligent test data generation includes requirement input, data generation (basic coverage data, defect targeting data, boundary expansion data) and data output.
[0025] The input requirements are: the test scope (such as target modules and functional points), data format requirements, and coverage metrics to be received from users.
[0026] The basic coverage data consists of standard data generated based on system interface documents and data dictionaries, conforming to the usual value range.
[0027] The defect targeting data is generated by calling the association rule library to generate test data with corresponding features for high-frequency defect types (such as generating data with null parameters for "null pointer exception").
[0028] The boundary expansion data consists of feature combination expansion based on association rules, generating potential defect triggering data (such as boundary value ±10%, abnormal data type combinations, etc.).
[0029] The data output supports batch export of test data files or direct push to integrated testing tools for test execution.
[0030] In a specific embodiment of this application, the test execution is carried out by calling the test tool through an interface to automatically execute the generated test data, and record the execution result (success / failure), execution path and time consumption for each set of data. If the execution fails and a defect is triggered, a defect ID is automatically generated, and an association file of "test data ID-execution path-defect ID-defect feature" is established and written to the traceability database in real time; if the execution is successful, the functional points covered by the data are recorded for redundant data filtering.
[0031] In a specific embodiment of this application, forward tracing involves extracting the characteristics (such as defect type and triggering module) of a new defect upon detection, matching them with the association rule base and the tracing database, and quickly returning the corresponding test data ID, data characteristics, historical similar defects, and remediation solutions. Reverse tracing involves inputting a test data ID to query the defects (if any), execution logs, and affected functional modules generated by its execution, supporting test data validity verification.
[0032] In one specific embodiment of this application, the iterative optimization includes data feedback, model update, and data iteration.
[0033] The data feedback includes: regularly collecting new test data, defect association records, and user feedback (such as source tracing accuracy scores).
[0034] The model update involves retraining the association model quarterly based on new data, optimizing the association rule base, removing invalid rules, and adding new scenario rules.
[0035] The data iteration process involves automatically updating the test data generation logic based on the system's functional iteration requirements, adding test data adapted to new functions, and eliminating outdated and redundant data.
[0036] In one specific embodiment of this application, the hardware environment is as follows: deployed on a cloud server (CPU ≥ 8 cores, memory ≥ 16GB, storage ≥ 500GB), supporting distributed expansion and adapting to high-concurrency testing scenarios. The software environment is as follows: the operating system is Linux CentOS 7.0+, the database is MySQL 8.0 (for storing related files and rule bases), the programming language is Python 3.8+, the machine learning framework is TensorFlow 2.0+, and the testing tools integrate mainstream tool interfaces such as Selenium and Postman.
[0037] In summary, this application has the following advantages: 1. Highly targeted test data: Targeted data is generated through defect correlation analysis, increasing the coverage of historical high-frequency defect scenarios by more than 60% and significantly improving the defect detection rate; 2. Improved efficiency in defect tracing: Based on four-dimensional associated archives, the time for locating defect trigger data is reduced from hours to minutes, reducing tracing time by more than 80%; 3. Resource utilization optimization: Reduce redundant test data, shorten test execution time by 30%, and reduce the consumption of test resources such as servers and manpower; 4. Adaptive Iteration Capability: Supports rapid adaptation after system function iterations, automatically updates test data generation logic, and requires minimal manual intervention; 5. Reduce testing costs: Reduce the workload of manually designing test data and tracing defects, reduce the time and manpower costs of software testing, and improve the standardization of the testing process.
[0038] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An intelligent test data generation and tracing system based on defect correlation analysis, characterized in that, include: The defect data mining module is used to collect historical software defect data, corresponding test data and system operation logs, and to clean and standardize them to extract the core features of defects. The association model training module, based on machine learning algorithms, constructs an association model between defect features and test data features, and establishes an association rule base between defects and test data. The intelligent test data generation module automatically generates test data, including basic coverage data, defect targeting data, and boundary expansion data, based on system functional requirements, the associated rule base, and the current test scenario. The test data and defect association recording module records the execution results of each set of test data in real time during the test execution process, and establishes and stores a four-dimensional association file containing test data ID, execution path, defect ID and defect characteristics to the traceability database. The defect tracing module is used to quickly locate the test data, data characteristics, and historical similar defect cases that triggered the defect when a new defect is detected, based on the defect feature matching association rule base and tracing database. The iterative optimization module is used to collect new test data and defect association records, and feed them back to the association model training module to update the association rule base and optimize the test data generation logic.
2. The intelligent test data generation and tracing system based on defect correlation analysis according to claim 1, characterized in that, The software historical defect data collected by the defect data mining module includes defect type, triggering scenario, reproduction steps, and repair plan; the core defect features extracted by the defect data mining module include parameter anomalies, boundary value triggers, and process logic conflicts.
3. The intelligent test data generation and tracing system based on defect correlation analysis according to claim 1, characterized in that, The intelligent test data generation module generates test data that supports custom formats such as JSON, XML, or CSV to adapt to different testing environments.
4. The intelligent test data generation and tracing system based on defect correlation analysis according to claim 1, characterized in that, The defect tracing module also supports reverse tracing, which allows users to query the defects and their impact range caused by the execution of specific test data corresponding to the test data ID by inputting the test data ID.
5. A method for intelligent test data generation and tracing based on defect correlation analysis, characterized in that, Includes the following steps: S1: Collect historical software defect data, corresponding test data, and system operation logs; perform data cleaning and standardization; and extract core defect features. S2: Based on machine learning algorithms, using historical defect features and corresponding test data features, train and generate an association model, and build a rule base for the association between defects and test data; S3: Based on the current test scenario requirements and the associated rule base, intelligently generate a test dataset containing basic coverage data, defect targeting data, and boundary expansion data; S4: Execute the test dataset and record the execution results of each set of test data in real time, and build and store a four-dimensional associated file containing test data ID, execution path, defect ID and defect characteristics; S5: When a new defect is detected, extract its defect features, match them with the association rule base and the four-dimensional association file, and quickly trace the test data, data features and historical information of similar defects that triggered the defect. S6: Collect new test data, defect association records, and user feedback, and regularly update the association model and association rule base to iteratively optimize the accuracy of test data generation and tracing.
6. The method according to claim 5, characterized in that, In step S2, gradient boosting tree is used as the core machine learning algorithm, and the model parameters are optimized through cross-validation.
7. The method according to claim 5, characterized in that, In step S3, the defect targeting data is specialized test data with corresponding characteristics generated based on the association rule base for historical high-frequency defect types; the boundary expansion data is potential defect triggering data generated by feature combination expansion based on association rules.
8. The method according to claim 5, characterized in that, The S5 step also includes a reverse tracing step: by inputting the test data ID, querying the defect records, execution logs and impact scope triggered by the specific test data corresponding to the test data ID in historical tests.