27.07.2013 Views

2 Why We Need Model-Based Testing

2 Why We Need Model-Based Testing

2 Why We Need Model-Based Testing

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

292 <strong>Model</strong>ing Library Reference<br />

Requirement strings are printed in error contexts such as conformance failures<br />

and state invariant violations. They can also be used to check for coverage of requirements.<br />

The [Requirement] attribute may be applied to any .NET attributable element.<br />

More than one [Requirement] attribute may be provided for an entity.<br />

static class Bar<br />

{<br />

[Requirement("XYZ spec 3.2.4: Foo parameter must be nonnegative")]<br />

static void FooEnabled(int x)<br />

{<br />

return x > 0;<br />

}<br />

}<br />

A.2 Data types<br />

[Action]<br />

static void Foo(int x) { /* ... */ }<br />

A.2.1 Compound value<br />

CompoundValue<br />

Base class for data records with structural equality.<br />

Syntax<br />

public abstract class CompoundValue : AbstractValue, IComparable<br />

Methods<br />

CompareTo(Object)<br />

Term order. Comparison is based on type and recursively on fields.<br />

ContainsObjectIds()<br />

Determines if this value has an object id (i.e., is of type LabeledInstance) or<br />

has a subvalue that has an object id (e.g., a set of instances).<br />

Equality(CompoundValue, CompoundValue)<br />

Term equality.<br />

FieldValues()<br />

Returns an enumeration of all (readonly) field values of this compound value in<br />

a fixed order.<br />

more free ebooks download links at:<br />

http://www.ebook-x.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!