This repository was archived by the owner on Mar 12, 2020. It is now read-only.
This repository was archived by the owner on Mar 12, 2020. It is now read-only.
Clarify legacy code questions #7
Closed
Description
Clarify if we need the following parts from the legacy code and how they were used:
- The execution counter for the total number an action has been executed
StateGraph.actionExecutionCounter
? The execution counter for the number an action has been executed from a certain stateStateGraph.executionCounter
? Both execution counters weren't used except for verifications in unit tests and to get the never explored actions (which we can also just store in a field). So basically, we don't really need these counters. However, it could be interesting for the visualization or analysis of the NFA to see how often actions are repeated by the GA etc. - Blacklisted and whitelisted components? They were used to filter all available actions when getting a state. See
Environment
. Since we provide nogetState
with aExecutingTestContext
, we do expect in ourgetState
andexecuteActions
the filtering to be already done. So it would have to be done from the client side not this API. - Getting a state by an execution context only? Should never be called if the filtering is not done in this API (see above).
StateGraph.getRandomAction
andStateGraph.getRandomActions
?getRandomActions
seems to get all never explored actions from a state and to add all explored actions which means it simply gets all actions (confusing method name).StateGraph.getRandomAction
chooses one fromStateGraph.getRandomActions
and randomizes it with the methodAction.randomize
which has to be implemented by the concrete action type.getRandomAction
is required by Monkey Testing.getRandomActions
is used to produce a random action and directly by the ML module only when there are no unexplored actions where alsogetTransitions().keySet()
could have been used directly. Therefore, only makegetRandomAction
public for Monkey Testing.StateGraphListener
with a method called whenever a transition was added. It was only used byMonkeyTestingModel
to update the information about the progress in the GUI. We know that when we executeexecuteAction
there will be a new transition. Therefore, the information is already given for the calling client.StateGraph.unknownUIState
andUnknownState
. The methodunknownUIState
is only used forActionStateSequenceOld
when cloning.StateGraph.groundState
andGroundState
. Its purpose is to identify a state graph without transmitting the whole state graph in form of a UUID.StateGraph.getGroundState
is only used to get the execution date and to create theExitState
andUnknownState
. Every state stores its correspondingGroundState
. It is then used inActionStateSequenceOld
and when converting it toActionSequence
.- PrimitivesPool
StateGraph.exitState
andExitState
was created in the constructor when there was agroundState
although no transition led to it?AbstractState.canPossiblyExecuteActionSequence
andAbstractState.canPossiblyExecuteAction
.StateGraph
used MD5 hash values to compare states and use keys. Better performance than comparing their descriptors?StateGraph.getAllNeverExploredActions
has to be supoorted for chromosomes to generate new test cases. Store it globally. Otherwise, we would have to collect it from all states etc. like in the legacy code -> bad performance.StateGraph.getAllExploredActions
was only used in the registeredtransitionAdded
to show in the GUI how many actions have been executed by Monkey Testing. Is not hard to support as global variable in the state machine.