Aller au contenu principal

Model a Radio Alarm Clock

Now is the time to take the plunge and to exercice yourself with the following not guided wording.

DURATION

You should be able to complete this exercise in 2.5 hours.

GOAL

The objective of this exercise is to model a radio alarm clock.

This system can be seen as two services in interaction.

CONTEXT

As a reminder, a radio system is a system which:

  • receives radio waves from the environment
  • filters the radio wave for the chosen frequency
  • converts this radio wave into a sound wave emitted to users.

ASSUMPTIONS

  • We assume that the system is on at any time. No power states are implemented.
  • We assume clock time is given continuously by the environment. In simulation, it is controlled by Virtual Bench.
  • We assume that the clock radio continuously receives radio waves from the environment. Indeed, the environment sends continuously radio data as a list of radio stations with their frequencies.
  • We assume that the clock time is in 24h display.

USER FEATURES

The model should cover the following user features:

  • The user can turn on/off the radio sound and can change the radio frequency.
  • The user can program/deprogram a daily alarm by mentioning the daily alarm time.
  • When the alarm time is reached, the radio sound turns on.

The model would be validated by the following scenarios on Virtual Bench.

MODEL VALIDATION BY SCENARIOS

Minimum requirements on Virtual Bench

  • The radio sound state is visible
  • The radio station name is visible
  • The alarm program state is visible
  • The alarm time is visible

Scenarios to check

Radio scenario 1

  1. The user turns on the radio sound.
  2. The user tunes the frequency (expected behavior):
    • If the frequency is in the list of radio stations, then the clock radio displays the radio station name.
    • If the frequency is out, then the clock radio displays “unknown radio station”.
  3. The user turns off the radio sound.

Alarm scenario 1

  1. The user programs the alarm.
  2. Wait when clock time has reached the alarm time.
  3. The user turns off the radio sound.
  4. The user deprograms the alarm.

Alarm scenario 2

  1. The user programs the alarm.
  2. Wait when clock time has reached the alarm time.
  3. The user turns off the radio sound.
  4. The user advance or adapt clock time to simulate alarm time 24 hours later.
  5. When clock time has reached the alarm time.
  6. The user deprograms the alarm.
  7. The user turns off the radio sound.
  8. The user adjusts clock time to the last alarm time programed.

Alarm scenario 3

  1. The user turns on the radio sound.
  2. The user programs the alarm.
  3. Wait when clock time has reached the alarm time.

ADVICE BEFORE STARTING

  1. Identify your Use Cases,
  2. Define the states you will encounter in your State Machine,
  3. On Virtual Bench, do not worry about technical solutions (buttons, toggle buttons, etc.), you can add all your triggers on a timeline at the beginning.

On the next page, you will find a solution we realized.