Flaky Test Detection Using Stack Trace Pattern Matching

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In fast-paced software development environments, flaky test cases consume significant computing resources and hinder efficient error detection and debugging due to their unpredictable failure patterns, leading to resource inefficiencies and potential misallocation of developer efforts.

Innovation Solution

A system is implemented to detect flaky test cases by comparing stack trace and error message data from failed test cases with known flaky test case data, utilizing stack trace purification and number masking to identify similarities, and rerunning test cases as necessary to confirm or update flaky test case data.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If flaky test cases are executed repeatedly to ensure reliability, then test coverage improves, but computing resources are wasted and productivity decreases

Engineering Contradiction:
Improvetest reliabilityVSAvoiddebugging efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system performs preliminary analysis of test case execution patterns, stack traces, and error messages before full debugging begins. By pre-identifying flaky test cases through pattern matching and historical data comparison, the system prepares a filtered set of genuine failures for developer attention, preventing wasted effort on unpredictable test outcomes

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates simplified representations of test failures by generating and comparing stack traces and error messages. Instead of analyzing entire test suites, it copies and compares critical failure data structures to identify flaky patterns, reducing the complexity of reliability assessment while maintaining accuracy

Inventive Principle:
Principle #26Copying

2Measurement precision

If all test case failures are investigated thoroughly, then error detection completeness improves, but time consumption increases

Engineering Contradiction:
Improveerror detection completenessVSAvoiddebugging time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system extracts and isolates the subset of test failures that are genuinely indicative of software defects by removing flaky test cases from the analysis set. Through pattern recognition on stack traces and error messages, it separates signal from noise, presenting only the critical failures that require developer investigation

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system implements feedback loops where test execution results, stack traces, and error messages are continuously analyzed and compared against historical data. This feedback mechanism learns from patterns in test failures to improve flaky test identification accuracy over time, refining which failures require attention

Inventive Principle:
Principle #23Feedback

3Measurement precision

If computing resources are allocated to rerun all failed test cases, then test accuracy improves, but resource consumption increases

Engineering Contradiction:
Improvetest failure accuracyVSAvoidcomputing resource consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

Instead of rerunning all failed test cases, the system applies partial action by selectively rerunning only those test cases that exhibit patterns consistent with genuine failures. By using pattern matching on stack traces and error messages to identify which tests warrant rerun, it avoids the excessive resource consumption of universal rerun while maintaining sufficient accuracy

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS20250370839A1Software application testing with flaky test case detection
Publication Date: 2025.12.04 SAP SE
  • US20250370839A1 patent drawing
  • US20250370839A1 patent drawing
  • US20250370839A1 patent drawing

AI summary

Various examples are directed to systems and methods for debugging a software application. A computing system may access first stack trace data describing a plurality of function calls made by a software application during a failed execution of a first test case. The computing system may compare the first stack trace data and flaky test case data. The flaky test case data may describe at least one function call made by the software application during execution of at least one flaky test case. The at least one flaky test case may comprise a first flaky test case that the software application passed during one execution of the first flaky test case and failed during another execution of the first flaky test case. Based at least in part on the comparing, the computing system may determine that the first test case is a flaky test case.