IP Library Granted Patent US 9,311,220
Granted Patent B1
US 9,311,220 · App. 14/145,233 · Granted Apr 12, 2016

System to uncover root cause of non-deterministic (flaky) tests

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,311,220
App. No.
14/145,233
Granted
Apr 12, 2016
Kind
B1
Abstract

A system and method are disclosed for determining the root cause of non-deterministic tests. An exemplary system may receive a non-deterministic test and run the non-deterministic test with call trace collection enabled. For each trace, the system may determine whether the trace was associated with a passing or failing test. Each trace may be labeled according to the trace's association. Then, dynamic call trees may be constructed, one for the traces associated with passing tests and one for traces associated with failing tests. The dynamic call trees may be compared to determine subtree patterns that occur in one tree, but not the other. The subtree patterns may then be ranked based on the number of times the subtrees occur in the traces in order to determine the root cause of the non-deterministic test.

Claims (44)

1. A system for determining the root cause of non-deterministic tests, the system comprising:

one or more processing devices and

one or more storage devices storing instructions that, when executed by the one or more processing devices, cause the one or more processing devices to:

receive a test that has been identified as non-deterministic;

run the test, enabling call trace collection to record call traces from the test until at least one execution has succeeded and one execution has failed;

for each trace in the call trace collection,

determine whether the trace was part of a passing test or a failing test and

label the trace according to the determination;

construct a dynamic call tree for the passing traces;

construct a dynamic call tree for the failing traces;

compare the dynamic call tree for the passing traces with the dynamic call tree for the failing traces to determine the subtree patterns that only occur in one tree or the other;

rank the subtree patterns based on the number of hits in the traces to determine the root cause of the non-deterministic test; and

map the subtree patterns to the collected call traces and merge overlapping subtrees.

2. The system of claim 1 , further comprising renaming generated classes consistently across multiple test runs so that generated classes may be compared.

3. The system of claim 1 , further comprising factoring out class initialization from the test runs to reduce noise from non-deterministic class loading.

4. The system of claim 3 , further comprising executing non-deterministic class loading separately from the rest of the non-deterministic test in order to determine whether the non-deterministic test has a different outcome per test run because of class initialization order.

5. A method for determining the root cause of non-deterministic tests, the method comprising:

receiving a test that has been identified as non-deterministic;

running the test, enabling call trace collection to record call traces from the test until at least one execution has succeeded and one execution has failed;

for each trace in the call trace collection,

determining whether the trace was part of a passing test or a failing test and

labeling the trace according to the determination;

constructing a dynamic call tree for the passing traces;

constructing a dynamic call tree for the failing traces;

comparing the dynamic call tree for the passing traces with the dynamic call tree for the failing traces to determine the subtree patterns that only occur in one tree or the other;

ranking the subtree patterns based on the number of hits in the traces to determine the root cause of the non-deterministic test;

mapping the subtree patterns to the collected call traces and merging overlapping subtrees.

6. The method of claim 5 , further comprising renaming generated classes consistently across multiple test runs so that generated classes may be compared.

7. The method of claim 5 , further comprising factoring out class initialization from the test runs to reduce noise from non-deterministic class loading.

8. The method of claim 7 , further comprising executing non-deterministic class loading separately from the rest of non-deterministic test in order to determine whether the non-deterministic test has a different outcome per test run because of class initialization order.

9. A non-transitory computer-readable medium having stored therein computer executable code that causes one or more processors to execute the steps of:

receiving a test that has been identified as non-deterministic;

running the test, enabling call trace collection to record call traces from the test until at least one execution has succeeded and one execution has failed;

for each trace in the call trace collection,

determining whether the trace was part of a passing test or a failing test and

labeling the trace according to the determination;

constructing a dynamic call tree for the passing traces;

constructing a dynamic call tree for the failing traces;

comparing the dynamic call tree for the passing traces with the dynamic call tree for the failing traces to determine the subtree patterns that only occur in one tree or the other;

ranking the subtree patterns based on the number of hits in the traces to determine the root cause of the non-deterministic test; and

mapping the subtree patterns to the collected call traces and merging overlapping subtrees.

10. The computer-readable medium of claim 9 , further comprising renaming generated classes consistently across multiple test runs so that generated classes may be compared.

11. The computer-readable medium of claim 9 , further comprising factoring out class initialization from the test runs to reduce noise from non-deterministic class loading.

12. The computer-readable medium of claim 11 , further comprising executing non-deterministic class loading separately from the rest of the non-deterministic test in order to determine whether the non-deterministic test has a different outcome per test run because of class initialization order.

Assignments (2)
CHANGE OF NAME Recorded Oct 2, 2017
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 044566/0657 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 4, 2014
From: HA, JUNGWOO; YI, JAEHEON; DINGES, PETER; MANSON, JEREMY; SADOWSKI, CAITLIN HARRISON; MENG, NA
To: GOOGLE INC.
Reel/Frame 032603/0571 →