SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 99 | Next

Jonathan Jacky, Margus Veanes, Colin Campbell, Wolfram Schulte

"Model-Based Software Testing and Analysis with C#"

Public and nonpublic fields are included.
Fields inherited from base classes (outside of the model namespace) are included.
In our example there are only three state varables. Each has only a few values so
we declare an enumerated type for each.
enum Page { Topics, Messages };
enum Style { WithText, TitlesOnly };
enum Sort { ByFirst, ByMostRecent };
In our examples all of the state variables are static variables.We declare all three,
and assign the initial state in the declarations.
static Page page = Page.Topics;
static Style style = Style.WithText;
static Sort sort = Sort.ByMostRecent;
68 Model Programs
Parameters and local variables in the model program are not state variables (there
are none in this example).
Sometimes it is useful to exclude a field from state for debugging or other
purposes. The [ExcludeFromState] attribute can be used to annotate fields that
should not be part of state. Fields excluded from the set of state variables must have
no effect on the behavior of the model.
5.4.3 Action methods
The actions of the model program are methods annotated with the [Action] attribute.
We call these methods action methods.
Each action method must express how the action changes the state (or leaves it
unchanged). Usually, the body of an action method computes the next state from
the current state, by assigning one or more state variables.


Pages:
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6