Professional Documents
Culture Documents
Coding: Coding Standards Coding Guidelines Code Walkthrough Code Inspection Software Documentation Gunning's Fog Index
Coding: Coding Standards Coding Guidelines Code Walkthrough Code Inspection Software Documentation Gunning's Fog Index
Coding: Coding Standards Coding Guidelines Code Walkthrough Code Inspection Software Documentation Gunning's Fog Index
Introduction
Coding Standards
Coding Guidelines
Code Walkthrough
Code Inspection
Software Documentation
Gunning’s Fog Index
1
Introduction
The input to the coding phase is the design document.
During coding phase:
◦ Modules identified in the design document are
coded according to the module specifications.
At the end of the design phase we have:
◦ module structure (e.g. structure chart) of the system
◦ module specifications:
data structures and algorithms for each module.
Objective of coding phase:
◦ transform design into code
◦ unit test the code.
2
Coding Standards
Good software development organizations
require their programmers to:
◦ adhere to some standard style of coding
called coding standards.
Many software development
organizations:
◦ formulate their own coding standards that
suits them most,
◦ require their engineers to follow these
standards rigorously
3
Coding Standards - Advantage
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 , comments etc.
4
Representative Coding Standards
Naming conventions for
◦ global variables,
◦ local variables, and
◦ constant identifiers.
6
Code inspection and code walk
through
After a module has been coded,
◦ code inspection and code walk through are carried out
◦ ensures that coding standards are followed
◦ helps detect as many errors as possible before testing.
7
Code walk through
Informal code analysis technique
Some test cases are selected and their
execution are simulated by hand
Process of walk through are governed by
the developers experience and ability
Code walk through should not be one of
the evaluation criteria of a developer
Purpose should be error discovery and not
how to fix errors
8
Code Inspection
Its purpose is to find common made
errors by going through the code
Good companies record all the common
errors made by a developer which
becomes a checklist for future
Coding standard is also verified here
Examples
◦ Checking for infinite loops
◦ Checking for incorrect logical operators
9
Software Documentation
When developing a software product we
develop various kinds of documents apart
from the executable files and the source code:
◦ users' manual,
◦ software requirements specification (SRS)
document,
◦ design document, test document,
◦ installation manual, etc.
All these documents are a vital part of good
software development practice.
10
Software Documentation
Software documents can be classified into:
◦ internal documentation,
◦ external documentation (supporting documents).
11
Internal Documentation
Good software development organizations
ensure good internal documentation through
coding standards and coding guidelines.
Example of unhelpful documentation:
◦ a = 10; /* a made 10 */
Observation suggests:
12
External Documentation
A systematic software development style
ensures that all external documents are
produced in an orderly fashion.
An important feature of good documentation
is consistency.
All the documents should be up to date
◦ Out of date documents cause a lot of confusion
13
Textual Documents
Readability is an important attribute of
textual documents.
Readability determines understand ability
hence determines maintainability.
A well-known readability measure of text
documents:
◦ Gunning’s Fog Index.
14
Gunning’s Fog Index
15
Example of Gunning’s Fog Index
Rock-a-bye baby, on the treetop. When the wind blows,
the cradle will rock. When the bough breaks, the cradle
will fall. And down will come baby, cradle and all.
Number of words : 31
Number of sentences: 4
Number of 3 syllables or more word : 0