nz.ac.waikato.modeljunit.examples
Class LargeSet

java.lang.Object
  extended by nz.ac.waikato.modeljunit.examples.LargeSet
All Implemented Interfaces:
FsmModel

public class LargeSet
extends java.lang.Object
implements FsmModel

A model of a set with N elements. (N <= 13) With N=10, this model has 1024 states and 20480 transitions, which would take a long time to test exhaustively. See SmartSetAdaptor for a different/better way of testing large sets.


Field Summary
protected  boolean[] elem
           
 
Constructor Summary
LargeSet()
          Equivalent to LargeSet(2).
LargeSet(int N)
          Construct a model of a set with N elements.
 
Method Summary
 void add0()
           
 boolean add0Guard()
           
 void add1()
           
 void add10()
           
 boolean add10Guard()
           
 void add11()
           
 boolean add11Guard()
           
 void add12()
           
 boolean add12Guard()
           
 boolean add1Guard()
           
 void add2()
           
 boolean add2Guard()
           
 void add3()
           
 boolean add3Guard()
           
 void add4()
           
 boolean add4Guard()
           
 void add5()
           
 boolean add5Guard()
           
 void add6()
           
 boolean add6Guard()
           
 void add7()
           
 boolean add7Guard()
           
 void add8()
           
 boolean add8Guard()
           
 void add9()
           
 boolean add9Guard()
           
 void addElem(int i)
           
 void del0()
           
 boolean del0Guard()
           
 void del1()
           
 void del10()
           
 boolean del10Guard()
           
 void del11()
           
 boolean del11Guard()
           
 void del12()
           
 boolean del12Guard()
           
 boolean del1Guard()
           
 void del2()
           
 boolean del2Guard()
           
 void del3()
           
 boolean del3Guard()
           
 void del4()
           
 boolean del4Guard()
           
 void del5()
           
 boolean del5Guard()
           
 void del6()
           
 boolean del6Guard()
           
 void del7()
           
 boolean del7Guard()
           
 void del8()
           
 boolean del8Guard()
           
 void del9()
           
 boolean del9Guard()
           
 void delElem(int i)
           
 java.lang.Object getState()
          Converts elem into a string of 'T' and 'F' characters.
static void main(java.lang.String[] args)
          An example of generating tests from this model.
 void reset(boolean testing)
          Set all bits of elem to false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elem

protected boolean[] elem
Constructor Detail

LargeSet

public LargeSet()
Equivalent to LargeSet(2). Which is actually quite a small set!


LargeSet

public LargeSet(int N)
Construct a model of a set with N elements.

Parameters:
N - Must be 1..13.
Method Detail

getState

public java.lang.Object getState()
Converts elem into a string of 'T' and 'F' characters.

Specified by:
getState in interface FsmModel
Returns:
An object that represents the current state.

reset

public void reset(boolean testing)
Set all bits of elem to false.

Specified by:
reset in interface FsmModel
Parameters:
testing - true means the SUT should be reset too.

addElem

public void addElem(int i)

delElem

public void delElem(int i)

add0Guard

public boolean add0Guard()

add1Guard

public boolean add1Guard()

add2Guard

public boolean add2Guard()

add3Guard

public boolean add3Guard()

add4Guard

public boolean add4Guard()

add5Guard

public boolean add5Guard()

add6Guard

public boolean add6Guard()

add7Guard

public boolean add7Guard()

add8Guard

public boolean add8Guard()

add9Guard

public boolean add9Guard()

add10Guard

public boolean add10Guard()

add11Guard

public boolean add11Guard()

add12Guard

public boolean add12Guard()

add0

public void add0()

add1

public void add1()

add2

public void add2()

add3

public void add3()

add4

public void add4()

add5

public void add5()

add6

public void add6()

add7

public void add7()

add8

public void add8()

add9

public void add9()

add10

public void add10()

add11

public void add11()

add12

public void add12()

del0Guard

public boolean del0Guard()

del1Guard

public boolean del1Guard()

del2Guard

public boolean del2Guard()

del3Guard

public boolean del3Guard()

del4Guard

public boolean del4Guard()

del5Guard

public boolean del5Guard()

del6Guard

public boolean del6Guard()

del7Guard

public boolean del7Guard()

del8Guard

public boolean del8Guard()

del9Guard

public boolean del9Guard()

del10Guard

public boolean del10Guard()

del11Guard

public boolean del11Guard()

del12Guard

public boolean del12Guard()

del0

public void del0()

del1

public void del1()

del2

public void del2()

del3

public void del3()

del4

public void del4()

del5

public void del5()

del6

public void del6()

del7

public void del7()

del8

public void del8()

del9

public void del9()

del10

public void del10()

del11

public void del11()

del12

public void del12()

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
An example of generating tests from this model.

Throws:
java.io.IOException


Copyright © 2009 ModelJUnit Project. All Rights Reserved.