`import "github.com/zimmski/tavor/fuzz/filter"`

- func ApplyFilters(filters []Filter, root token.Token) (token.Token, error)
- func List() []string
- func NewNegativeBoundaryValueAnalysis(tok token.Token) (token.Token, error)
- func NewPositiveBoundaryValueAnalysis(tok token.Token) (token.Token, error)
- func Register(name string, filt Filter)
- type Filter

filter.go negativeboundaryvalueanalysis.go positiveboundaryvalueanalysis.go

ApplyFilters applies a set of filters onto a token. Filters are applied in the order in which they are given. If multiple filters are replacing the same token, only the first replacement will be applied. Filters are not applied onto filter generated tokens.

List returns a list of all registered fuzzing filter names.

NewNegativeBoundaryValueAnalysis implements a fuzzing filter for negative boundary-value analysis. This filter searches the token graph for integer range tokens which will be transformed to exactly two integers: The lower and higher negative boundary. Using this filter reduces for example the integer range 1-100 to the integers 0 and 101. Which reduces the range away from the model definition and therefore to an invalid data generation, which can be used for example for negative tests.

NewPositiveBoundaryValueAnalysis implements a fuzzing filter for positive boundary-value analysis. This filter searches the token graph for range tokens which will be transformed to a most 5 values: the lower and high boundaries as well as the middle values of the range. Using this filter reduces for example integer ranges of 1-100 to the integers 1, 50 and 100, which reduces permutations dramatically. A range of 1-2 will be reduces to the integers 1 and 2. A range of 1 will be reduced to the integer 1. Resulting integers of this filter therefore do not overlap. As a special case, integer ranges where the signs of the two boundaries are different are reduced to a maximum of 5 non-overlapping values. For instance, the integer range [-5, 10] is reduced to the integers -5, -1, 0, 1 and 10.

Register registers a fuzzing filter instance function with the given name.

Filter defines a fuzzing filter The function applies the fuzzing filter onto the token and returns a replacement token, or nil if there is no replacement. If a fatal error is encountered the error return argument is not nil.

New returns a new fuzzing filter instance given the registered name of the filter. The error return argument is not nil, if the name does not exist in the registered fuzzing filter list.

Package filter imports 7 packages (graph). Updated 2017-06-13. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).