How to Write a Program/Requirements analysis

This in itself is the topic of many large books and the career of many well paid consultants. Google will guide you into that vast realm.

And doubtless other wiki editors may expand hugely on the topic. But here I will merely state

Rule 2 : Analysis Paralysis is the greatest danger your program will ever face.

You may have heard that many programming projects fail or are delivered way over time and over budget.

The dead truth is that most programs simply are never even started!

They freeze up and die in an perpetual analysis phase.

You certainly could do worse than generate the artifacts prescribed by the Rational Unified Process, but save that for when you really have something huge to do.

Start by writing down, very simply, what you want the program to do.

Don't get fancy now, half a page handwritten absolute maximum. Trust me.

Lets try that now...

I want to drive the Povray ray tracer from ruby.

Well, scratch that one out. It's a techno goal. As soon as you see specific technologies on your page, scribble them out and try again...

I want to draw cool pictures with mathematically precise placement of maybe thousands of objects.

Ah. That is better. But too fuzzy.

Well, actually I was trying to draw a string in povray and I got frustrated with the scene description language and I wished for the power of my favourite language. But my favourite language doesn't do raytracing. I found the modelers like kpovraymodeler drove me nuts and weren't doing what I wanted.

Oo, nice. This is what the customer was trying do.

Rule 3: When someone, including yourself, tells you to "Write a Program to do...", make a few loose notes and then ignore him.

Always, always, always get up, and go over to their work place and understand first what they are trying to do. I promise you from hundreds of experiences if you just obey them, and create the program they (and/or yourself) told you to, you will write the wrong program!

Write down a couple of ways in which you want to interact with it. These are called use cases and Google will give you a million pages on them. I will have finished the program before you have read half the important pages on the topic... :-)

  • I want to be able to create my objects in my pet programming language and have them appear as pretty pictures on the screen.
  • ...


Further reading

edit