Skip to content

Grizzly Reduce

Tyson Smith edited this page Jan 12, 2022 · 5 revisions

Overview

Grizzly Reduce is a tool built on top of Grizzly Replay and Lithium. It is intended to be used to reduce existing test cases. This is done by performing multiple passes using different reduction strategies to remove as much unnecessary data as possible. The time required to reduce a test case is dependent on the browser build as well as the test case size, complexity and reliability.

Reduction Process

Most test cases can be reduced simply by running python3 -m grizzly.reduce <browser-build> <test case>. This will perform an analysis phase followed by each strategy. The analysis will determine the most reliable method of running the test case and also how many attempts per reduction attempt should be performed when dealing with test cases that are not 100% reliable. Strategies are different methods of removing or manipulating data that help remove unnecessary data, these include line based reduction and JS & CSS beautify. The reduction strategy will be applied to all compatible files in the test case.

DDBEGIN/DDEND Markers

In order for a test case to be reduced it must contain DDBEGIN and DDEND markers used by Lithum. Files that do not contain the markers will be skipped. These markers wrap the content that is intended to be reduced within the test case. The markers can be added at the beginning and end of the file or wrap a specific area to avoid breaking the file structure during reduction.

For example:

<!DOCTYPE html>
<html>
<script>
function fuzz() {
    // DDBEGIN
    a()
    b()
    c()
    // DDEND
}
window.onload = fuzz
</script>
</html>
Clone this wiki locally