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.

Systems with Finite <strong>Model</strong>s 149<br />

in Chapter 5, and execute it on all three implementations (the correct one and<br />

the two defective ones).<br />

2. Write another model program, implementation, and stepper for the newsreader,<br />

where each action returns the value of the page state variable at the time the<br />

action exits. Write the stepper to check the return values. Make versions of this<br />

implementation with the same two defects as in Exercises 3 and 4 in Chapter 5.<br />

Generate a test suite from the model program. Execute the test suite on all three<br />

of these implementations. Are the defects revealed earlier in the execution of the<br />

test suite?<br />

3. Write another model program, implementation, and stepper for the newsreader,<br />

where each action returns the value of all three state variables as C# out parameters<br />

at the time the action exits. Write the stepper to check the out parameters.<br />

Make versions of this implementation with the same two defects as in<br />

Exercises 3 and 4 in Chapter 5. Generate a test suite from the model program.<br />

Execute the test suite on all three of these implementations. Are the defects<br />

revealed earlier in the execution of the test suite?<br />

4. Generate a test suite from the revised version of the reactive system model<br />

program (without unsafe states or dead states) that you wrote for Exercise 5 in<br />

Chapter 5. Execute this test suite on the implementation from Chapter 3 (with<br />

unsafe states and dead states) and on the revised implementation you wrote for<br />

Exercise 3 (without unsafe states and dead states) in Chapter 3.<br />

5. Could you use ct as a unit testing tool, as an alternative to NUnit? How? What<br />

would correspond to a test and a test fixture?<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!