This page contains a description of the overall standard. How to use the
tools mentioned here, is described in the other pages in this section.
In order to ensure the production of high quality code, it is recommended
that all developers adhere to the following standards:
pick a new task
Be sure to pick a task that has not yet been attacked. Check
the to-do pages and inform the others what you are about to do.
have a clear idea what your code should be
doing
The goal is that you develop a very clear and detailed idea about
the software needs for this task.
write down a list of requirements and discuss
it with others
Having the requirements in a written form is the best starting
point for the discussions with others. As you explain, you may notice possible
logical holes in your concept or your discussion partners may have ideas
that you haven't overlooked or not explicitly excluded.
add your new files to the repository
It is important to keep your thoughts in a safe place. Remember
the library in Alexandria in the past -- they did not have a backup. The
commands for cvs (and bfd) are given at the end of the page.
identify the elements that you want to use
or that you need to develop for your new task
Look out whether you find classes or concepts that you could
use. Sometimes it may also be necessary to write other self-contained packages
first and afterwards return to the orginal task.
by now you have probably a good idea what
the states are that your application can be in
The life cycle of an application usually is more complicated
than creation, doing onr thing and deleting the references to it afterwards.
In the current step you will probably be able to draw well-structured state
machine (see the glossary or the other pages in this section).
store your new diagrams in the repository.
Keep all your thoughts together in one place. This place is the
repository. You can access it from everywhere, there are backups, you don't
need to mail things around, as everybody else can access the repository
as well.
identify classes and what they need to accomplish
Now is the time where you split this complex and ominous 'application'
into actual classes and give them appropriate names that are self-explanatory.
Try to make your colleagues' lives easy by picking mid-sized yet clear
names for your packages, classes and variables.
develop a control flow diagram, one for each
class, showing its interactions with other objects during its life cycle
The classes from the former step will have to contain certain
methods in order to function together. Try to split up the tasks into small,
logically separate tasks and draw the connections of your new class to
other classes. At this time you also identify the time ordering of actions
in all detail and you should check carefully that your draft makes sense.
Discuss your control flow diagrams with others and try to find a good answer
to all their concerns. If necessary, change your approach. Try to find out,
whether your solution could be replaced by something maybe more elegant.
again, keep a backup in the repository
This cannot be repeated too often.
compare to your initial requirements -- still
in sync? bring up-to-date
Sometimes it happens that one gets dragged away due to excitement
about the cool new class one has just invented. Therefore it is most of
the time a good idea to compare the initial requirements to the draft of
your code as of now. Maybe, with the experience you collected by now, you
can get rid of a few requirements or re-formulate them. It is always good
to have requirements and your outline of the code in sync.
each of the requirements corresponds to a
unit test for your new project
It is a good idea to write some java code that subjects all your
classes to a functional test as to whether your classes are in fact doing
what you took down as requirements. This is for example important when
your code gets changed later and would not function properly any more.
All tests in the directory structure get executed at compile time for a
new release and such faulty edits can be repaired or reverted.
armed with all your well-structured thoughts,
only now start to write code
Except for maybe a toy-class to try an idea out, it is not before
now, that you create the packages, classes and test classes for your project.
use ant to create packages and classes
The development environmene for IceCube has been setup to include
templates for packages and classes that facilitate writing of proper code.