This is a Smtc class. It's a "S"tate "M"achine "T"est "C"ase generator inspired by https://note.com/yumotsuyo/n/nd3099b40dc1f Overall flow is the following
- setContents(file)
- initialize()
- _flattenStates()
- nSwitchCoverage(switch)
- printTransitions();
- printNSwitch(nSwitchCoverage);
- printNSwitchMatrix(nSwitchCoverage);
- printDiagram();
Kind: global class
this._clean()
Param | Type | Description |
---|---|---|
smcat | state-machine-cat |
this is for webapp |
smtc.setContents(contents) ⇒ Smtc
fill this.contents from outside of this instance
Kind: instance method of Smtc
Returns: Smtc
-
this This object
Param | Type | Description |
---|---|---|
contents | string |
Target Contents |
smtc.initialize() ⇒ Smtc
In this method, it aims to fill the following parameters
- this.states
- this.events
- this.transitions
- this.matrix
Kind: instance method of Smtc
Returns: Smtc
-
this This object
Access: public
nSwitchCoverage = this.matrix x (n-1)SwitchCoverage
Kind: instance method of Smtc
Returns: Array
-
nSwitch culculated coverage
Access: public
Params:
Array
matrixprint diagram
Kind: instance method of Smtc
Access: public
print transitions
Kind: instance method of Smtc
Access: public
print n switch cases
Kind: instance method of Smtc
Access: public
Param | Type | Description |
---|---|---|
nSwitchCoverage | Array |
n switch coverage (default: this.matrix) |
print n switch matrix
Kind: instance method of Smtc
Access: public
Param | Type | Description |
---|---|---|
nSwitchCoverage | Array |
one switch coverage |
PRIVATE:clean up all parameters
Kind: instance method of Smtc
sometimes the states are nested, so we detect all nested and non-nested states.
Kind: instance method of Smtc
Returns: Array
-
states flatten the state and fill in this.json.transitions as needed.