Probability Model Delta Debugging for Code Compression
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing delta debugging technologies, such as the ddmin algorithm, are inefficient in reducing the size of test cases while maintaining debugging effectiveness, leading to prolonged processing times and suboptimal results, particularly evident in large codebases like the C language programs where tools like CHISEL take around 3 hours to achieve more than twice the expected output size reduction.
Innovation Solution
A delta debugging method and system based on a probability model that acquires an initial probability model, optimizes it using historical test data, and iterates to obtain an optimized model for performing delta debugging on target programs, focusing on maximizing test revenue and meeting preset conditions such as correctness, size compression, and reduced debugging time.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Extent of automation
If the ddmin algorithm is used for delta debugging, then the debugging process can be automated, but the debugging efficiency is low and processing time is prolonged
Solution Approach 1:
The patent applies preliminary action by pre-calculating and storing the probability that each code element belongs to the minimal failing subset based on historical test data. This probability information is prepared in advance and used to guide the debugging process, avoiding the need to systematically try all possible subsets as the ddmin algorithm does, thus significantly improving debugging efficiency while maintaining automation
Solution Approach 2:
The patent changes the parameter from systematic subset enumeration (ddmin approach) to probability-based element selection. By using probability values derived from historical test data to guide which code elements to include in the minimal subset, the algorithm transforms from a brute-force systematic search to a targeted probability-driven selection process, resolving the contradiction between automation and efficiency
2Reliability
If the ddmin algorithm systematically tries to delete subsequences, then all possible cases can be covered, but the debugging time increases significantly
Solution Approach 1:
The patent changes the approach from systematic enumeration of all possible subsequences to probability-based selection. By using probability values that indicate how likely each code element is to be part of the minimal failing subset, the algorithm prioritizes elements that are more likely to be necessary, thereby reducing the number of test cases that need to be executed while maintaining reliable coverage of the minimal subset
Solution Approach 2:
The patent substitutes the mechanical systematic enumeration process of the ddmin algorithm with a probability-driven selection mechanism. Instead of mechanically trying to delete and test each subsequence in a predetermined order, the system uses probability information to intelligently select which code elements to include, replacing the brute-force mechanical approach with a more efficient probabilistic model that reduces debugging time while maintaining test case coverage
3Adaptability or versatility
If domain-specific structures are presupposed for applying ddmin algorithm, then the algorithm can be adapted to specific languages, but the complexity of the debugging system increases
Solution Approach 1:
The patent changes from requiring complex domain-specific structural assumptions to using a universal probability model that works across different programming languages. By representing code as a sequence of elements and using probability values to indicate membership in the minimal subset, the system achieves language adaptability without needing to presuppose specific domain structures, thereby reducing system complexity while maintaining versatility
Solution Approach 2:
The patent applies universality by creating a debugging approach that is not tied to any specific programming language or code structure. The probability model can be applied to any sequence of code elements regardless of the underlying domain structure, making the debugging system universally applicable to different languages (C, Java, Python, etc.) without requiring language-specific adaptations, thus reducing complexity while maintaining adaptability
4Ease of manufacture
If the CHISEL tool is used for C language program debugging, then language-specific optimization is achieved, but the result size is more than twice the expected output
Solution Approach 1:
The patent changes from structural-based reduction to probability-based selection. By using probability values that directly indicate the likelihood of each code element being necessary, the system achieves more accurate compression results. The probability model naturally handles language-specific characteristics through the training data without requiring explicit structural assumptions, achieving both language optimization and higher precision in the reduced test case size
Solution Approach 2:
The patent substitutes the structural analysis mechanism used by CHISEL with a probability-driven selection mechanism. Instead of analyzing language-specific syntax and semantic structures to determine minimal subsets, the system uses probability values derived from historical test data to directly select necessary code elements. This substitution achieves language-specific optimization through data rather than structural rules, improving compression accuracy while reducing the size of the debugging result
Data Source
AI summary
A delta debugging method and system based on a probability model which includes: acquiring an initial probability model and historical test data; optimizing and iterating the initial probability model through the historical test data to obtain an optimized and iterated probability model; and performing delta debugging on a target program containing multiple lines of code based on the optimized and iterated probability model to obtain a debugging result that meets a first preset condition. Therefore, by adopting the embodiment of the present application, the initial probability model can be continuously optimized and iterated through the historical test data, and the target program can be debugged based on the optimized and iterated probability model, so that the debugging result can be improved, or the compression amount of the size of the target program can reach a target compression amount, or the debugging time can be greatly reduced.

