


















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















At the end of the design phase we have:
module structure of the system
module specifications:
data structures and algorithms for each module.
Objective of coding phase:
transform design into code
unit test the code.
Advantage of adhering to a
standard style of coding:
it gives a uniform appearance
to the codes written by
different engineers,
it enhances code
understanding,
encourages good programming
practices.
A coding standard
sets out standard ways of
doing several things:
the way variables are named,
code is laid out,
maximum number of source
lines allowed per function,
etc.
Code inspection and code
walk throughs
Code inspection and code
walk throughs
Detect as many errors as
possible during inspection and
walkthrough:
detected errors require less
effort for correction
much higher effort needed if
errors were to be detected during
integration or system testing.
Representative Coding
Standards
Rules for limiting the use of globals:
what types of data can be declared
global and what can not.
Naming conventions for
global variables,
local variables, and
constant identifiers.
Representative Coding
Standards
Contents of headers for
different modules:
The headers of different
modules should be standard for
an organization.
The exact format for header
information is usually specified.
Naming conventions for global
variables, local variables, and
constant identifiers: A possible
naming convention can be that global
variable names always start with a
capital letter, local variable names are
made of small letters, and constant
names are always capital letters.
Representative Coding
Standards
Error return conventions and
exception handling mechanisms.
the way error and exception
conditions are handled should be
standard within an organization.
For example, when different
functions encounter error conditions
should either return a 0 or 1
consistently.
Representative Coding
Guidelines
Clever coding can obscure
meaning of the code:
hampers understanding.
makes later maintenance
difficult.
Avoid obscure side effects.
Representative Coding
Guidelines
Code should be well-documented.
Rules of thumb:
on the average there must be at
least one comment line
for every three source lines.
The length of any function should
not exceed 10 source lines.
Representative Coding
Guidelines
Code review
Code review for a model is carried out
after the module is successfully compiled
and the all the syntax errors have been
eliminated.
Normally, two types of reviews are carried
out on the code of a module.
These two types code review techniques
are code inspection and code walk
through.