Code Standard and
The purpose of
maintain code standard and quality is to maintain a set consistency and ensure
that the readability, scalability and performance is done to a high standard,
to meet customer requirements. High code quality is a necessary as it will be
easy to reuse because it will focus on strong cohesion (single task orientated,
ie a class has few responsibilities) and loose coupling (class independence).
As an end result, quality code saves time and effort, and makes the produced
software effective and valuable to the user.
Documentation in code
the general formatting of the java documentation for will be
descripted for multi-line comments and for single -line comments.
Where in which instances should the
Documentation in the code should be
implemented at every instance that a new public or private class is declared,
and must describe the overall purpose/ behaviour of the class or method.
Documented a method
Documented a class
Variable names should be short and meaningful in
general; however, the following points should describe the naming that should
Class Names should be noun/pharses that will be
easy to be read and understand when going through code reviews and testing.
Class names should be written like the example
shown here: ‘ProductView’
Method Names will be typically verbs phrases
such as for example: ‘getMessage’
Static final fields
One character parameter names should be
avoided at all costs to provide meaningful names which will be easy to read
when testing and code reviews are being revised.
Local Variable names- should be written like in
the following example ‘paramterOne’
duplication in the code will help in isolating change and will help in
isolating risks that are being developed in the system. Should be adopted when
doing unit testing.
will be 2 spaces and there will be minimal to no trailing white spaces
of Quality check
The resulting quality code will be easy to read and
understand. It must be maintained easily and consistently. It must withstand
any kind of input without breaking or behaving strangely, and must be well
tested. The design and the architecture must be simple. Documentation should be
at a good level, so that during effective changes can be make. Formatting
should be adequately chosen and applied consistently throughout the whole
At all levels (modules, classes, methods) there should be a
strong relation and a high focus of the responsibilities (strong cohesion) –
that means, a piece of code should focus on a particular task and shouldn’t
Functional independence/ (loose coupling) between modules,
classes and methods is will be looked at as this is of importance, as it will
easier to test and issues will be one area that in all areas of code. Suitable
and consistent naming of all program identifiers is a must. Documentation
should be embedded in the code itself.