Why Can't Spec Writers Write...Specs?

I know, I know, you’d like to see the FizzBuzz discussion die a quick death, but trust me, this is an interesting point, or at least mildly amusing.

Sorry to revive the dead horse, but a comment in my blog brought up a very good point. In fact, I’m kicking myself for not noticing this myself, having been a math major and I love pointing out this type of minutae.

In the original Fizz Buzz test, the functional spec asks the programmer to print the numbers from 1 to 100.

But as a commenter points out...

Why can’t spec writers write? Unless you mean integers, there are an infinite number of real numbers ’from 1 to 100’

Exactly! There are an infinite range of numbers between 1 and 100. The specification is technically not clear enough. Writing a program to spec exactly would... well be impossible.

This is exactly why I said the following in a another comment...

I still need to gather requirements! What platform must this FizzBuzz program support? Any performance requirements? Does the output need to be available over the web?...

Unfortunately, I missed the most important question I should have asked.

I assume you mean all intergers from 1 to 100 inclusive, is that correct?

I know what you’re thinking. In cases like this, developers should be able to intuit what the client means. If a developer asks Do you mean Integers or Real Numbers?, that developer is being a smart ass.

But my point is still valid. If a client says, I want a CRM system, you may know exactly what a CRM system is, but it may be totally different from what they think a CRM system is.

This really highlights the difficulty of writing good requirements and a good spec. You don’t know the background of the person you’re handing off the document to.

What makes perfect sense in your mind might mean something different to the reader.

Perhaps it’s situations like this that lead 37Signals to advocate getting rid of functional specs altogether.

Whether you go that extreme or not is not so important as keeping the lines of communication open with your client. Never accept a requirement and functional spec at face value. Specs are always a poor approximation of what the client really wants. All specs are broken to one degree or another (though that doesn’t mean they are all useless). Ask for clarification. Keep the dialog going.

This is also one reason why Big Design Up Front (BDUF) can really nail you in the butt. These subtle things are missed all the time. Having an iterative process where you’re not on the hook for requirements gathered months ago gathering dust helps mitigate the risk of incomplete and inaccurate requirements.

Even by thousands of software developers reading blogs.

What others have said

Requesting Gravatar... Jeremy Miller Mar 07, 2007 11:03 AM
# re: Why Can't Spec Writers Write...Specs?
Phil,

I think you've got the highest "Amen!" quotient of any blogger on the web.

Jeremy
Requesting Gravatar... Rob Conery Mar 07, 2007 11:06 AM
# re: Why Can't Spec Writers Write...Specs?
I see your point definitely, but in many ways (in the work place especially) a person marks their ability by the questions they ask. In an interview setting, if I was the interviewer and threw down FizzBuzz, and the candidate said to me "do you want integers or all real numbers?" I would be tempted to say something snarky like:

"Good question. I have nothing to do for the next infinite amount of time - so let's go with Real. How exactly would you create such a loop anyway?"

But instead would say:

"Thank you for your time"

I know the point your making here Phil (and believe me, I agree whole-heartedly that spec writing needs to improve) but I think it's all the more important to know which questions to ask. This would NOT be one of them :).
Requesting Gravatar... Peder Rice Mar 07, 2007 11:13 AM
# re: Why Can't Spec Writers Write...Specs?
I would write the loop to randomly move through the numbers, and also print some numbers multiple times. I would also print other numbers outside the set, as the specifications say nothing prohibiting this. To top things off, I would encrypt all data and then display the encrypted data's binary. And then I would.....

You get the picture.
Requesting Gravatar... Joe Mar 07, 2007 11:23 AM
# re: Why Can't Spec Writers Write...Specs?
Exactly! There are an infinite range of numbers between 1 and 100. The specification is technically not clear enough. Writing a program to spec exactly would... well be impossible.


This is why the girls in sales and marketing never ask the IT guys to go to lunch.
Requesting Gravatar... Haacked Mar 07, 2007 11:55 AM
# re: Why Can't Spec Writers Write...Specs?
@Jeremy: Thanks! That's good to hear coming from someone like you.

@Rob: Well my point is more that Specs are broken than that we need to improve spec writing. Sure we need to improve it, but they need to be seen for what they really are. The beginning of an ongoing conversation with clients.

@Joe: Don't knock the ability of geek talk to woo the ladies. ;) My wife loves it when I talk geek. She also thinks my typing sounds like popcorn popping.
Requesting Gravatar... Jeff Atwood Mar 07, 2007 6:02 PM
# re: Why Can't Spec Writers Write...Specs?
> Unless you mean integers, there are an infinite number of real numbers ’from 1 to 100’

This an incredibly dense statement that only Homo Logicus would ever make.

Are programmers really this out of touch with the real world? Must every statement be laden with qualifiers and explanations, as if we're speaking to an autistic person?
Requesting Gravatar... Christopher Steen Mar 07, 2007 7:35 PM
# Link Listing - March 7, 2007
Updating the MultiDayForecast Web Control [Via: ] Ajax Portlets: JSR-168 portlets, SOA, and more [Via:...
Requesting Gravatar... Pat Dobson Mar 08, 2007 12:09 AM
# re: Why Can't Spec Writers Write...Specs?
Very good points.

I worked for a company who proposed and then installed a large CONTENT management system for a very large publicly funded UK organisation. Very soon after deployment it was discovered what they actually wanted was a DOCUMENT management system.

The point being, if a big 'professional' company can screw up like that, smaller organisations must be really careful and don't skimp on design briefs and specifications...
Requesting Gravatar... Shan Plourde Mar 08, 2007 5:37 AM
# re: Why Can't Spec Writers Write...Specs?
I agree with Rob Conery's comment:

"in many ways (in the work place especially) a person marks their ability by the questions they ask."

It's also worth pointing out that a spec writer, be it a developer, business analyst, consultant, etc., is often working in ambiguous situations which to me are the most exciting ones to be in because you're being the given the opportunity to help to refine/define a need, rather than just be someone who's delegated information to that needs to capture it accurately - exciting stuff!

That point alone really brings home the fact that capturing needs is not just about a person's capturing skills, but it's about their listening skills and capability to participate in ambiguous environments.

Final note - a lot of the time meetings are organized so that people capturing notes just have to listen and capture accurately without proactively participating in conversations. Meetings themselves don't always produce specs but should produce accurate notes, and there should always be people on the capturer's side who are proactive and capable of working effectively in ambiguous environments!
Requesting Gravatar... SLW Mar 08, 2007 6:13 AM
# re: Why Can't Spec Writers Write...Specs?
Rob: How would I write the loop? Lazy lists that give BFS order of the recursive subdivision, so you'd get 50 25 75 12.5 37.5 62.5 87.5 etc. Fairly easy to do with streams in scheme, and you'd get all the numbers if you waited long enough.

PS: Live preview is laggy.
Requesting Gravatar... Jon Limjap Mar 08, 2007 7:10 AM
# re: Why Can't Spec Writers Write...Specs?
Phil,

Well, since you are a math major, you certainly are forgetting that the spec did mention divisibility, and divisibility, along with the modulo and the concept of a remainder, is only applicable to the set of real integers.

I would however agree with the inclusive/exclusive argument. Programmers tend to always assume that they know what they know until the users tell them that they want something else.
Requesting Gravatar... Brandon K. Mar 08, 2007 8:59 AM
# re: Why Can't Spec Writers Write...Specs?
Why can't Project Managers Manage...Projects?

The post is interesting, but I guess given some of the other stipulations it would be integer numbers. When in the spec it says every multiple of 3 should print Fizz, every multiple of 5 should print Buzz, and every multiple of 3 and 5 should print FizzBuzz, makes me assume they are refering to integer numbers. Making that assumption might be bad, but for something like that does it have to be spelled out like 1 + 1 = 2. BTW sorry if I messed up the FizzBuzz multiples I am doing it from memory.
Requesting Gravatar... Haacked Mar 08, 2007 10:11 AM
# re: Why Can't Spec Writers Write...Specs?
@Jon and Brandon: I merely pointed out this issue to be funny. As Jeff pointed out, a developer would have to be an idiot not to understand the intent.

However, I should point out that divisibility and modulo arithmetic does apply to real numbers and not just integers.

The real point is clear when you substitute that scenario for something that really is open to interpretation. Like CMS or CRM.

Maybe I should ask readers for good examples of requirements that sounded straightforward at first, but when the time came to implement, was confusing or lacked essential details.
Requesting Gravatar... Brandon K. Mar 08, 2007 11:30 AM
# re: Why Can't Spec Writers Write...Specs?
Phil,

That link made my head hurt a little.
Requesting Gravatar... Steve Smith Mar 08, 2007 11:33 AM
# re: Why Can't Spec Writers Write...Specs?
Love your Gravatar, Phil.
Requesting Gravatar... Haacked Mar 08, 2007 12:00 PM
# re: Why Can't Spec Writers Write...Specs?
@Brandon, that's because nobody in the Mathematics world (other than Martin Gardner) knows how to write in plain English.
Requesting Gravatar... Scott Mar 08, 2007 12:00 PM
# re: Why Can't Spec Writers Write...Specs?
"Are programmers really this out of touch with the real world? Must every statement be laden with qualifiers and explanations, as if we're speaking to an autistic person?"

Yes, because we have to deal with users all day long. Dealing with people who routinely call Excel Spreadsheets "databases" when you spend the other half of your day correcting case on variable names and telling compilers EXACTLY what you want them to do, down to differentiating different KINDS of numbers (decimal, float, int) imposes a certain mindset. The "you-can't-trust-what-anyone-says" mindset.

Because here is how FizzBuzz would work in real life. The project manager would say you should loop over a list of numbers, the client would say they will provide the list of numbers, they would confirm that they are integers when you ask them, then they would send the file over containing the list of numbers. You would look at the list and see the following:

one
Two
three
three-a

Then they would wonder why you are drinking so much more lately. The file would be in EBCDIC format of course.
Requesting Gravatar... Jon Galloway Mar 08, 2007 1:13 PM
# re: Why Can't Spec Writers Write...Specs?
Why are we all talking like... this?

It's freaking me... out.
Requesting Gravatar... Haacked Mar 08, 2007 1:14 PM
# re: Why Can't Spec Writers Write...Specs?
ROFL! It's funny because it's so true.


three-a


That's going in my Skype/Yahoo sig!
Requesting Gravatar... Jon Limjap Mar 08, 2007 4:56 PM
# re: Why Can't Spec Writers Write...Specs?
Well, off the top of my head:

When a user asks for a page with *a* drop down list of years and month (no date involved), a developer would almost instantly think:

a) one dropdown list for the year
b) one dropdown list for the month

Thing is when we presented this to the client, the client actually wanted to have a drop down list with values like:

2007/01, 2007/02, 2007/03... 2007/12

It wasn't intuitive to us developers, and it certainly made the final HTML output inefficient, but the users simply didn't want to have to click on two drop down lists for the filter.
Requesting Gravatar... Haacked Mar 08, 2007 5:30 PM
# re: Why Can't Spec Writers Write...Specs?
Case in point, doesn't the following output meet the letter of the spec?

1
2
Fizz
4
5Buzz
Fizz
7
8
Fizz
10Buzz
11
Fizz
13
14
FizzBuzz

My point being, the spec is explicit about replacing numbers divisible by three with "Fizz", but it doesn't say to replace numbers divisible by five.
Requesting Gravatar... Jon Galloway Mar 08, 2007 5:38 PM
# re: Why Can't Spec Writers Write...Specs?
That "three-a" one is great. I'd also expect to see the following values:

three hundred & forty-five
fourty-eleven
"three"
187 (straiit up gangsta!)
100 + 20 + 5
0x8004005
Requesting Gravatar... Rob Conery Mar 08, 2007 5:42 PM
# re: Why Can't Spec Writers Write...Specs?
@Tap and @Ray this was my point when I said it was wrong in Phil's last post on this well-beaten topic. I thought I was being picky (so let it go) but if you read the spec a few times you realize that Phil's response was correct (as written) but so is this for line 15

FizzBuzzFizzBuzz

Since 15 meets all conditions and the spec doesn't say anything about explicit output :).

@SLW: are you trying to tell me you know how to write a loop with REAL numbers from 1 to 100? Given your lazy (sic) approach, how would you even increment the first step before being consumed by a black hole?
Requesting Gravatar... you've been HAACKED Mar 08, 2007 5:48 PM
# Specs Are Always Ambiguous
Specs Are Always Ambiguous
Requesting Gravatar... Community Blogs Mar 08, 2007 6:12 PM
# Specs Are Always Ambiguous
One last point, then I’m done with this topic of FizzBuzz and spec writing. In a recent post , I mentioned
Requesting Gravatar... Community Blogs Mar 09, 2007 1:53 AM
# Requirements and Specs Are Always Ambiguous
UPDATE: As an aside, it would probably be more accurate to say the FizzBuzz question is a Requirement
Requesting Gravatar... purpleblob Mar 16, 2007 2:11 AM
# re: Why Can't Spec Writers Write...Specs?
Whilst the comment asking the interviewer whether they want integers between 1 and 100 or reals may suggest the candidate is being a smart ass, in fact the candidate is doing what they should be doing and that is ensuring they full understand the requirements.

I appreciate an interviewer may feel inclined to be sarcastic at such a question from a candidate, but in fact they would be demonstrating their own failings at making sure the "spec." was complete.
Requesting Gravatar... JC May 29, 2007 1:29 PM
# re: Why Can't Spec Writers Write...Specs?
I noticed that it was not clear if there should nothing, a space or a new line between the numbers. That doesn't sound important, but from experiece, many "well that's just common sense" assumptions aren't.

What do you have to say?

(will show your gravatar)
Please add 5 and 4 and type the answer here: