Software Engineering Assignment

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

SOFTWARE ENGINEERING II ASSIGNMENT

TOPICS : Programming Style , Top down Approach & Bottom up Approach


BY : SHAURYA KAPOOR Roll No. 16
PIYUSH PANT- Roll No. 23
JAYADITYA GUPTA-Roll No. 39

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.

Whitespace - It is generally omitted at the end of line.

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.

Class hierarchy and relation among them is defined.

Application framework is defined.

Software Design Approaches


Two approaches for software designing are:

Top Down Design

We know that a system is composed of more than one sub-systems and it


contains a number of components. Further, these sub-systems and
components may have their onset of sub-system and components and
creates hierarchical structure in the system.

Top-down design takes the whole


software system as one entity and then
decomposes it to achieve more than one
sub-system or component based on some
characteristics. Each sub-system or
component is then treated as a system and
decomposed further. This process keeps
on running until the lowest level of
system in the top-down hierarchy is
achieved.
Top-down design starts with a
generalized model of system and keeps
on defining the more specific part of it.
When all components are composed the
whole system comes into existence.
Top-down design is more suitable when
the software solution needs to be
designed from scratch and specific details
are unknown.
Advantages:
- Advantageous if major flaws occur toward the top of the program.
- Once the I/O functions are added, representation of test cases is easier.
- Early skeletal Program allows demonstrations and boosts morale.
Disadvantages:
- Stub modules must be produced
- Stub Modules are often more complicated than they first appear to be.
- Before the I/O functions are added, representation of test cases in stubs can be difficult.
- Test conditions may be impossible, or very difficult to create.
- Observation of test output is more difficult.
- Allows one to think that design and testing can be overlapped.
- Induces one to defer completion of the testing of certain modules.

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.

You might also like