Show Lecture.Requirements as a slide show.
CS253 Requirements
Homework Requirements
- Homework assignments come with requirements.
- Requirements are not written in legalese.
- Rather, you are required to extrapolate from what is given.
- Recognize ambiguity. Ask for a resolution.
Example
Consider the requirements for a homework assignment:
Read two integers. If the first isn’t divisible by the second,
print “Oops!”
You might reason:
All numbers are divisible by all other numbers, just not evenly
(forgot about zero). So, I never have to print “Oops!”
Or, you might think:
The assignment doesn’t say what to do if it is divisible.
I’ll print “Oops!” unconditionally!
That sort of reasoning might succeed in court—not here.
Use Your Head
- Assume that I’m not an idiot—the requirement must be there for a reason.
- If the requirement makes no sense to you, then you need to seek
further explanation.
- The requirement might be deliberately ambiguous:
- I might just want an error message, but not particularly care
about the wording, as long as it makes sense.
- I might have just screwed up.
- This isn’t a holy book written centuries ago. Ask!
- Of course, if you first read the assignment a half-hour before it’s due,
asking is more difficult.
Real World
- In the REAL WORLD, requirements are quite informal.
- Your boss might say, “Complain if too many bad web page fetches are
attempted.”
- You might respond:
- “Your specification is totally imprecise!”
- “What is the text of the error messages?”
- “Precisely how do you define ‘bad’?”
- “How many is ‘too many’?”
You would then sit back, cross your arms, and smirk, because you won.
- Your next task includes cleaning toilets.
Real World
- Instead, the boss expects you to use your brain,
and resolve ambiguities.
- You should return to your boss with your interpretation of the assignment:
- “I’ll write a program that scans web sever logs.”
- “It’ll run daily, from cron.”
- “It’ll react to HTTP/HTTPS GETs that aren’t response 200.”
- “It’ll react to more than ten bad accesses in a minute.”
- The boss will either say “Yeah, fine” or correct you.
- Happiness ensues!