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 266 | Next

Jonathan Jacky, Margus Veanes, Colin Campbell, Wolfram Schulte

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

The reserved name for getting all the
coverage points that are covered by executing an annotated action from a given
state is "CoveragePoints".
Bag GetCoveragePoints(IState s, Action a)
{
Bag cps;
model.GetTargetState(s, a, "CoveragePoints", out cps);
return cps;
}
Note that the target state of the transition is irrelevant in this context; only
the bag of all the coverage points that were covered is relevant and is returned.
Action coverage. If you only care about covering the different actions, independent
of the start state, then you can use the following coverage function. If the
actions take no arguments then this coverage function is equivalent to the first
one above.
Bag GetActionCoverage(IState s, Action a)
{ return new Bag(a); }
State coverage. A widely used notion of behavioral coverage is to visit all the
different states of the state machine. You can implement a state coverage
function as follows. It is useful to map states to their hash codes here, rather
than keeping around full states as coverage points.
Bag GetStateCoverage(IState s, Action a)
{
int stateHash = model.GetTargetState(s, a).GetHashCode();
return new Bag(new Literal(stateHash));
}
206 Testing Systems with Complex State
Transition coverage. Another widely used notion of behavioral coverage is to
visit all the different transitions of the state machine.


Pages:
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6