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.

254 <strong>Model</strong>ing Objects<br />

0<br />

CreateEmployee(Employee(1))<br />

1<br />

CreateEmployee(Employee(2))<br />

2<br />

SetSalary(_, 0)<br />

SetSalary(_, 200)<br />

Figure 15.1. Payroll scenario FSM.<br />

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

3<br />

4<br />

0<br />

CreateEmployee(Employee(1))<br />

1<br />

2<br />

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

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

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

5<br />

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

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

CreateEmployee(Employee(2))<br />

Figure 15.2. Payroll scenario FSM composed with Payroll2.<br />

15.4 Harnessing considerations for objects<br />

The term label described in the previous section is also used for harnessing. In other<br />

words, whether the model program has been expressed using an object-oriented<br />

style or not, the harnessing approach will be the same. This is shown in Figure 15.3.<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!