30
30
use GenTest::Simplifier::Grammar;
34
# RQG grammar simplification with an oracle() function based on
35
# This script can be used to simplify grammar files to the smallest form
36
# which will still reproduce a desired outcome.
40
# https://github.com/RQG/RQG-Documentation/wiki/RandomQueryGeneratorSimplification
44
# To adjust parameters to your use case and environment:
46
# 1. Copy simplify-grammar_template.cfg to for example 1.cfg
47
# 2. Adjust the settings in 1.cfg
48
# 3. Execute: perl util/simplify-grammar.pl --config 1.cfg
50
# Technical information
51
# =====================
52
# The GenTest::Simplifier::Grammar module provides progressively simpler grammars.
53
# We define an "oracle" function which runs those grammars through RQG, and we
54
# report if RQG returns the desired status code (for example STATUS_SERVER_CRASHED)
56
# IOW, RQG grammar simplification with an "oracle" function based on:
35
57
# 1. RQG exit status codes (-> desired_status_codes)
36
58
# 2. expected RQG protocol output (-> expected_output)
37
# Hint: 2. will be not checked if 1. already failed
39
# You need to adjust parameters to your use case and environment.
40
# 1. Copy simplify-grammar_template.cfg to for example 1.cfg
41
# 2. Adjust the settings
42
# 2. perl util/simplify-grammar.pl --config 1.cfg
44
# This script is used to simplify grammar files to the smallest form
45
# that will still reproduce the desired outcome
46
# For the purpose, the GenTest::Simplifier::Grammar module provides
47
# progressively simple grammars, and we define an oracle() function
48
# that runs those grammars with the RQG and reports if the RQG returns
49
# the desired status code (usually something like
50
# STATUS_SERVER_CRASHED
52
# For more information, please see:
54
# http://forge.mysql.com/wiki/RandomQueryGeneratorSimplification
59
# Hint: 2 will be not checked if 1 failed already
57
61
# get configuration
158
162
# 1. Run the first trial on the initial grammar with
159
163
# $config->initial_seed . This should raise the chance
160
# that the initial oracle check passes.
164
# that the initial "oracle" check passes.
161
165
# 2. Run the first trial on a just simplified grammar with the
162
166
# last successfull seed value. In case the last
163
167
# simplification did remove some random determined we