views:

1387

answers:

4

We always write functions or classes and their logic is very complicated. If there is no specification for these structures, later it will be hard for even ourselves to grasp the ideas.

How do you write specifications for complicated functions and classes?

Please tell me something about your own experience, but not just some link, thanks.

+3  A: 

Check out Joel on Software. And here. And here. There's even a real-world example.

The example is right on the money.
Dave Jarvis
<meg ryan> Yes. Yes. YES! </meg ryan>
sheepsimulator
I'm not entirely sure this is what the OP is looking for, but his article is a great read and a good example of writing user functionality specifications and use cases.
sheepsimulator
@sheepsimulator: does that mean you're only pretending you like the linked pages? :P
Thorarin
A: 

http://en.wikipedia.org/wiki/Functional_specification

See the related links.

Also, ArgoUML (or any UML modeler) can help create visual diagrams that you can include in the specifications.

Dave Jarvis
+2  A: 

You should make on research on the following subjects (not necessarily in order):

These are the most common approaches for software projects specification.

rogeriopvl
+5  A: 

I find the biggest challenge with functional specifications is not the format directly, but keeping them in sync with things that drive them (requirements) and things that build upon them (test cases, documentation).

For that reason, I prefer to handle this issue with a model-driven approach rather than a paper-driven one.

I use a UML modeling tool (Enterprise Architect by Sparx Systems, but many tools work as well) to capture all of the artifacts of the project in one place and create traceability between them. In Enterprise Architect, I can create traceability from a requirement artifact to a design artifact (for example) by just putting them both on the same diagram and creating a connector from one to the other with a mouse drag.

My "functional specification" is actually a collection of activity diagrams, one per use case in the system. Each use case ties back to one or more requirements that necessitate that use case. Even end users find it easy enough to follow the activity diagrams and validate them (how easy is it to get end users to read, let alone understand and validate, a traditional, paper-based functional specification?)

In a similar manner, I can create traceability from my activity diagrams (use cases) to specific design artifacts like class diagrams.

QA can model test cases and create traceability from their test cases to the use cases. That way, we see if there are any use cases that do not have test cases (or don't have enough test cases).

The nice thing about Enterprise Architect as a tool is that all of these artifacts are stored in a SQL database, so I can just run some queries that I have built up over time to find artifacts with nothing tracing to/from them.

Eric J.
'how easy is it to get end users to read, let alone understand and validate, a traditional, paper-based functional specification'Maybe not much difference in practise, but the number of people who would _admit_ to being unable to understand clear technical English is a lot smaller than the number of people who would admit to not being able to read a diagram in a specific technical notation.
soru
We actually review the spec/diagrams by grabbing a conference room and projector, and walking through each diagram with appropriate business people / analysts. It's amazing how many misunderstandings and misconceptions we uncover before writing a line of code.
Eric J.

related questions