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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Advanced Topics 257<br />

0<br />

CreateEmployee(Employee(1))<br />

1<br />

CreateEmployee(Employee(2))<br />

2<br />

SetSalary(Employee(1),200) SetSalary(Employee(1),0)<br />

3<br />

SetSalary(Employee(2),200) SetSalary(Employee(2),0)<br />

5<br />

Figure 15.4. Scenario FSM composed with Payroll1, with isomorphism reduction.<br />

}<br />

}<br />

public readonly int id;<br />

public Employee(int id) { this.id = id; }<br />

Figure 15.4 shows the result of eliminating isomorphic states while exploring<br />

the composition of Payroll1 and the FSM scenario of Figure 15.1. This graph was<br />

produced by using the /ExcludeIsomorphicStates and /CollapseExcludedIsomorphicStates<br />

options to the mpv tool.<br />

You may annotate enum types with the [Abstract] attribute as well as classes.<br />

The term labels produced for any subtype T of LabeledInstance are considered<br />

to abstract. In other words, if you run the exploration tool in a mode that prunes<br />

away isomorphic states, states that differ only in the choice of object ID will be<br />

eliminated. For example, substituting Payroll2 (with instance fields) for Payroll1<br />

(with the compound value type Employee marked as abstract) would produce the<br />

same exploration graphs.<br />

15.6 Exercises<br />

1. Rewrite the revision control system described in Section 10.4 in a style that uses<br />

CompoundValues for File and User data types. Maintain the field maps explictly.<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!