~elenst/randgen/mariadb-patches

« back to all changes in this revision

Viewing changes to util/simplify-grammar.pl

  • Committer: Roel Van de Paar
  • Date: 2012-08-13 00:13:26 UTC
  • Revision ID: roel.vandepaar@percona.com-20120813001326-ofqintcx7cd0j3di
Cleanup of help text for simplify utils

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
use GenTest::Simplifier::Grammar;
31
31
use Time::HiRes;
32
32
 
33
 
#
34
 
# RQG grammar simplification with an oracle() function based on
 
33
# Overview
 
34
# ========
 
35
# This script can be used to simplify grammar files to the smallest form
 
36
# which will still reproduce a desired outcome.
 
37
#
 
38
# More information
 
39
# ================
 
40
# https://github.com/RQG/RQG-Documentation/wiki/RandomQueryGeneratorSimplification
 
41
#
 
42
# Usage
 
43
# =====
 
44
# To adjust parameters to your use case and environment:
 
45
 
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
 
49
#
 
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)
 
55
 
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
38
 
#
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
43
 
#
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
51
 
#
52
 
# For more information, please see:
53
 
#
54
 
# http://forge.mysql.com/wiki/RandomQueryGeneratorSimplification
55
 
#
 
59
# Hint: 2 will be not checked if 1 failed already
56
60
 
57
61
# get configuration
58
62
 
157
161
            # seed value.
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