Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[Coverage Criterion] Imagine a microwave oven with a simple operation that allows the user to cook food by setting the timer and press the Start/Stop

[Coverage Criterion]

Imagine a microwave oven with a simple operation that allows the user to cook food by setting the timer and press the Start/Stop button.

The microwave oven is controlled by an embedded microcontroller and a program which is continuously running while the oven is plugged in. You are hired to test that the program controlling the oven works as expected. The manufacturer has provided you with the state machine M described below according to which the control program should operate.

At any time, M can be in one of the following states: S1, S2, S3, S4, S5.

Initially, M will be in state S1. In this initial state, the ovens door is closed, the oven is not cooking, and the ovens timer has value 0 and is not running.

M responses to the following events:

? SetTimer: The user has just set the timer. ? PressStartStop: The user has just pressed the Start/Stop button. ? OpenDoor: The user has just opened the ovens door. ? CloseDoor: The user has just closed the ovens door. ? TimesUp: The timer has just finished running.

M can perform the following actions:

? StartCooking: The oven is commanded to start cooking. ? StopCooking: The oven is commanded to stop cooking. ? StartTimer: The timer is commanded to start running. ? StopTimer: The timer is commanded to stop running and reset its value to zero. ? PauseTimer: The timer is commanded to pause running (while holding its current value). ? PlaySound: The oven is commanded to play sound.

At any state, M responses to certain events by changing its state and perform certain actions as described in the table below.

Current State Event New State Action
S1 OpenDoor S2 -
S1 SetTimer S3 -
S2 CloseDoor S1 -
S3 OpenDoor S2 -
S3 PressStartStop S4 StartTimer and StartCooking
S4 OpenDoor S5 PauseTimer and StopCooking
S4 PressStartStop S1 StopTimer and StopCooking
S4 TimesUp S1 StopCooking and PlaySound
S5 CloseDoor S4 StartTimer and StartCooking

1) Draw a state-transition diagram of this machine M.

2) Is there a (finite) set of test inputs that satisfies all-transition coverage (also called edge coverage)? If so, describe a set of test inputs that satisfies such coverage criterion.

Note: On a state machine, a test input is any sequence of events which may occur on the machine starting from the initial state, S1. For example, the following is a test input:

[SetTimer, PressStartStop, OpenDoor, CloseDoor]

By applying this test input, the machine produces the following sequence of actions:

[-, StartTimer and StartCooking, PauseTimer and StopCooking, StartTimer and StartCooking]

3) Is there a (finite) set of test inputs that satisfies all-path coverage? If so, describe a set of test inputs that satisfies such coverage criterion.

4) Is there a (finite) set of test inputs that satisfies prime-path coverage? If so, describe a set of test inputs that satisfies such coverage criterion.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions