Software Engineering Assignment
Software Engineering Assignment
Software Engineering Assignment
Programming style
Programming style is set of coding rules followed by all the programmers to write the code.
When multiple programmers work on the same software project, they frequently need to work
with the program code written by some other developer. This becomes tedious or at times
impossible, if all developers do not follow some standard programming style to code the
program.
An appropriate programming style includes using function and variable names relevant to the
intended task, using well-placed indentation, commenting code for the convenience of reader
and overall presentation of code. This makes the program code readable and understandable by
all, which in turn makes debugging and error solving easier. Also, proper coding style helps ease
the documentation and updating.
Coding Guidelines
Practice of coding style varies with organizations, operating systems and language of coding
itself.
The following coding elements of an organization are:
Naming conventions - This section defines how to name functions, variables, constants
and global variables.
Indenting - This is the space left at the beginning of line, usually 2-8 whitespace or
single tab.
Operators - Defines the rules of writing mathematical, assignment and logical operators.
For example, assignment operator = should have space before and after it, as in x = 2.
Control Structures - The rules of writing if-then-else, case-switch, while-until and for
control flow statements solely and in nested fashion.
Line length and wrapping - Defines how many characters should be there in one line,
mostly a line is 80 characters long. Wrapping defines how a line should be wrapped, if is
too long.
Functions - This defines how functions should be declared and invoked, with and
without parameters.
Variables - This mentions how variables of different data types are declared and defined.
Comments - This is one of the important coding components, as the comments included
in the code describe what the code actually does and all other associated descriptions.
This section also helps creating help documentations for other developers.
Design Process
Software design process can be perceived as series of well-defined steps. Though it varies
according to design approach (function oriented or object oriented, yet It may have the
following steps involved:
A solution design is created from requirement or previous used system and/or system
sequence diagram.
Objects are identified and grouped into classes on behalf of similarity in attribute
characteristics.
Bottom-up Design
The bottom up design model starts with
most specific and basic components. It
proceeds with composing higher level of
components by using basic or lower level
components. It keeps creating higher level
components until the desired system is not
evolved as one single component. With
each higher level, the amount of abstraction
is increased.
Bottom-up strategy is more suitable when a
system needs to be created from some
existing system, where the basic primitives
can be used in the newer system.
Both, top-down and bottom-up approaches are not practical individually. Instead, a good
combination of both is used.
Advantages:
- Advantageous if major flaws occur toward the bottom of the program.
- Test conditions are easier to create.
- Observation of test results is easier.
Disadvantages:
- Driver Modules must be produced.
- The program as an entity does not exist until the last module is added.
Example: These are two design approaches, which can be explained as:
You can imagine a tree like structure, in which when you are following top-down approach you
move from root node to leaf node and when you follow bottom-up approach you follow leaf
node to root node.
Top-down approach:
In this an overview of the system is first formulated, specifying but not detailing any first-level
subsystems. Each subsystem is then refined in yet greater detail, sometimes in many additional
subsystem levels, until the entire specification is reduced to base elements.
Bottom-up approach:
In this approach the individual base elements of the system are first specified in great detail.
These elements are then linked together to form larger subsystems, which then in turn are linked,
and in many levels, until a complete top-level system is formed.