Peach :: mutator :: Mutator :: Class Mutator
[hide private]

Class Mutator

source code

A Mutator implements a method of mutating data/state for a Peach 2 fuzzer. For example a mutator might change the state flow defined by a Peach fuzzer. Another mutator might mutate data based on known relationships. Another mutator might perform numerical type tests against fields.

Instance Methods [hide private]
 
__init__(self) source code
 
_getElementByName(self, node, name)
DEPRICATED! SHould say: node.findDataElementByName(name)
source code
 
isFinite(self)
Some mutators could contine forever, this should indicate.
source code
 
reset(self)
Reset mutator
source code
 
next(self)
Goto next mutation.
source code
 
getState(self)
Return a binary string that contains any information about current state of Mutator.
source code
 
setState(self, state)
Set the state of this object.
source code
 
getCount(self)
If mutator is finite than the total test count can be calculated.
source code
 
calculateCount(self)
This method should calculate the count of this mutator in a thread safe mannor.
source code
 
getActionValue(self, action) source code
 
getActionParamValue(self, action) source code
 
getActionChangeStateValue(self, action, value) source code
 
onStateStart(self, state) source code
 
onStateComplete(self, state) source code
 
onActionStart(self, action) source code
 
onActionComplete(self, action) source code
 
onStateMachineStart(self, stateMachine) source code
 
onStateMachineComplete(self, stateMachine) source code
Class Variables [hide private]
  elementType = "mutator"
  dataTypes = ['template', 'string', 'number', 'flags', 'choice'...
Method Details [hide private]

next(self)

source code 

Goto next mutation. When this is called the state machine is updated as needed.

getState(self)

source code 

Return a binary string that contains any information about current state of Mutator. This state information should be enough to let the same mutator "restart" and continue when setState() is called.

setState(self, state)

source code 

Set the state of this object. Should put us back in the same place as when we said "getState()".

getCount(self)

source code 

If mutator is finite than the total test count can be calculated. This calculation cannot occur until after the state machine has been run the first time. Once the state machine has been run the count can be calculated. This typically occurs in a separate thread as it can take some time to calculate.

This method will return -1 until a the correct value has been calculated.

calculateCount(self)

source code 

This method should calculate the count of this mutator in a thread safe mannor. Typically this method is called from a different thread. It will never be called until the state machine has run the first time through.


Class Variable Details [hide private]

dataTypes

Value:
['template', 'string', 'number', 'flags', 'choice', 'sequence', 'blob'\
, 'block']