Software Engineering Midsem
Software Engineering Midsem
Software Engineering Midsem
The early programmers used an exploratory (also called build and fix) style. In
this style, normally a `dirty' program is quickly developed. The different
imperfections that are subsequently noticed are fixed.
Drawback: Can successfully be used for very small programs only.
Besides the exponential growth of effort, cost, and time with problem size:
a) It results in unmaintainable code.
b) It becomes very difficult to use it in a team development environment.
Item:
An item is any set of related information. Each item normally occupies one place in
memory. When you are able to relate several different items together (chunking):
The information that should normally occupy several places can be stored using only
one place in the memory. e.g.,
110010101001 = octal form of 6251 ((110)(010)(101)(001))
You have managed to create chunks of three items each.
Software products:
– Fail to meet user requirements.
– Frequently crash.
– Expensive.
– Difficult to alter, debug, and enhance.
– Often delivered late.
– Use resources non-optimally.
The person who undertakes requirements analysis and specification: Systems analyst
– Collects data pertaining to the product
– Analyses collected data to understand what exactly needs to be done.
– Writes the Software Requirements Specification (SRS) document.
Inconsistent Requirement: Some part of the requirement contradicts with some other
part.
● Example in Chemistry Lab: One customer says turn off heater and open water shower
when temperature > 100 C
Another customer says turn off heater and turn ON cooler when temperature > 100 C
SRS: Advantages:
– Statement of user needs
– Contract document
– Reference document
– Definition for implementation
Properties:
● It should be concise and at the same time should not be ambiguous(should not have
multiple meanings)
● It should specify what the system must do and not say how to do it.
● Easy to change i.e. it should be well-structured.
● consistent
● complete
● It should be traceable (which part of the specification corresponds to which part
of the design, code, etc and vice versa.)
● It should be verifiable
● Coding + ● Testing : implementation phase (aka coding and unit testing phase)
translates software design into
source code.
● Maintenance: – requires much more effort than the effort to develop the product
itself.
– development effort to maintenance effort is typically 40:60.
● Corrective maintenance: Correct errors which were not discovered during the
product development phases.
● Perfective maintenance: Improve implementation of the system ; enhance
functionalities of the system.
● Adaptive maintenance: Port software to a new environment, e.g. to a new computer
or to a new operating system.
Prototyping Model:
● Before starting actual development, a working prototype of the system should
first be built.
● A prototype is a toy implementation of a system:
– limited functional capabilities,
– low reliability,
– inefficient performance.
Evolutionary Model: aka successive versions model; The system is broken down into
several modules which can be incrementally implemented and delivered.
Advantages:
● Users get a chance to experiment with a partially developed system:
● Helps finding exact user requirements
● Core modules get tested thoroughly
Disadvantages:
● Often, difficult to subdivide problems into functional units which can be
incrementally implemented
and delivered.
Spiral Model:
● Each loop of the spiral represents a phase of the software process:
– the innermost loop might be concerned with system feasibility,
– the next loop with system requirements definition,
– the next one with system design, and so on.
● There are no fixed phases in this model, the phases shown in the figure are just
examples.
● Each loop in the spiral is split into four sectors (quadrants) - Determine
Objectives, Resolve Risks, Develop Next Level of Product, Customer Evaluation of
Prototype
Decision trees:
– Edges of a decision tree represent conditions
– Leaf nodes represent actions to be performed.
- A decision tree gives a graphic view of: Logic involved in decision making ;
Corresponding actions taken.
Decision Table:
● A decision table shows Processing logic and corresponding actions in a tabular
form
● Upper rows of the table specify: The variables or conditions to be evaluated
● Lower rows specify: The actions to be taken when the corresponding conditions are
satisfied.
Coincidental Cohesion:
● The module performs a set of tasks Which relate to each other very loosely, if at
all.
● The module contains a random collection of functions.
● Functions have been put in the module out of pure coincidence without any thought
or design.
Logical Cohesion:
● All elements of the module perform similar operations: e.g. error handling, data
input, data output, etc.
● An example: A set of print functions to generate an output report arranged into a
single module.
Temporal Cohesion:
● The module contains tasks that are related by the fact that All the tasks must be
executed in the same time span.
● Example: The set of functions responsible for initialization; start-up, shut-down
of some process, etc.
Procedural Cohesion:
● The set of functions of the module:
– All part of a procedure (algorithm)
– Certain sequence of steps have to be carried out in a certain order for achieving
an objective,
● e.g. the algorithm for decoding a message.
Communicational Cohesion:
● All functions of the module: Reference or update the same data structure,
● Example: The set of functions defined on an array or a stack.
Sequential Cohesion:
● Elements of a module form different parts of a sequence,
– Output from one element of the sequence is input to the next.
– Example: sort -> search -> display
Functional Cohesion:
● Different elements of a module cooperate:
– To achieve a single function,
– e.g. managing an employee's pay-roll.
● When a module displays functional cohesion, We can describe the function using a
single sentence.
Data coupling:
● Two modules are data coupled,
– If they communicate via a parameter: an elementary data item; e.g an integer, a
float, a character, etc.
– The data item should be problem related and Not used for control purpose.
Stamp Coupling:
● Two modules are stamp coupled – If they communicate via a composite data item
such as a record in PASCAL or a structure in C.
Control Coupling:
● Data from one module is used to direct the Order of instruction execution in
another.
● Example: A flag set in one module and tested in another module.
Common Coupling:
● Two modules are common coupled, If they share some global data.
Content Coupling:
● Content coupling exists between two modules: If they share code- e.g, branching
from one module into another module.
● The degree of coupling increases from data coupling to content coupling.
Data Definition:
● +: denotes composition of data items, e.g – a+b represents data a and b.
● [,,,]: represents selection,– i.e. any one of the data items listed inside the
square bracket can occur.For example, [a,b] represents either a occurs or b
occurs.
● ( ): contents inside the bracket represent optional data which may or may not
appear. a+(b) represents either a or a+b occurs.
● {}: represents iterative data definition, e.g. {name}5 represents five name data.
● {name}* represents – zero or more instances of name data.
● = represents equivalence, e.g. a=b+c means that a represents b and c.
● * *: Anything appearing within * * is considered as comment.