Java – How to make a great functional specification

javaproject-managementprojects-and-solutionsspecifications

I am going to start a little side project very soon, but this time i want to do not just the little UML domain model and case diagrams i often do before programming, i thought about making a full functional specification. Is there anybody that has experience writing functional specifications that could recommend me what i need to add to it? How would be the best way to start preparing it?
Here i will write down the topics that i think are more relevant:

  • Purpose
  • Functional Overview
  • Context Diagram
  • Critical Project Success Factors
  • Scope (In & Out)
  • Assumptions
  • Actors (Data Sources, System Actors)
  • Use Case Diagram
  • Process Flow Diagram
  • Activity Diagram
  • Security Requirements
  • Performance Requirements
  • Special Requirements
  • Business Rules
  • Domain Model (Data model)
  • Flow Scenarios (Success, alternate…)
  • Time Schedule (Task Management)
  • Goals
  • System Requirements
  • Expected Expenses

What do you think about those topics? Shall i add something else? or maybe remove something?

I rode every single answer, and i would like to thank all of you for the useful information.

I am doing this side project for a company, and they spect from me a constant flow of communication and i will need to explain why i do every single thing, because i will have to administer the resources they will give to me.
This will be my first func spec and as i said i want it to be useful, not just big and useless.
I think this is something that has to be done, but i want to do it in the way that will be more useful for me and my team. Its bad that i we dont have a manager, so thats why i also need to take care about some administrative tasks…

Regarding to the agile programming, i think this is 100% compatible with the agile aproach. I am an Agile programmer my self and i honestly fell more confident when someone already did the thinking for me. I still Junnior, but i worked before as a Tapestry web developer in other projects, were the organization was a total chaos.

I dont agree i am doing a waterfall aproach, i think i am just trying to define some boundaries that will make the project being easier when the development starts.

Best Answer

What you suggest is fine from the point of view of the Systems Engineering purists.

(There will be a few Agile devotees who think its all way overt the top... and you should just get out and do stuff with the usual reviews, etc).

However, you need to take into account what you are doing, and who you are doing it for.

Doing a project for yourself is different to doing it for somebody else - for money.

When you work for somebody else (either in a company or on contract) the ONLY means of communication are speaking, and writing. (Ultimately there will be a product or result which can be assessed.)

The whole point of a specification is to try and reduce the cost of making fixes and changes that come later. You may have seen the graphs showing cost of making fixes at different stages of a project, it goes something like this:

  • A fix made to a dumb idea costs $1

  • A fix made when the dumb idea made it into a specification (that has to be updated) costs $10

  • A fix made when you have built a prototype costs $100

  • A fix made about the time you are doing an acceptance before shipping costs $1000

  • A fix made after you have shipped and pissed off your customers costs $10000.

So what you write in a specification is pretty important.

To argue that you should have no specification at all is naive, foolish, and probably dangerous.

One of the biggest problems you have in writing a specification is knowing when you have gone too far. This varies depending on the size of the project. For example, a project taking 1-2 people about a year should have somewhere between about 2 and 4 WEEKS in total spent on specification... which includes the investigation of feasibility... the spec to be written by the people who actually do the work not some high falutin analyst type who does not know the gory details. A project taking 10 people 2 years needs a lot longer.

Now for some comments on your various points:

  • Purpose

YES, write this. Keep it to 1-2 paragraphs, 1/2 page max.

  • Functional Overview

MAYBE. Only if it adds value to everything else.

  • Context Diagram

ESSENTIAL. Shows ALL inputs and outputs. Shows context. You can (and should) spend a reasonable amount of time on this.

  • Critical Project Success Factors

MAYBE. Surely if the project meets the requirements its a success. I think this is not really needed.

  • Scope (In & Out)

NO. Your context diagram does this.

  • Assumptions

YES. Try and keep it brief.

  • Actors (Data Sources, System Actors)

MAYBE. This sounds like technical gory bits of design to me which should not be in a FUNCTIONAL specification.

  • Use Case Diagram

MAYBE. Put this (these) in an appendix. Explain with words. Try to keep these to a small number. I have seen suggestions that a project should have not more than 8 Use Cases explained in detail. Don't cover all the "unahppy" paths or you will never finish.

It is very rare for any piece of s/w to have a single Use Case / Use Case Diagram.

  • Process Flow Diagram

MAYBE. Only if it adds significant value, else you are wasting your time.

  • Activity Diagram

MAYBE. Only if it adds significant value, else you are wasting your time.

  • Security Requirements

YES - if relevant.

  • Performance Requirements

YES - mandatory. Must say what the thing must do (and with what level of performance).

  • Special Requirements

MAYBE - if there is anything special.

  • Business Rules

MAYBE - if useful.

  • Domain Model (Data model)

MAYBE - if useful.

  • Flow Scenarios (Success, alternate…)

MAYBE - if useful.

  • Time Schedule (Task Management)

NO. This is not what should be in a spec. Its about schedule, planning, etc.

  • Goals

MAYBE. Goals are not requirements, they are vague fluffy wouldn't-it-be-nice things, which serve to muddy the waters. Try and avoid.

  • System Requirements

YES. Essential. Says what the thing must do.

  • Expected Expenses

NO. Part of planning and management, not the requirements of the thing you are making.


Explanation: I've been writing specifications for products, software, and complex systems for over 15 years. All commercial stuff. Mostly commercially successful and made a lot of money for various employers. Including specification for Agile s/w development where you still need a spec before you leap into the development. The ACTUAL development can be done in whatever process you want, but in the end you must have 3 things for success:

  1. Know what you want to do. AND WRITE IT DOWN. (Thats a spec.)

  2. Do stuff to meet #1 above.

  3. Do some level of acceptance testing of the thing against the spec (which is essentially "did you do what you said you would do").