Course: Software Engineering - Design I
A Case Study
This case study is about specifying a video recorder;
This Unit defines:
» underlying functionality
»“plumbing” together components
» dates (example of schema disjunction)
Tutorial 3 is on extending this specification.
Unit 4: A Case Study
Slide Number 1
Course: Software Engineering - Design I
Video recorder: basic functionality
Antenna
RF = Radio Frequency – all channels together
RF
YUV Sound
Tuner
tune_ch?
YUV
Sound
Record
Tape
Unit 4: A Case Study
Play
Tape
Modulator
mod_ch?
RF
+
RF
• YUV Sound = Picture +
Sound for a single channel
• mod_ch?: channel on
which recorder output is
added to RF signal.
• tune_ch?: channel that
recorder is tuned to.
Slide Number 2
Course: Software Engineering - Design I
Terminology
Two kinds of signals: RF and YUVSound.
• RF (Radio Frequency) signal:
– as picked up by antenna
– also needed by the TV
– contains all the channels.
• Physical Channel: frequency band, numbered between 21 and 69.
• YUVSound signal: information for a single channel
– as used for tape deck
– 4 information components: 3 for colour picture, 1 for sound
• Tuner converts RF to YUVSound
– selects signal for a given channel “tune_ch?” and extracts
YUVSound information
Unit 4: A Case Study
Slide Number 3
Course: Software Engineering - Design I
Hardware specification
• Can describe inputs and outputs for components.
• Sorts –
–
–
–
–
RFsig
for RF signal
YUVsig
for YUVSound signal
CHAN = {n:N | 21 n 69} for physical channels
TAPE
for tape signals
• Expressions
– empty: YUVsig
for absent signal
– s[ch]: YUVsig (s: RFsig, ch:CHAN)
for signal on s at channel ch
– sig(t): YUVsig (t:TAPE)
YUVSound signal stored on tape
Unit 4: A Case Study
Slide Number 4
Course: Software Engineering - Design I
Specifying components
Tuner
tuner_in?: RFsig
tune_ch?: CHAN
tuner_out!: YUVsig
tuner_out! = tuner_in?[tune_ch?]
tuner_in?
Tuner
tune_ch?
tuner_out!
Modulator
mod_in? Modulator mod_out!
mod_in?: YUVsig
mod_ch?
mod_ch?: CHAN
mod_out!: RFsig
mod_out![mod_ch?] = mod_in?
"ch:CHAN. (ch mod_ch? mod_out![ch] = empty)
Unit 4: A Case Study
Slide Number 5
Course: Software Engineering - Design I
Record
(ignores detail about position of tape)
rec_in?: YUVsig
rec_out!: TAPE
sig(rec_out!) = rec_in?
Play
play_in?: TAPE
play_out!: YUVsig
play_out! = sig(play_in?)
rec_in?
Record
rec_out!
play_out!
Play
play_in?
mix_in1?
Mix
mix_out!
mix_in2?
Mix
mix_in1?, mix_in2?, mix_out!: RFsig
"ch:CHAN.
((mix_in1?[ch] = empty mix_out![ch] = mix_in2?[ch])
(mix_in2?[ch] = empty mix_out![ch] = mix_in1?[ch]))
Unit 4: A Case Study
Slide Number 6
Course: Software Engineering - Design I
Plumbing
Can specify how components are connected together:
Idle
Recording
antenna?, TV!: RFsig
Idle
Tuner
Record
Modulator
rec_in? = tuner_out!
Mix
tuner_in? = mix_in1? = antenna?
tuner_out! = mod_in?
Mix
Tuner
Modulator
mod_out! = mix_in2?
mix_out! = TV!
Exercise: what
Record
are connections
for playback?
Tuner
Modulator
Unit 4: A Case Study
Mix
Slide Number 7
Course: Software Engineering - Design I
Timer mode v. manual mode
• Need to avoid conflict between recording and
playback.
• Assume machine has two modes:
Timer mode
• Will record automatically according to recording schedule. It
needs specifications of
» time
» schedule of programs
» internal timer tick operation
Manual mode
• Can record or play back under manual control.
• Ignores recording schedule.
Unit 4: A Case Study
Slide Number 8
Course: Software Engineering - Design I
Dates
month_lengths = {(1,31), (2,28), (3,31), (4,30), (5,31),
(6,30), (7,31), (8,31), (9,30), (10, 31), (11, 30), (12, 31)}
NormalDate
d,m,y: N
$n:N. ((m,n) month_lengths
1 d n)
Feb29
d,m,y: N
d = 29
m=2
(y mod 4 = 0 y mod 100 0)
y mod 400 = 0
Date = NormalDate Feb29
Unit 4: A Case Study
Slide Number 9
Course: Software Engineering - Design I
Tomorrow
TomorrowSameMonth
DDate
d' = d+1
m' = m
y' = y
TomorrowNewMonth
DDate
(m,d) month_lengths
m 2 m 12
d' = 1
m' = m+1
y' = y
Unit 4: A Case Study
TomorrowNewYear
DDate
d = 31 m = 12
d' = 1 m' = 1
y' = y+1
Note: Axioms in Date and Date'
ensure that both days are valid.
Slide Number 10
Course: Software Engineering - Design I
TomorrowMar1Non-leap
DDate
d = 28 m = 2
d' = 1 m' = 3 y' = y
y mod 4 0
(y mod 100 = 0 y mod 400 0)
TomorrowFeb29
DDate
Feb29'
d = 28 m = 2
y' = y
TomorrowMar1Leap
DDate
Feb29
d' = 1 m' = 3 y' = y
Tomorrow = TomorrowSameMonth TomorrowNewMonth
TomorrowFeb29 TomorrowMar1Non-leap
TomorrowMar1Leap TomorrowNewYear
Unit 4: A Case Study
Slide Number 11
Course: Software Engineering - Design I
Substitution
Will might need to substitute variables in schema. Assume the schema Date
given in slide 9.
Day1BeforeDay2
Date1
• Consider the following schema:
Date2
d1 < d2 m1 = m2 y1 = y2
• Consider “start.” and “stop.” as decorations.
Day1BeforeDay2 [Date1/start.Date, Date2/stop.Date]
Axioms of Day1BeforeDay2 but with
d1 substituted with start.d
d2 substituted with stop.d,
m1 substituted with start.m,
ect…
Unit 4: A Case Study
MyBefore
stat.Date
stop.Date
Day1BeforeDay2 [Date1/start.Date,
Date2/stop.Date]
Slide Number 12
Course: Software Engineering - Design I
Unit 4: A Case Study
Slide Number 13
© Copyright 2026 Paperzz