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.

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

Figure 5.1. Newsreader Topics page in WithText mode.<br />

sometimes, an infinite number. A scenario is a collection of runs that are pertinent to<br />

some particular situation or purpose, such as a test suite. A scenario model program<br />

defines a scenario; it can execute all of the runs of the scenario, but no others. A<br />

scenario model program often has a small collection of runs; sometimes, just one.<br />

Usually a model program only models a subset or slice of the implementation’s<br />

features. Usually a model program represents the implementation at a level of<br />

abstraction where many details are omitted or simplified.<br />

5.2 Case study: user interface<br />

<strong>We</strong> make our first model program very simple, so we can explain the process of<br />

writing it in great detail, showing the reason for every step. <strong>We</strong> will pick up the pace<br />

in the examples to come.<br />

For our first model program we model the user interface for a <strong>We</strong>b-based newsreader,<br />

where users select a “group” (news about a particular subject), and can then<br />

read and post messages about topics in that group.<br />

When the users first select a group, they see a list of message excerpts, each with<br />

a title line indicating the topic (Figure 5.1). By clicking on the View titles only link,<br />

they can select an alternate page that just shows a list of topics (so more topics fit<br />

on the screen, Figure 5.2). On first viewing, the topics are sorted by the date of the<br />

most recent message about that topic. Users can click on the link Sort by date of<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!