Advanced Software Engineering Course Outline
Advanced Software Engineering Course Outline
OBJECTIVES:
To understand Software Engineering Lifecycle Models
To do project management and cost estimation
To gain knowledge of the System Analysis and Design concepts.
To understand software testing approaches
To be familiar with DevOps practices
UNIT I INTRODUCTION 9
Software engineering concepts – Development activities – Software lifecycle models -
Classical waterfall - Iterative waterfall – Prototyping – Evolutionary - Spiral – Software
project management – Project planning – Estimation – Scheduling – Risk management –
Software configuration management.
UNIT II SOFTWARE REQUIREMENT SPECIFICATION 9
Requirement analysis and specification – Requirements gathering and analysis – Software
Requirement Specification – Formal system specification – Finite State Machines – Petrinets
– Object modelling using UML – Use case Model – Class diagrams – Interaction diagrams –
Activity diagrams – State chart diagrams – Functional modelling – Data Flow Diagram.
UNIT III ARCHITECTURE AND DESIGN 9
Software design – Design process – Design concepts – Coupling – Cohesion – Functional
independence – Design patterns – Model-view-controller – Publish-subscribe – Adapter –
Command – Strategy – Observer – Proxy – Facade – Architectural styles – Layered - Client-
server - Tiered - Pipe and filter.- User interface design
UNIT IV TESTING 9
Testing – Unit testing – Black box testing– White box testing – Integration and System
testing– Regression testing – Debugging - Program analysis – Symbolic execution – Model
Checking
UNIT V DEVOPS 9
DevOps:Motivation-Cloud as a platform-Operations- Deployment Pipeline:Overall
Architecture-Building and Testing-Deployment- Case study: Migrating to Microservices.
TOTAL: 45 PERIODS
OUTCOMES:
At the end of this course, the students will be able to:
Understand the advantages of various Software Development Lifecycle Models
Gain knowledge on project management approaches as well as cost and schedule
estimation strategies
Perform formal analysis on specifications
Use UML diagrams for analysis and design
Architect and design using architectural styles and design patterns
Understand software testing approaches
Understand the advantages of DevOps practices
REFERENCES:
1. Bernd Bruegge, Alan H Dutoit, Object-Oriented Software Engineering, 2nd edition, Pearso
Education, 2004.
2. Carlo Ghezzi, Mehdi Jazayeri, Dino Mandrioli, Fundamentals of Software Engineering,
2nd edition, PHI Learning Pvt. Ltd., 2010.
3. Craig Larman, Applying UML and Patterns, 3rd ed, Pearson Education, 2005.
4. Len Bass, Ingo Weber and Liming Zhu, ―DevOps: A Software Architect‘s Perspectiveǁ,
Pearson Education, 2016
5. Rajib Mall, Fundamentals of Software Engineering, 3rd edition, PHI Learning Pvt. Ltd.,
2009.
6. Stephen Schach, Software Engineering 7th ed, McGraw-Hill, 2007.
CP5154 ADVANCED SOFTWARE ENGINEERING LESSON PLAN
NAME : DHARANI.B
DESIGNATION : ASSISTANT PROFESSOR
DEPARTMENT : COMPUTER SCIENCE AND ENGINEERING
SUBJECT CODE & TITLE : CP5154 ADVANCED SOFTWARE ENGINEERING
CLASS : I ME CSE
SEMESTER : 01
R1. Bernd Bruegge, Alan H Dutoit, Object-Oriented Software Engineering, 2nd edition, Pearson
Education, 2004.
R2. Carlo Ghezzi, Mehdi Jazayeri, Dino Mandrioli, Fundamentals of Software Engineering, 2nd
edition, PHI Learning Pvt. Ltd., 2010.
R3. Craig Larman, Applying UML and Patterns, 3rd ed, Pearson Education, 2005.
R4. Len Bass, Ingo Weber and Liming Zhu, ―DevOps: A Software Architect‘s Perspectiveǁ,
Pearson Education, 2016.
R5. Rajib Mall, Fundamentals of Software Engineering, 3rd edition, PHI Learning Pvt. Ltd., 2009.
R6. Stephen Schach, Software Engineering 7th ed, McGraw-Hill, 2007.
Reference
S.
No Topic Name / Text Page No.
book
UNIT I INTRODUCTION
1 Software engineering concepts R1 10-16
2 Development activities R1 16-20
3 Software lifecycle models - Classical waterfall 38-46
4 Iterative waterfall 46-50
5 Prototyping 52-55
6 Evolutionary 57-59
7 Spiral 69-73
R5
8 Software project management 86-88
9 Project planning 89-91
10 Estimation 92-109
11 Scheduling 119-128
12 Risk management 136-139
13 Software configuration management 140-143
UNIT II SOFTWARE REQUIREMENT SPECIFICATION
14 Requirement analysis and specification R5 154-155
15 Requirements gathering and analysis 155-160
UNIT I
• Systems Engineering
– Software as part of larger system, determine requirem ents for all system
elements, allocate requirements to software.
• Software Requirements Analysis
– Develop understanding of problem domain, user needs, function, performance,
interfaces, ...
– Software Design
– Multi-step process to determine architecture, interfaces, data structures,
functional detail. Produces (high-level) form that can be checked for quality,
conformance before coding.
• Coding
– Produce machine readable and executable form, match HW, OS and design needs.
• Testing
Software Engineering
• Protot ype thrown away and software developed using formal process{ it is used to define
the requirement} Prototyping
Strengths:
• Requirements can be set earlier and more reliably
• Customer sees results very quickly.
• Customer is educated in what is possible helping to refine requirements.
• Requirements can be communicated more clearly and completely
• Between developers and clients Requirements and design options can be
investigated quickly and Cheaply
Weaknesses:
– Requires a rapid prototyping tool and expertise in using it–a cost for the
development organisation
– Smoke and mirrors - looks like a working version, but it is not.
The RAD Model:
• Rapid Application Development is a linear sequential software development process
model that emphasizes an extremely short development cycle
• Rapid application achieved by using a component based construction approach
• If requirements are well understood and project scope is constrained the RAD process
enables a development team to create a ―fully functional systemǁ
Team # n
M o d e lin g
busin es s m
o d e lin g d a t a m
ode ling
proc es s m o d eli ng
C o n s t ru c t io n
Team # 2 c om ponent r eus
Co m m unicat ion e a u t o m a t ic
od e
c
gener a t io n
M o d el i n g t e s t in g
b u si n e ss m o d e li n
g d a t a m o d eli n g
p ro ce ss m o d e li n g
Plan n ing
C o ns t r uc t i o n De p lo ym e nt
Team # 1 co m p o n e n t re u
int egrat ion
se a u t o m a t i c co d
e de liv ery
Mo de ling g e n e ra t i o f ee d b ack
n t e st i n g
b u si ne ss mo d e lin g
d at a mo d elin g
p ro ce ss mo d e l i ng
Co n st r uct io n
co mp o n e n t
reu se aut omat ic
co d e
g e n e r at i o n
t e st ing
6 0 - 9 0 d ays
RAD phases :
• Business modeling
• Data modeling
• Process modeling
Software Engineering
• Application generation
• Testing and turnover
Business modeling:
• What information drives the business process?
• What information is generated?
• Who generates it?
Data Modeling:
• The information flow defined as part of the business modeling phase is refined into a set
of data objects that are needed to support the business.
• The characteristics ( called attributes) of each object are ident ified and the relationships
between these objects are defined
Process modeling:
• The data modeling phase are transformed to achieve the inf ormation flow necessary to
implement a business function.
• Processing descriptions are created for adding , modifying, deleting, or retrieving a data
object
Application generation:
• RAD assumes the use of 4 generation techniques.
• Rather than creating software using conventional 3 generation programming languages,
the RAD process works to reuse existing program components (when possible) or created
reusable components (when necessary)
Testing and Turnover:
• Since the RAD process emphasizes reuse, many of the program components have already
been testing.
• This reduces over all testing time.
• However, new components must be tested and all interfaces must be fully exercised
Advantages &Disadvantages of RAD:
Advantages
• Extremely short development time.
• Uses component-based construction and emphasises reuse and code generation
Disadvantages
• Large hum an resource requirem ents (to create all of the team s).
• Requires strong commitment between developers and customers for “rapid-fire”
activities.
• High perform ance requirem ents m aybe can’t be m et (requires tuning the com ponents).
The Incremental Model
i nc r em ent # n
C o m m u n i c a t i o n
P l a n n i n g
M o d e l i n g
a n a l y s i s
C o n s t r u c t
i o n
d e s i g n
D e p l o y m e n t
c o d e
d e l i v e r y
t e s t
f e e d b a c k
d e li ve r y of
n t h i n c rem e nt
incr em ent # 2
C o m m u n i c a t i o n
P l a n n i n g
M o d e l i n g
a n a l ys is
C o n s t r u c t i o n
d es i g n
c o d e
D e p l o y m e n t
d e li ve r y of
t e s t
d e l i v e r y
f e e d b a c k
C o m m u n i c a t i o n
P l a n n
i n g
M o d e l i n g
a n a l y s i s C o n s t r u c t i o n
d e li ve r y of
d es i g n
c o d e D e p l o y m e n t
t e s t d e l i v e r y
f e e d b a c k
1 st i ncre me nt
System Engineering
• Software engineering occurs as a consequence of a process called system engineering.
• Instead of concentrating so lely on software, s ystem engineering focuses on a variety of
elements, analyzing, designing, and organizing those elements into a s ystem that can be a
product, a service, or a technology for the transformation of information or control.
Software Engineering
• The system engineering process usually begins with a ―world view.ǁ That is, the ent ire
business or product domain is examined to ensure that the proper business or technolog y
context can be established.
• The world view is refined to focus more fully on specific domain of interest. Within a
specific domain, the need for targeted s ystem elements (e.g., data, software, hardware,
people) is analyzed. Finally, the analysis, design, and construction of a targeted system
element is initiated.
• At the top of the hierarchy, a very broad context is established and, at the bottom, detailed
technical activities, performed by the relevant engineering discipline (e.g., hardware or
software engineering), are conducted.
• Stated in a slight ly more formal manner, the world view (WV) is co mposed of a set of
domains (Di), which can each be a system or system of systems in its own right.
WV = {D1, D2, D3, . . . , Dn}
• Each domain is co mposed of specific elements (Ej) each of which serves some role in
accomplishing the objective and goals of the domain or component:
Di = {E1, E2, E3, . . . , Em}
• Finally, each element is implemented by specifying the technical components (Ck) that
achieve the necessary function for an element:
Ej = {C1, C2, C3, . . . , Ck}
• The final BPE step—construction and integrati on focuses on implementation detail. The
architecture and infrastructure are implemented by constructing an appropriate database and
internal data structures, by building applications using software components, and by selecting
appropriate elements of a technology infrastructure to support the design created during
BSD. Each of these system co mponents must then be integrated to form a complete
information system or application.
• The integration activity also places the new information system into the business area
context, performing all user training and logistics support to achieve a smooth transition.
• S ystem component engineering is actually a set of concurrent activit ies that address each of
the system components separately: software engineering, hardware engineering, human
engineering, and database engineering.
• Each of these engineering disciplines takes a do main-specific view, but it is important to note
that the engineering disciplines must establish and maintain active co mmunication with one
another. Part of the ro le of requirements engineering is to establish the interfacing
mechanisms that will enable this to happen.
• The element view for product engineering is the engineering discipline itself applied to the
allocated component. For software engineering, this means analysis and design modeling
activities (covered in detail in later chapters) and construction and integration act ivit ies that
encompass code generation, testing, and support steps.
• The analysis step models allocated requirements into representations of data, function, and
behavior. Design maps the analysis model into data, architectural, interface, and soft ware
component-level designs.
Software Engineering
UNIT II SOFTWARE
REQUIREMENTS
• The process of establishing the services that the customer requires from a s ystem and the
constraints under which it operates and is developed
• Requirements may be functional or non-functional
• Functional requirements describe system services or functions
• Non-functional requirements is a constraint on the s ystem or on the development
process
Types of requirements
• User requirements
• Statements in natural language (NL) plus diagrams of the services the system
provides and its operational constraints. Written for customers
• System requirements
• A structured document setting out detailed descriptions of the system services.
Written as a contract between client and contractor
• Software specification
• A detailed software description which can serve as a basis for a design or
implementation. Written for developers
Functional requirements
• Functionality or services that the system is expected to provide.
• Functional requirements may also explicitly state what the system shouldn‘t do.
• Functional requirements specification should be:
• Complete: All services required by the user should be defined
• Consistent: should not have contradictory definition (also avo id ambiguity
don‘t leave room for different interpretations)
Non-Functional requirements
Software Engineering
• Requirements that are not direct ly concerned with the specific functions delivered by the
system
• Typically relate to the system as a whole rather than the individual system features
• Often could be deciding factor on the survival of the system (e.g. reliability, cost, response
time)
Non-functional
requir ements
Domain requirements
• Domain requirements are derived from the application domain of the system rather than fro m
the specific needs of the system users.
• May be new functional requirements, constrain exist ing requirements or set out how
particular computation must take place.
• Example: tolerance level of landing gear on an aircraft (different on dirt, asphalt, water), or
what happens to fiber optics line in case of sever weather during winter Olympics (Onl y
domain-area experts know)
Product requirements
• Specify the desired characteristics that a system or subsystem must possess.
• Most NFRs are concerned with specifying constraints on the behaviour of the execut ing
system.
Specifying product requirements
• Some product requirements can be formulated precisely, and thus easily quantified
• Performance
• Capacity
Software Engineering
• Others are more difficult to quantify and, consequently, are often stated informally
• Usability
Process requirements
• Process requirements are constraints placed upon the development process of the system
• Process requirements include:
• Requirements on development standards and methods which must be followed
• CASE tools which should be used
• The management reports which must be provided
External requirements
• May be placed on both the product and the process
• Derived from the environment in which the system is developed
• External requirements are based on:
• application domain information
• organisational considerations
• the need for the system to work with other systems
• health and safety or data protection regulations
• or even basic natural laws such as the laws of physics
Software Document
• Should provide for communication among team members
Software Engineering
Us e t he req ui rement s
Manag ers d ocumen t to pl an a bi d for t
he s ys tem an d to pl an th e
sy st em dev elo pmen t p roces s
Us e t he req ui rement s to
Sy st em eng in eers un ders tan d wh at s ys tem i s to
b e dev elo ped
Process Documentation
• Used to record and track the development process
• Planning documentation
• Cost, Schedule, Funding tracking
• Schedules
• Standards
Software Engineering
Product Documentation
• System Documentation
• Describes how the system works, but not how to operate it
• Examples:
• Requirements Spec
• Architectural Design
• Detailed Design
• Commented Source Code
Including output such as JavaDoc
• Test Plans
Including test cases
• V&V plan and results
• List of Known Bugs
• User Documentation has two main types
• End User
• System Administrator
In some cases these are the same people
• The target audience must be well understood!
• There are five important areas that should be documented for a formal release of a software
application
• These do not necessarily each have to have their own document, but the topics should
be covered thoroughly
• Functional Description of the Software
• Installation Instructions
• Introductory Manual
• Reference Manual
• System Administrator‘s Guide
Document Quality
• Providing thorough and pro fessional documentation is important for any size product
development team
Software Engineering
• The problem is that many software professionals lack the writ ing skills to create
professional level documents
Document Structure
• All documents for a given product should have a similar structure
• A good reason for product standards
• The IEEE Standard for User Documentation lists such a structure
• It is a superset of what most documents need
• The authors ―best practicesǁ are:
• Put a cover page on all documents
• Divide documents into chapters with sections and subsections
• Add an index if there is lots of reference information
• Add a glossary to define ambiguous terms
Standards
• Standards play an important role in the development, maintenance and usefulness of
documentation
• Standards can act as a basis for quality documentation
• But are not good enough on their own
Usually define high level content and organization
• There are three types of documentation standards
[Link] Standards
• Define the approach that is to be used when creating the documentation
• Don‘t actually define any of the content of the documents
2. Product Standards
• Goal is to have all documents created for a specific product attain a consistent structure and
appearance
• Can be based on organizational or contractually required standards
• Four main types:
• Documentation Identification Standards
• Document Structure Standards
• Document Presentation Standards
• Document Update Standards
• One caveat:
• Documentation that will be viewed by end users should be created in a way that is
best consumed and is most attractive to them
• Internal development documentation generally does not meet this need
3. Interchange Standards
• Deals with the creation of documents in a format that allows others to effectively use
• PDF may be good for end users who don‘t need to edit
• Word may be good for text editing
Software Engineering
Other Standards
• IEEE
• Has a published standard for user documentation
• Provides a structure and superset of content areas
• Many organizations probably won‘t create documents that completely match the
standard
• Writing Style
• Ten ―best practicesǁ when writing are provided
• Author proposes that group edits of important documents should occur in a similar
fashion to software walkthroughs
Requ irement s
d ocumen t
Feasibility Studies
• A feasibility study decides whether or not the proposed system is worthwhile
• A short focused study that checks
• If the system contributes to organisational objectives
• If the system can be engineered using current technology and within budget
• If the system can be integrated with other systems that are used
• Based on information assessment (what is required), information collection and report
writing
• Questions for people in the organisation
• What if the system wasn‘t implemented?
• What are current process problems?
• How will the proposed system help?
Software Engineering
System models
• Different models may be produced during the requirements analysis activity
• Requirements analysis may involve three structuring activit ies which result in these different
models
• Partitioning – Identifies the structural (part-of) relationships between entities
• Abstraction – Identifies generalities among entities
• Projection – Identifies different ways of looking at a problem
• System models will be covered on January 30
Scenarios
• Scenarios are descriptions of how a system is used in practice
• They are helpful in requirements elicitation as people can relate to these more readily than
abstract statement of what they require from a system
• Scenarios are particularly useful for adding detail to an outline requirements description
Ethnography
• A social scient ists spends a considerable t ime observing and analysing how people actuall y
work
• People do not have to explain or articulate their work
• Social and organisational factors of importance may be observed
• Ethnographic studies have shown that work is usually richer and more complex than
suggested by simple system models
Software Engineering
Requirements validation
• Concerned with demonstrating that the requirements define the system that the customer
really wants
• Requirements error costs are high so validation is very important
• Fixing a requirements error after delivery may cost up to 100 times the cost of fix ing
an implementation error
• Requirements checking
• Validity
• Consistency
• Completeness
• Realism
• Verifiability
Requirements management
• Requirements management is the process of managing changing requirements during the
requirements engineering process and system development
• Requirements are inevitably incomplete and inconsistent
• New requirements emerge during the process as business needs change and a better
understanding of the system is developed
• Different viewpoints have different requirements and these are often contradictory
Software prototyping
Incomplete versions of the software program being developed. Protot yping can also be
used by end users to describe and prove requirements that developers have not considered
Benefits:
The software designer and implementer can obtain feedback from the users early in the
project. The client and the contractor can compare if the software made matches the software
specification, according to which the software program is built.
It also allows the software engineer some insight into the accuracy of initial pro ject
estimates and whether the deadlines and milestones proposed can be successfully met.
Process of prototyping
1. Identify basic requirements
Determine basic requirements including the input and output information desired. Details,
such as security, can typically be ignored.
Software Engineering
Dimensions of prototypes
1. Horizontal Prototype
It provides a broad view of an ent ire s ystem or subsystem, focusing on user interaction more
than low-level system functionalit y, such as database access. Horizontal protot ypes are usefu l
for:
• Confirmation of user interface requirements and system scope
• Develop preliminary estimates of development time, cost and effort.
2 Vertical Prototypes
A vertical prototype is a more complete elaboration of a single subsystem or function. It is
useful for obtaining detailed requirements for a given function, with the following benefits:
• Refinement database design
• Obtain information on data volumes and system interface needs, for network sizing and
performance engineering
Types of prototyping
Software protot yping has many variants. However, all the methods are in so me wa y
based on two major types of prototyping: Throwaway Prototyping and Evolutionary Prototyping.
1. Throwaway prototyping
Also called close ended protot yping. Throwaway refers to the creation of a model that
will eventually be discarded rather than becoming part of the final delivered software. After
preliminary requirements gathering is accomplished, a simple working model of the s ystem is
constructed to visually show the users what their requirements may look like when they are
implemented into a finished system.
The most obvious reason for using Throwaway Protot yping is that it can be done quickly.
If the users can get quick feedback on their requirements, they may be able to refine them early
in the development of the software. Making changes early in the development lifecycle is
extremely cost effect ive since there is nothing at that point to redo. If a project is changed after a
considerable work has been done then small changes could require large efforts to implement
since software systems have many dependencies. Speed is crucial in implement ing a throwaway
protot ype, since with a limited budget of time and money litt le can be expended on a protot ype
that will be discarded.
Strength of Throwaway Protot yping is its ability to construct interfaces that the users can
test. The user interface is what the user sees as the syst em, and by seeing it in front of them, it is
much easier to grasp how the system will work.
Software Engineering
2. Evolutionary prototyping
Evolutionary Prototyping (also known as breadboard prototyping) is quite different from
Throwaway Prototyping. The main goal when using Evo lutionary Prototyping is to build a ver y
robust protot ype in a structured manner and constant ly refine it. "The reason for this is that the
Evolut ionary protot ype, when built, forms the heart of the new s ystem, and the improvements
and further requirements will be built.
Evolutionary Protot ypes have an advantage over Throwaway Protot ypes in that they are
functional systems. Although they may not have all t he features the users have planned, the y
may be used on a temporary basis until the final system is delivered.
In Evolutionary Prototyping, developers can focus themselves to develop parts of the
system that they understand instead of working on developing a who le s yst em. To minimize risk,
the developer does not implement poorly understood features. The partial s ystem is sent to
customer sites. As users work with the system, they detect opportunities for new features and
give requests for these features to developers. Developers then take these enhancement requests
along wit h their own and use sound configuration-management practices to change the software-
requirements specification, update the design, recode and retest.
3. Incremental prototyping
The final product is built as separate protot ypes. At the end the separate protot ypes are
merged in an overall design.
4. Extreme prototyping
Extreme Prototyping as a development process is used especially for developing web
applications. Basically, it breaks down web development into three phases, each one based on
the preceding one. The first phase is a static protot ype that consists mainly of HTML pages. In
the second phase, the screens are programmed and fully functional using a simulated services
layer. In the third phase the services are implemented. The process is called Extreme Prototyping
to draw attention to the second phase of the pro cess, where a fully-functional UI is developed
with very little regard to the services other than their contract.
Advantages of prototyping
1. Reduced time and costs: Prototyping can improve the quality of requirements and
specifications provided to developers. Because changes cost exponentially more to implement as
they are detected later in development, the early determination of what the user really wants can
result in faster and less expensive software.
2. Improved and increased user involvement: Prototyping requires user involvement and
allows them to see and interact with a prototype allowing them to provide better and more
complete feedback and specifications. The presence of the protot ype being examined by the user
prevents many misunderstandings and misco mmunications that occur when each side believe the
other understands what they said. Since users know the problem domain better than anyo ne on
the development team does, increased interaction can result in final product that has greater
tangible and intangible qualit y. The final product is more likely to satisfy the users‘ desire for
look, feel and performance.
Software Engineering
Disadvantages of prototyping
1. Insufficient analysis: The focus on a limited protot ype can distract developers from properl y
analyzing the complete project. This can lead to overlooking better solutions, preparation o f
incomplete specifications or the conversion of limited protot ypes into poorly engineered final
projects that are hard to maintain. Further, since a protot ype is limited in functionality it may not
scale well if the protot ype is used as the basis of a final deliverable, which may not be noticed if
developers are too focused on building a prototype as a model.
2. User confusion of p rototype and finished system: Users can begin to think that a protot ype,
intended to be thrown away, is actually a final system that merely needs to be finished or
polished. (They are, for example, often unaware of the effort needed to add error -checking and
securit y features which a protot ype may not have.) This can lead them to expect the protot ype to
accurately model the performance of the final system when this is not the intent of the
developers. Users can also beco me attached to features that were included in a protot ype for
consideration and then removed from the specification for a final s ystem. If users are able to
require all proposed features be included in the final system this can lead to conflict.
3. Developer misunderstanding of user objectives: Developers may assume that users share
their objectives (e.g. to deliver core functionality on t ime and within budget), without
understanding wider commercial issues. For example, user representatives attending Enterprise
software (e.g. PeopleSoft) events may have seen demonstrations of "transaction audit ing" (where
changes are logged and displayed in a difference grid view) without being told that this feature
demands additio nal coding and often requires more hardware to handle extra database accesses.
Users might believe they can demand audit ing on every field, whereas developers might think
this is feature creep because they have made assu mptions about the extent of user requirements.
If the developer has co mmitted delivery before the user requirements were reviewed, developers
are between a rock and a hard place, part icularly if user management derives so me advantage
from their failure to implement requirements.
4. Developer attachment to prototype: Developers can also become attached to protot ypes the y
have spent a great deal of effort producing; this can lead to problems like attempting to convert a
limited protot ype into a final system when it does not have an appropriate underlying
architecture. (This may suggest that throwaway protot yping, rather th an evolutionary
prototyping, should be used.)
5. Excessive develop ment time of the prototype: A key propert y to prototyping is the fact that
it is supposed to be done quickly. If the developers lose sight of this fact, they very well may try
to develop a prototype that is too complex. When the protot ype is thrown away the precisel y
developed requirements that it provides may not yield a sufficient increase in productivity to
make up for the time spent developing the prototype. Users can become stuck in debates over
details of the prototype, holding up the development team and delaying the final product.
6. Expense of implementing prototyping: the start up costs for building a development team
focused on prototyping may be high. Many companies have development methodologies in
place, and changing them can mean retraining, retooling, or both. Many companies tend to just
jump into the prototyping without bothering to retrain their workers as much as they should.
A common problem with adopting prototyping technology is high expectations for productivit y
with insufficient effort behind the learning curve. In addition to training for the use of a
protot yping technique, there is an often overlooked need for developing corporate and project
Software Engineering
specific underlying structure to support the technology. When this underlying structure is
omitted, lower productivity can often result.
Methods
There are few formal prototyping methodologies even though most Agile Methods rel y
heavily upon prototyping techniques.
1. Dynamic systems development method
Dynamic S ystems Development Method (DSDM) is a framework for delivering business
solutions that relies heavily upon prototyping as a core technique, and is itself ISO 9001
approved. It expands upon most understood definitions of a protot ype. According to DSDM the
protot ype ma y be a diagram, a business process, or even a system placed into production. DSDM
protot ypes are intended to be incremental, evolving from simple forms into more comprehensive
ones.
DSDM protot ypes may be throwaway or evolutionar y. Evolutionary protot ypes may be evo lved
horizontally (breadth then depth) or vertically (each section is built in detail with additional
iterations detailing subsequent sections). Evolutionary protot ypes can eventually evolve into
final systems.
2. Operational prototyping
Operational Prototyping was proposed by Alan Davis as a way to integrate throwaway and
evolutionary protot yping with conventional s ystem development. "[It] offers the best of both the
quick-and-dirty and conventional-development worlds in a sensible manner. Designers develop
only well-understood features in building the evo lutionary baseline, while using throwawa y
prototyping to experiment with the poorly understood features."
Davis' belief is that to try to "retrofit quality onto a rapid protot ype" is not the correct approach
when trying to combine the two approaches. His idea is to engage in an evolutionar y prototyping
methodology and rapidly prototype the features of the system after each evolution.
The specific methodology follows these steps:
• An evolutionary protot ype is constructed and made into a baseline using conventional
development strategies, specifying and implementing only the requirements that are well
understood.
• Copies of the baseline are sent to multiple customer sites along with a trained prototyper.
• At each site, the prototyper watches the user at the system.
• Whenever the user encounters a problem or thinks of a new feature or requirement, the
prototyper logs it. This frees the user from having to record the problem, and allows them
to continue working.
• After the user session is over, the protot yper constructs a throwaway prototype on top of
the baseline system.
• The user now uses the new s ystem and evaluates. If the new changes aren't effective, the
prototyper removes them.
• If the user likes the changes, the protot yper writes feature-enhancement requests and
forwards them to the development team.
• The development team, with the change requests in hand from all the sites, then produce
a new evolutionary prototype using conventional methods.
Obviously, a key to this method is to have well trained protot ypers available to go to the user
sites. The Operational Prototyping methodology has many benefits in systems that are complex
and have few known requirements in advance.
Evolut ionary Rapid Development (ERD) was developed by the Software Productivit y
Consortium, a technology development and integration agent for the Information Technolog y
Office of the Defense Advanced Research Projects Agency (DARPA).
Fundamental to ERD is the concept of co mposing software systems based on the reuse o f
components, the use of software templates and on an architectural template. Continuous
evolution of system capabilities in rapid response to changing user needs and technology is
highlighted by the evolvable architecture, represent ing a class of so lutions. The process focuses
on the use o f small artisan-based teams integrating software and s ystems engineering disciplines
working multiple, often parallel short-duration timeboxes with frequent customer interaction.
Key to the success of the ERD-based projects is parallel exploratory analysis and development of
features, infrastructures, and components with and adoption of leading edge technologies
enabling the quick reaction to changes in technologies, the marketplace, or customer
requirements.
To elicit customer/user input, frequent scheduled and ad hoc/impromptu meetings with the
stakeholders are held. Demonstrations of system capabilit ies are held to solicit feedback before
design/implementation decisions are solidified. Frequent releases (e.g., betas) are made availa ble
for use to provide insight into how the system could better support user and customer needs. This
assures that the system evolves to satisfy existing user needs.
The design framework for the s ystem is based on using exist ing published or de facto
standards. The s ystem is organized to allow for evo lving a set of capabilities that includes
considerations for performance, capacities, and functionalit y. The architecture is defined in terms
of abstract interfaces that encapsulate the services and their implementation (e.g., COTS
applications). The architecture serves as a template to be used for guiding development of more
than a single instance of the system. It allows for multiple application components to be used to
implement the services. A core set of fu nctionality not likely to change is also identified and
established.
The ERD process is structured to use demonstrated functionality rather than paper
products as a way for stakeholders to communicate their needs and expectations. Central to this
goal of rapid delivery is the use of the "time box" method. Timeboxes are fixed periods of time
in which specific tasks (e.g., developing a set of functionalit y) must be performed. Rather than
allowing t ime to expand to satisfy so me vague set of goals, the time is fixed (both in terms o f
calendar weeks and person-hours) and a set of goals is defined that realistically can be achieved
within these constraints. To keep development from degenerating into a "random walk," long-
range plans are defined to guide the iterations. These plans provide a vision for the overall
system and set boundaries (e.g., constraints) for the project. Each iteration within the process is
conducted in the context of these long-range plans.
Once architecture is established, software is integrated and tested on a daily basis. This
allows the team to assess progress objectively and identify potential problems quickly. Since
small amounts of the s ystem are integrated at one time, diagnosing and removing the defect is
rapid. User demonstrations can be held at short notice since the s ystem is generally ready to
exercise at all times.
5. Scrum
Scrum is an agile method for project management. The approach was first described b y
Takeuchi and Nonaka in "The New New Product Development Game" (Harvard Bus iness
Review, Jan-Feb 1986).
Software Engineering
Tools
Efficient ly using prototyping requires that an organization have proper tools and a staff
trained to use those tools. Tools used in prototyping can vary from individual tools like 4th
generation programming languages used for rapid prototyping to complex integrated CASE
tools. 4th generation programming languages like Visual Basic and ColdFusion are frequently
used since they are cheap, well known and relat ively easy and fast to use. CASE tools are often
developed or selected by the military or large organizations. Users may protot ype elements of an
application themselves in a spreadsheet.
3. Sketchflow
Sketch Flow, a feature of Microsoft Expression Studio Ult imate, gives the ability to quickl y
and effectively map out and iterate the flow of an application UI, the layout of individual screens
and transition from one application state to another.
• Interactive Visual Tool
• Easy to learn
• Dynamic
• Provides enviroment to collect feedback
4. Visual Basic
One of the most popular tools for Rapid Prototyping is Visual Basic (VB). Microsoft Access,
which includes a Visual Basic extensibility module, is also a widely accepted prototyping tool
that is used by many non-technical business analysts. Although VB is a programming language it
has many features that facilitate using it to create prototypes, including:
• An interactive/visual user interface design tool.
• Easy connection of user interface components to underlying functional behavior.
• Modifications to the resulting software are easy to perform.
Software Engineering
6. LYMB
LYMB is an object-oriented development environment aimed at developing applications
that require combining graphics-based user interfaces, visualization, and rapid prototyping.
7. Non-relational environments
Non-relational definition of data (e.g. using Cache or associat ive models can help make
end-user protot yping more productive by dela ying or avoiding the need to normalize data at
every iteration of a simulation. This may yield earlier/greater clarity of business requirements,
though it does not specifically confirm that requirements are technically and econo mically
feasible in the target production system.
8. PSDL
PSDL is a prototype description language to describe real-time software.
System prototyping
• Protot yping is the rapid development of a s ystem
• In the past, the developed system was normally thought of as inferior in some way to the
required system so further development was required
• Now, the boundary between protot yping and normal system development is blurred and
many systems are developed using an evolutionary approach
Software Engineering
Prototyping process
Establish D e fi n e
Develop Ev aluate
prototype prototype
prototype prototype
objectives functionality
Data Model
• Used to describe the logical structure of data processed by the system
• Entity-relation-attribute model sets out the entit ies in the system, the relationships between
these entities and the entity attributes
• Widely used in database design. Can readily be implemented using relational databases
• No specific notation provided in the UML but objects and associations can be used
Software Engineering
Behavioural Model
• Behavioural models are used to describe the overall behaviour of a system
• Two types of behavioural model are shown here
• Data processing models that show how data is processed as it moves through the system
• State machine models that show the systems response to events
• Both of these models are required for a description of the system‘s behaviour
1. Data-processing models
• Data flow diagrams are used to model the system‘s data processing
• These show the processing steps as data flows through a system
• Intrinsic part of many analysis methods
• Simple and intuitive notation that customers can understand
• Show end-to-end processing of data
Statecharts
• Allow the decomposition of a model into submodels
• A brief description of the actions is included following the ‗do‘ in each state
• Can be complemented by tables describing the states and the stimuli
Structured Analysis
• The data-flow approach is typified by the Structured Analysis method (SA)
• Two major strategies dominate structured analysis
• ‗Old‘ method popularised by DeMarco
• ‗Modern‘ approach by Yourdon
DeMarco
• A top-down approach
• The analyst maps the current physical system onto the current logical data-flo w
model
• The approach can be summarised in four steps:
• Analysis of current physical system
• Derivation of logical model
• Derivation of proposed logical model
• Implementation of new physical system
Method weaknesses
• They do not model non-functional system requirements.
• They do not usually include information about whether a method is appropriate for a given
problem.
• The may produce too much documentation.
• The system models are sometimes too detailed and difficult for users to understand.
CASE workbenches
• A coherent set of tools that is designed to support related software process activities such as
analysis, design or testing.
• Analysis and design workbenches support system modelling during both requirements
engineering and system design.
• These workbenches may support a specific design method or may provide support for a
creating several different types of system model.
Software Engineering
Ce ntr a l Quer y
i n f o r m a ti o n la ngua ge
re pository facilities
• Diagram editors
• Model analysis and checking tools
• Repository and associated query language
• Data dictionary
• Report definition and generation tools
• Forms definition tools
• Import/export translators
• Code generation tools
Data Dictionary
• Data dictionaries are lists of all of the names used in the system models. Descriptions of the
entities, relationships and attributes are also included
• Advantages
• Support name management and avoid duplication
• Store of organisational knowledge linking analysis, design and implementation
• Many CASE workbenches support data dictionaries
UNIT III
Design Models – 1:
Software Engineering
• Data Design
– created by transforming the data dictionary and ERD into implementation data
structures
– requires as much attention as algorithm design
• Architectural Design
– derived from the analysis model and the subsyst em interactions defined in the
DFD
• Interface Design
– derived from DFD and CFD
– describes software elements communication with
• other software elements
• other systems
• human users
Design Models – 2 :
• Procedure-level design
– created by transforming the structural elements defined by the software
architecture into procedural descriptions of software components
– Derived from information in the PSPEC, CSPEC, and STD
Design Principles – 1:
• Process should not suffer from tunnel vision – consider alternative approaches
• Design should be traceable to analysis model
• Do not try to reinvent the wheel
- use design patterns ie reusable components
• Design should exhibit both uniformity and integration
• Should be structured to accommodate changes
Design Principles – 2 :
• Design is not coding and coding is not design
• Should be structured to degrade gently, when bad data, events, or operating conditions
are encountered
• Needs to be assessed for quality as it is being created
• Needs to be reviewed to minimize conceptual (semantic) errors
Design Concepts -1 :
• Abstraction
– allows designers to focus on solving a problem without being concerned about
irrelevant lower level details
Procedural abstraction is a named sequence of instructions that has a specific and limited
function
e.g open a door
Open implies a long sequence of procedural steps
data abstraction is collection of data that describes a data object
e.g door type, opening mech, weight,dimen
Design Concepts -2 :
• Design Patterns
– description of a design structure that solves a particular design problem wit hin a
specific context and its impact when applied
Design Concepts -3 :
Software Engineering
• Software Architecture
– overall structure of the software components and the ways in which that structure
– provides conceptual integrity for a system
Design Concepts -4 :
• Information Hiding
– information (data and procedure) contained within a module is inaccessible to
modules that have no need for such information
• Functional Independence
– achieved by developing modules with single-minded purpose and an aversion to
excessive interaction with other models
Refactoring – Design concepts :
• Fowler [FOW99] defines refactoring in the following manner:
– "Refactoring is the process of changing a software s ystem in such a way that it
does not alter the external behavior of the code [design] yet improves its internal
structure.ǁ
• When software is refectories, the existing design is examined for
– redundancy
– unused design elements
– inefficient or unnecessary algorithms
– poorly constructed or inappropriate data structures
– or any other design failure that can be corrected to yield a better design.
Design Concepts – 4 :
• Objects
– encapsulate both data and data manipulation procedures needed to describe the
content and behavior of a real world entity
• Class
– generalized descript ion (template or pattern) that describes a collection of similar
objects
• Inheritance
– provides a means for allowing subclasses to reuse exist ing superclass data and
procedures; also provides mechanism for propagating changes
Design Concepts – 5:
• Messages
– the means by which objects exchange information with one another
• Polymorphism
– a mechanism t hat allows several objects in an class hierarchy to have different
methods with the same name
– instances of each subclass will be free to respond to messages by calling their own
version of the method
• Layered
– several layers are defined
– each layer performs operations that beco me closer to the machine instruction set
in the lower layers
Architectural Styles – 3:
Call and return
– program structure decomposes function into control hierarch y with main program
invoking several subprograms
Software Architecture Design – 1:
• Software to be developed must be put into context
– model external entities and define interfaces
• Identify architectural archetypes
– collection of abstractions that must be modeled if the system is to be constructed
Object oriented Architecture :
• The co mponents of a system encapsulate data and the operations that must be applied to
manipulate the data. Communication and coordination between components is
accomplished via message passing
Software Architecture Design – 2:
• Specify structure of the system
– define and refine the software components needed to implement each archet ype
• Continue the process iteratively until a complete architectural structure has been derived
Layered Architecture:
• Number of different layers are defined, each accomplishing operations that progressivel y
become closer to the machine instruction set
• At the outer layer –components service user interface operations.
• At the inner layer – components perform operating system interfacing.
• Intermediate layers provide utility services and application software function
Architecture Tradeoff Analysis – 1:
1. Collect scenarios
2. Elicit requirements, constraints, and environmental description
3. Describe architectural styles/patterns chosen to address scenarios and requirements
• module view
• process view
• data flow view
Architecture Tradeoff Analysis – 2:
4. Evaluate quality attributes independently (e.g. reliability, performance, security,
maintainability, flexibility, testability, portability, reusability, interoperability)
5. Identify sensitivity points for architecture
• any attributes significantly affected by changing in the architecture
Refining Architectural Design:
• Processing narrative developed for each module
• Interface description provided for each module
• Local and global data structures are defined
• Design restrictions/limitations noted
• Design reviews conducted
Software Engineering
• Structure the system into a set of loosely coupled objects with well-defined interfaces.
• Object-oriented decomposition is concerned with identifying object classes, their attributes
and operations.
• When implemented, objects are created from these classes and so me control model used to
coordinate object operations.
Produce
Design Eval uate design
dynamic design
prototype with end-users
prototype
Executable Implement
prototype fin al us er
int erface
UI design principles
• User familiarity
• The interface should be based on user-oriented terms and concepts rather than
computer concepts
• E.g., an office system should use concepts such as letters, documents, folders etc.
rather than directories, file identifiers, etc.
• Consistency
• The system should display an appropriate level of consistency
• Commands and menus should have the same format, command punctuation should be
similar, etc.
• Minimal surprise
• If a co mmand operates in a known wa y, the user should be able to predict the
operation of comparable commands
• Recoverability
• The system should provide some interface to user errors and allow the user to recover
from errors
• User guidance
• Some user guidance such as help systems, on-line manuals, etc. should be supplied
• User diversity
• Interaction facilities for different types of user should be supported
• E.g., some users have seeing difficulties and so larger text should be available
User-system interaction
• Two problems must be addressed in interactive systems design
• How should information from the user be provided to the computer system?
• How should information from the computer system be presented to the user?
Interaction styles
• Direct manipulation
• Easiest to grasp with immediate feedback
• Difficult to program
• Menu selection
• User effort and errors minimized
• Large numbers and combinations of choices a problem
Software Engineering
• Form fill-in
• Ease of use, simple data entry
• Tedious, takes a lot of screen space
• Natural language
• Great for casual users
• Tedious for expert users
Information presentation
• Information presentation is concerned with presenting system information to system users
• The information may be presented direct ly or may be transformed in so me way for
presentation
• The Model-View-Controller approach is a way of supporting multiple presentations of data
Information display
1
0 10 20
4 2
Textual highlighting
!
The fi lena me y o u have cho sen h as been
us ed. P lea se cho os e an other na me
OK Ca ncel
Data visualisation
• Concerned with techniques for displaying large amounts of information
Software Engineering
• Visualisation can reveal relationships between entities and trends in the data
• Possible data visualisations are:
• Weather information
• State of a telephone network
• Chemical plant pressures and temperatures
• A model of a molecule
Colour displays
• Colour adds an extra dimension to an interface and can help the user understand complex
information structures
• Can be used to highlight exceptional events
• The use of colour to communicate meaning
Error messages
• Error message design is critically important. Poor error messages can mean that a user
rejects rather than accepts a system
• Messages should be polite, concise, consistent and constructive
• The background and experience of users should be the determining factor in message
design
User interface evaluation
• Some evaluation of a user interface design should be carried out to assess its suitability
• Full scale evaluation is very expensive and impractical for most systems
• Ideally, an interface should be evaluated against req
• However, it is rare for such specifications to be produced
• Because o f the need to respond to timing demands made by different stimuli / responses, the
system architecture must allow for fast switching between stimulus handlers
• Timing demands of different st imuli are different so a simple sequential loop is not usually
adequate
Real –Time Software Design:
• Designing embedded software systems whose behaviour is subject to timing constraints
• To explain the concept of a real-time system and why these systems are usuall y
implemented as concurrent processes
• To describe a design process for real-time systems
• To explain the role of a real-time executive
• To introduce generic architectures for monitoring and control and data acquisitio n
systems
Real-time systems:
• Systems which monitor and control their environment
• Inevitably associated with hardware devices
– Sensors: Collect data from the system environment
– Actuators: Change (in some way) the system's
environment
• Time is critical. Real-time systems MUST respond within specified times
Definition:
• A real-time system is a software system where the correct functioning of the system
depends on the results produced by the system and the time at which these results are
produced
• A ‗soft‘ real-time system is a system whose operation is degraded if results are not
produced according to the specified timing requirements
• A ‗hard‘ real-time system is a system whose operation is incorrect if results are not
produced according to the timing specification
Stimulus/Response Systems:
• Given a stimulus, the system must produce a esponse within a specified time
• Periodic stimuli. Stimuli which occur at predictable time intervals
– For example, a temperature sensor may be polled 10 times per second
• Aperiodic stimuli. Stimuli which occur at unpredictable times
– For example, a system power failure may trigger an interrupt which must be
processed by the system
Architectural considerations:
• Because of the need to respond to timing demands made by different stimuli/responses,
the system architecture must allow for fast switching between stimulus handlers
• Timing demands of different stimuli are different so a simple sequential loop is not
usually adequate
• Real-time systems are usually designed as cooperating processes with a real-t ime
executive controlling these processes
A real-time system model:
Software Engineering
Real-time con
tro l sys tem
System elements:
• Sensors control processes
– Collect information from sensors. May buffer information collected in response to
a sensor stimulus
• Data processor
– Carries out processing of collected information and computes the system response
• Actuator control
– Generates control signals for the actuator
R-T systems design process:
• Identify the stimuli to be processed and the required responses to these stimuli
• For each stimulus and response, identify the timing constraints
• Aggregate the stimulus and response processing into concurrent processes. A process
may be associated with each class of stimulus and response
• Design algorithms to process each class of st imulus and response. These must meet the
given timing requirements
• Design a scheduling s ystem which will ensure that processes are started in t ime to meet
their deadlines
• Integrate using a real-time executive or operating system
Timing constraints:
• May require extensive simulation and experiment to ensure that these are met by the
system
• May mean that certain design strategies such as object-oriented design cannot be used
because of the additional overhead involved
• May mean that low-level programming language features have to be used for
performance reasons
Real-time programming:
• Hard-real time systems may have to programmed in assembly language to ensure that
deadlines are met
• Languages such as C allow efficient pro grams to be written but do not have constructs to
support concurrency or shared resource management
• Ada as a language designed to support real-time systems design so includes a general
purpose concurrency mechanism
Non-stop system components:
Software Engineering
• Configuration manager
– Responsible for the dynamic reconfiguration of the system
software and hardware. Hardware modules may be replaced and software
upgraded without stopping the systems
• Fault manager
– Responsible for detecting software a nd hardware faults and
taking appropriate actions (e.g. switching to backup disks) to ensure that the
system continues in operation
Burglar alarm system e.g
• A s ystem is required to monitor sensors on doo rs and windows to detect the presence o f
intruders in a building
• When a sensor indicates a break-in, the s ystem switches on lights around the area and
calls police automatically
• The system should include provision for operation without a mains power supply
• Sensors
• Movement detectors, window sensors, door sensors.
• 50 window sensors, 30 door sensors and 200 movement detectors
• Voltage drop sensor
• Actions
• When an intruder is detected, police are called automatically.
• Lights are switched on in rooms with active sensors.
• An audible alarm is switched on.
• The system switches automatically to backup power when a voltage drop is
detected.
The R-T system design process:
• Identify stimuli and associated responses
• Define the timing constraints associated with each stimulus and response
• Allocate system functions to concurrent processes
• Design algorithms for stimulus processing and response generation
• Design a scheduling system which ensures that processes will always be scheduled to
meet their deadlines
Control systems:
• A burglar alarm system is primarily a monitoring system. It collects data from sensors but
no real-time actuator control
• Control systems are similar but, in response to sensor values, the system sends control
signals to actuators
• An example of a mo nitoring and control s ystem is a s ystem which mo nitors temperature
and switches heaters on and off
Data acquisition systems:
• Collect data from sensors for subsequent processing and analysis.
• Data collection processes and processing processes may have different periods and
deadlines.
• Data collection may be faster than processing e.g. collecting information about an
explosion.
• Circular or ring buffers are a mechanism for smoothing speed differences.
Software Engineering
Sensor
proces
s
Senso
500Hz r
values
Thermostat
process
Switch
500Hz command Thermostat process
Room number
Heater Furnace
control control
process process
Mutual exclusion:
• Producer processes collect data and add it to the buffer. Consumer processes take data
from the buffer and make elements available
Software Engineering
• Producer and consumer processes must be mutually excluded from accessing the same
element.
The buffer must stop producer processes adding information to a full buffer and consumer
processes trying to take information from an empty buffer
System Design
• Design both the hardware and the software associated with system. Partit ion functions to
either hardware or software
• Design decisions should be made on the basis on non-functional system requirements
• Hardware delivers better performance but potentially lo nger development and less scope for
change
System elements
• Sensors control processes
• Collect information from sensors. May buffer information collected in response t o a
sensor stimulus
• Data processor
• Carries out processing of collected information and computes the system response
• Actuator control
• Generates control signals for the actuator
Sensor/actuator processes
Sen so r Act uat or
St imulus Response
Es t ab l is h s ys tem
requ irement s
Parti ti on requ
irement s
Timing constraints
• For aperiodic stimuli, designers make assumptions about probability of occurrence of stimuli.
• May mean that certain design strategies such as object-oriented design cannot be used
because of the additional overhead involved
Fu l l
p owe r F u ll p o w e r
d o : se t p o w e r
= 6 00
Ti mer
Wait in g
Nu mb er
d o: di sp lay Op erati on
Fu ll Set ti me
ti me
p ow er d o: get nu mber d o: op erate
e xi t: s e t t im e o ven
H al f
Hal f p ow er
Do or
p ow er Ca ncel
Ti mer clo se d
Do or St art
o pen S y st e m
Hal f p ower faul t Wait in g
E n a bl e d
d o : se t p o w e r Do or d o: di sp lay d o : d i sp l a y
= 3 00 clo sed ' Re ady' ti me
Di s ab l ed
d o: di s p la y
'Wait in g'
Real-time programming
• Hard-real time systems may have to programmed in assembly language to ensure that
deadlines are met
• Languages such as C allow efficient programs to be written but do not have constructs to
support concurrency or shared resource management
• Ada as a language designed to support real-t ime s ystems design so includes a general
purpose concurrency mechanism
Executive components
• Real-time clock
• Provides information for process scheduling.
• Interrupt handler
Software Engineering
Ex ecut in g
p ro ces s
Process priority
• The processing of some types of stimuli must sometimes take priority
• Interrupt level priority. Highest priority which is allocated to processes requiring a very fast
response
• Clock level priority. Allocated to periodic processes
• Within these, further levels of priority may be assigned
Interrupt servicing
• Control is transferred automatically to a pre-determined memory location
• This location contains an instruction to jump to an interrupt service routine
• Further interrupts are disabled, the interrupt serviced and control returned to the interrupted
process
Software Engineering
Process management
• Concerned with managing the set of concurrent processes
• Periodic processes are executed at pre-specified time intervals
• The executive uses the real-time clock to determine when to execute a process
• Process period - time between executions
• Process deadline - the time by which processing must be complete
Process switching
• The scheduler chooses the next process to be executed by the processor. This depends on a
scheduling strategy which may take the process priority into account
• The resource manager allocates memory and a processor for the process to be executed
• The despatcher takes the process from ready list, loads it onto a processor and starts
execution
Scheduling strategies
• Non pre-emptive scheduling
• Once a process has been scheduled for execution, it runs to completion or until it is
blocked for some reason (e.g. waiting for I/O)
• Pre-emptive scheduling
• The execution of an executing processes may be stopped if a higher prio rity process
requires service
• Scheduling algorithms
• Round-robin
• Shortest deadline first
A ring buffer
Producer
proces s
Cons umer
process
Mutual exclusion
• Producer processes collect data and add it to the buffer. Consumer processes take data from
the buffer and make elements available.
• Producer and consumer processes must be mutually excluded from accessing the same
element.
• The buffer must stop producer processes adding information to a full buffer and consumer
processes trying to take information from an empty buffer.
int numberOfEntries = 0 ;
int front = 0, back = 0 ;
CircularBuffer (int n) {
bufsize = n ;
store = new SensorRecord [bufsize] ;
} // CircularBuffer
• The system should include provision for operation without a mains power supply
Timing requirements
Process architecture
4 00 Hz 6 0Hz 1 00 Hz
5 60 Hz Al ar m s ys tem
Power fai lu re
i nt erru pt Bu il di ng mon it or Roo m n umb er
Ro om nu mber
Al arm Al arm Al arm s ys tem
s ys tem s ys tem Ro om nu mber
Au di bl e alarm Li ghti ng co nt ro l Vo ice s yn th esi zer p
p ro ces s p ro ces s ro ces s
BuildingMonitor()
{
// initialise all the sensors and start the processes
[Link] () ; [Link] () ;
[Link] () ; [Link] () ;
[Link] () ; [Link] () ; [Link] () ;
}
Software Engineering
} // run
} //BuildingMonitor
Sen so r
p ro ces s
Sen so r
5 00 Hz valu es
Th ermo st at
p ro ces s
Sw it ch co mmand
5 00 Hz Ro om n u mber Th ermo st at pro ces s
Control systems
Software Engineering
• A burglar alarm system is primarily a monitoring system. It collects data from sensors but no
real-time actuator control
• Control systems are similar but, in response to sensor values, the system sends contro l
signals to actuators
• An example o f a monitoring and control s ystem is a system which mo nitors temperature and
switches heaters on and off
UNIT IV
TESTING
Taxonomy of Software Testing
• Classified by purpose, software testing can be divided into: correctness testing, performance
testing, and reliability testing and security testing.
• Classified by life-cycle phase, software testing can be classified into the fo llowing
categories: requirements phase test ing, design phase testing, program phase testing,
evaluating test results, installation phase testing, acceptance testing and maintenance testing.
• By scope, software testing can be categorized as follows: unit testing, component testing,
integration testing, and system testing.
Correctness testing
Correctness is the minimum requirement of so ftware, the essential purpose of testing. It is
used to tell the right behavior from the wrong one. The tester may or may not know the inside
details of the software module under test, e.g. control flo w, data flow, etc. Therefore, either a
white-box po int of view or black-box point of view can be taken in testing software. We must
note that the black-box and white-box ideas are not limited in correctness testing only.
• Black-box testing
• White-box testing
Performance testing
Not all software systems have specifications on performance explicit ly. But ever y system
will have implicit performance requirements. The software should not take infinite time or
infinite resource to execute. "Performance bugs" sometimes are used to refer to those design
problems in software that cause the system performance to degrade.
Performance has always been a great concern and a driving force of co mputer evo lution.
Performance evaluation of a software s ystem usually includes: resource usage, throughput,
stimulus-response time and queue lengths detailing the average or maximum number of tasks
wait ing to be serviced by selected resources. Typical resources that need to be considered
include network bandwidth requirements, CPU cycles, disk space, disk access operations, and
memory usage. The goal of performance testing can be performance bottleneck ident ification,
performance comparison and evaluation, etc.
Reliability testing
Software Engineering
Security testing
Software qualit y, reliability and security are tight ly coupled. Flaws in software can be
exploited by intruders to open security ho les. With the development of the Internet, software
security problems are becoming even more severe.
Many critical software applications and services have integrated security measures against
malicious attacks. The purpose of security testing of these s ystems include identifying and
removing software flaws that may potentially lead to security vio lations, and validat ing the
effectiveness of security measures. Simulated security attacks can be performed to find
vulnerabilities.
Acceptance testing
Testing to verify a product meets customer specified requirements. A customer usuall y
does this type of testing on a product that is developed externally.
Compatibility testing
This is used to ensure compatibilit y of an application or Web site with different browsers,
OSs, and hardware platforms. Compatibilit y testing can be performed manually or can be driven
by an automated functional or regression test suite.
Conformance testing
This is used to verify implementation conformance to industry standards. Producing tests
for the behavior of an implementation to be sure it provides the portabilit y, interoperabilit y,
and/or compatibility a standard defines.
Integration testing
Modules are t ypically code modules, individual applications, client and server
applicat ions on a network, etc. Integration Testing follows unit testing and precedes system
testing.
Load testing
Load testing is a generic term covering Performance Testing and Stress Testing.
Performance testing
Software Engineering
Regression testing
Similar in scope to a functional test, a regression test allows a consistent, repeatable
validation of each new release of a product or Web site. Such testing ensures reported product
defects have been corrected for each new release and that no new quality problems were
introduced in the maintenance process. Though regression testing can be performed manually an
automated test suite is often used to reduce the time and resources needed to perfo rm the
required testing.
System testing
Entire s ystem is tested as per the requirements. Black-box t ype testing that is based on
overall requirements specifications, covers all combined parts of a system.
End-to-end testing
Similar to system testing, invo lves testing of a complete application environment in a
situation that mimics real-world use, such as interact ing with a database, using network
communications, or interacting with other hardware, applications, or systems if appropriate.
Sanity testing
Testing is to determine if a new software version is performing well enough to accept it
for a major testing effo rt. If application is crashing for initial use then system is not stable
enough for further testing and build or application is assigned to fix.
Alpha testing
In house virtual user environment can be created for this type of testing. Testing is done
at the end of development. Still minor design changes may be made as a result of such testing.
Beta testing
Testing is typically done by end-users or others. This is the final testing before releasing
the application to commercial purpose.
Testing Principles:
• All tests should be traceable to customer requirements.
• Tests should be planned before testing begins.
• 80% of all errors are in 20% of the code.
• Testing should begin in the small and progress to the large.
• Exhaustive testing is not possible.
Testing should be conducted by an independent third party if possible.
Software Defect Causes:
• Specification may be wrong.
• Specification may be a physical impossibility.
• Faulty program design.
• Program may be incorrect.
Types of Errors:
• Algorithmic error.
• Computation & precision error.
• Documentation error.
• Capacity error or boundary error.
• Timing and coordination error.
• Throughput or performance error.
• Recovery error.
• Hardware & system software error.
• Standards & procedure errors.
Software Testability Checklist – 1:
• Operability
– if it works better it can be tested more efficiently
• Observability
– what you see is what you test
• Controllability
– if software can be controlled better the it is more that testing can be automated
and optimized
Software Testability Checklist – 2:
• Decomposabilit y
– controlling the scope of testing allows problems to be iso lated quickly and
retested intelligently
• Stability
– the fewer the changes, the fewer the disruptions to testing
• Understandability
– the more information that is known, the smarter the testing can be done
Good Test Attributes:
• A good test has a high probability of finding an error.
• A good test is not redundant.
• A good test should be best of breed.
• A good test should not be too simple or too complex.
Test Strategies:
• Black-box or behavioral testing
Software Engineering
– knowing the specified function a product is to perform and demo nstrating correct
operation based solely on its specification without regard for its internal logic
• White-box or glass-box testing
– knowing the internal workings of a product, tests are performed to check the
workings of all possible logic paths
White-Box Testing:
Basis Path Testing:
• White-box technique usually based on the program flow graph
• The cyclo matic co mplexity of the pro gram computed from its flow graph using the
formula V(G) = E – N + 2 or by counting the conditional statements in the PDL
representation and adding 1
• Determine the basis set of linearly independent paths (the cardinality of this set is the
program cyclomatic complexity)
• Prepare test cases that will force the execution of each path in the basis set.
Cyclomatic Complexity:
A number of industry studies have indicated that the higher V(G), the higher the probability or
errors.
Control Structure Testing – 1:
• White-box techniques focusing on control structures present in the software
• Condition testing (e.g. branch testing)
– focuses on testing each decision statement in a software module
– it is important to ensure coverage of all logical combinations of data that may be
processed by the module (a truth table may be helpful)
Control Structure Testing – 2:
• Data flow testing
– selects test paths based according to the locations of variable definitio ns and uses
in the program (e.g. definition use chains)
• Loop testing
– focuses on the validity of the program loop constructs (i.e. while, for, go to)
– involves checking to ensure loops start and stop when they are supposed to
(unstructured loops should be redesigned whenever possible)
Loop Testing: Simple Loops:
Minimum conditions—Simple Loops
1. skip the loop entirely
2. only one pass through the loop
3. two passes through the loop
4. m passes through the loop m < n
5. (n-1), n, and (n+1) passes through the loop
where n is the maximum number of allowable passes
Loop Testing: Nested Loops:
Nested Loops
Start at the innermost loop. Set all outer loops to their minimum iteration parameter values.
Test the min+1, t ypical, max-1 and max for the innermost loop, while holding the outer loops at
their minimum values.
Software Engineering
Move out one loop and set it up as in step 2, holding all other loops at typical values. Continue
this step until the outermost loop has been tested.
Concatenated Loops
If the loops are independent of one another
then treat each as a simple loop
else* treat as nested loops
end if*
for example, the final loop counter value of loop 1 is
used to initialize loop 2.
Black-Box Testing:
Graph-Based Testing – 1:
• Black-box methods based on the nature of the relationships (links) among the pro gram
objects (nodes), test cases are designed to traverse the entire graph
• Transaction flow testing
– nodes represent steps in some transact ion and links represent logical connections
between steps that need to be validated
• Finite state modeling
– nodes represent user observable states of the software and links represent state
transitions
Graph-Based Testing – 2:
• Data flow modeling
– nodes are data objects and links are transformations of one data object to another
data object
• Timing modeling
– nodes are program objects and links are sequential connections bet ween these
objects
– link weights are required execution times
Equivalence Partitioning:
• Black-box technique that divides the input domain into classes of data from which test
cases can be derived
• An ideal test case uncovers a class of errors that might require many arbit rary test cases
to be executed before a general error is observed
Equivalence Class Guidelines:
• If input condition specifies a range, one valid and two invalid equivalence classes are
defined
• If an input condition requires a specific value, one valid and two invalid equivalence
classes are defined
• If an input condition specifies a member of a set, one valid and one invalid equivale nce
class is defined
• If an input condition is Boolean, one valid and one invalid equivalence class is defined
• Boundary Value Analysis - 1
• Black-box technique
– focuses on the boundaries of the input domain rather than its center
• Guidelines:
Software Engineering
– If input condit ion specifies a range bounded by values a and b, test cases should
include a and b, values just above and just below a and b
– If an input condition specifies and number of values, test cases should be exercise
the minimum and maximum numbers, as well as values just above and just below
the minimum and maximum values
Boundary Value Analysis – 2
1. Apply guidelines 1 and 2 to output conditions, test cases should be designed to
produce the minimum and maximum output reports
2. If internal program data structures have bo undaries (e.g. size limitations), be
certain to test the boundaries
Comparison Testing:
• Black-box testing for safety critical s ystems in which independent ly developed
implementations of redundant systems are tested for conformance to specificatio ns
• Often equivalence class partitioning is used to develop a co mmon set of test cases for
each implementation
Orthogonal Array Testing – 1:
• Black-box technique that enables the design of a reasonably small set of test cases that
provide maximum test coverage
• Focus is on categories of faulty logic likely to be present in the software component
(without examining the code)
Orthogonal Array Testing – 2:
• Priorities for assessing tests using an orthogonal array
– Detect and isolate all single mode faults
– Detect all double mode faults
– Multimode faults
Software Testing Strategies:
Strategic Approach to Testing – 1:
• Testing begins at the co mponent level and works outward toward the integration of the
entire computer-based system.
• Different testing techniques are appropriate at different points in time.
• The developer of the software conducts testing and may be assisted by independent test
groups for large projects.
• The ro le of the independent tester is to remove the conflict of interest inherent when the
builder is testing his or her own product.
Strategic Approach to Testing – 2:
• Testing and debugging are different activities.
• Debugging must be accommodated in any testing strategy.
• Need to consider verification issues
– are we building the product right?
• Need to Consider validation issuesare we building the right product?
Verification vs validation:
• Verification:
"Are we building the product right" The software should conform to its specification
Validation:
"Are we building the right product" The software should do what the user really requires
The V & V process:
Software Engineering
• As a whole life-c ycle process - V & V must be applied at each stage in the software
process.
• Has two principal objectives
– The discovery of defects in a system
– The assessment of whether or not the system is usable in an operational situation.
• Strategic Testing Issues - 1 Specify product requirements in a quant ifiable manner before
testing starts.
• Specify testing objectives explicitly.
• Identify the user classes of the software and develop a profile for each.
• Develop a test plan that emphasizes rapid cycle testing.
Strategic Testing Issues – 2:
• Build robust software that is designed to test itself (e.g. use anti-bugging).
• Use effective formal reviews as a filter prior to testing.
• Conduct formal technical reviews to assess the test strategy and test cases.
Testing Strategy:
Unit Testing:
Software Engineering
• Program reviews.
• Formal verification.
• Testing the program itself.
– black box and white box testing.
Black Box or White Box?:
• Maximum # of logic paths - determine if white box testing is possible.
• Nature of input data.
• Amount of computation involved.
• Complexity of algorithms.
Unit Testing Details:
• Interfaces tested for proper information flow.
• Local data are examined to ensure that integrity is maintained.
• Boundary conditions are tested.
• Basis path testing should be used.
• All error handling paths should be tested.
• Drivers and/or stubs need to be developed to test incomplete software.
Unit Testing:
Integration Testing:
• Bottom - up testing (test harness).
• Top - down testing (stubs).
• Regression Testing.
• Smoke Testing
• Regression testing may be used to ensure that new errors not introduced.
Bottom-Up Integration:
Regression Testing:
• Regression test suit contains 3 different classes of test cases
– Representative sample of existing test cases is used to exercise all software
functions.
– Additional test cases focusing software functions likely to be affected by the
change.
– Tests cases that focus on the changed software components.
Smoke Testing:
• Software components already translated into code are integrated into a build.
• A series of tests designed to expose errors that will keep the build from performing its
functions are created.
• The build is integrated with the other builds and the ent ire product is smoke tested daily
using either top-down or bottom integration.
Validation Testing:
Software Engineering
Procedural programming
Procedural programming can so metimes be used as a synonym for imperative
programming (specifying the steps the program must take to reach the desired state), but can also
refer (as in this article) to a programming paradigm, derived from structured programming, based
upon the concept of the procedure call. Procedures, also known as routines, subroutines,
methods, or functions (not to be confused with mathemat ical functions, but similar to those used
in funct ional programming) simply contain a series of co mputational steps to be carried out. Any
given procedure might be called at any point during a program's execut ion, including by other
procedures or itself. Some good examples of procedural pro grams are t he Linux Kernel, GIT,
Apache Server, and Quake III Arena.
Object-oriented programming
Software Engineering
Logic programming is, in its broadest sense, the use of mathematical logic for computer
programming. In this view of logic pro grammin g, which can be t raced at least as far back as
John McCarthy's [1958] advice-taker proposal, logic is used as a purely declarative
representation language, and a theorem-prover or model-generator is used as the problem-so lver.
The problem-solving task is split between the programmer, who is respo nsible only for ensuring
the truth of programs expressed in logical form, and the theorem-prover or model-generator,
which is responsible for solving problems efficiently.
Rapid Implementations
In the late 1990s as Y2K approached, customers demanded and consult ing firms discovered
faster ways to implement packaged software applicat ions. The rapid implementation became
possible for certain t ypes of customers. The events that converged in the late 1990s to provide
faster implementations include the following:
• Many smaller companies couldn‘t afford the big ERP project. If the software vendors and
consulting firms were go ing to sell to the ―middle marketǁ companies, they had to
develop more efficient methods.
• Many dotcoms needed a financial infrastructure; ERP applications filled the need, and rapid
implementation methods provided the way.
• The functionality of the software improved a lo t, many gaps were eliminated, and more
companies could implement with fewer customizations.
• After the big, complex companies implemented their ERP systems, the typical
implementation became less difficult.
• The number of skilled consultants and project managers increased significantly.
• Other software vendors started packaging preprogrammed integration po ints to the Oracle
ERP modules.
Software Engineering
Phased Implementations
Phased implementations seek to break up the work of an ERP implementation project.
This technique can make the system more manageable and reduce risks, and costs in so me cases,
to the enterprise. In the mid-1990s, 4 or 5 was about the maximum number of applicatio n
modules that could be launched into production at one time. If you bought 12 or 13 applications,
there would be a financial phase that would be followed by phases for the distribution and
manufacturing applications. As implementation techniques improved and Y2K pressures grew in
the late 1990s, more and more companies started launching most of their applications at the same
time. This method became known as the big-bang approach. Now, each co mpany selects a
phased or big-bang approach based on its individual requirements.
Another approach to phasing can be emplo yed by co mpanies with business units at
multiple sites. With this technique, one business unit is used as a template, and all applications
are completely implemented in an initial phase last ing 10–14 months. Then, other sites
implement the applicat ions in cookie-cutter fashion. The cookie-cutter phases are focused on
end-user training and the differences that a site has from the protot ype site. The cookie-cutter
phase can be as short as 9–12 weeks, and these phases can be conducted at several sites
simultaneously. For your reference, we participated in an efficient project where 13 app lications
were implemented big bang–st yle in July at the Chicago site after about 8 months work. A site in
Malaysia went live in October. The Ireland site started up in November. After a holiday break,
the Atlanta business unit went live in Februar y, and t he final site in China started using the
applications in April. Implement ing thirteen application modules at five sites in four countries in
sixteen months was pretty impressive.
Case Studies Illustrating Implementation Techniques
Some pract ical examples from the real world might help to illustrate some of the principles and
techniques of various software implementation methods. These case studies are composites fro m
about 60 implementation projects we have observed during the past 9 years.
Big companies often have a horrible t ime resolving issues and deciding on configuration
parameters because there is so much money involved and each of many sites might want to
control decisions about what it considers its crit ical success factors. For example, we once s aw a
large company argue for over two months about the chart of accounts structure, while eight
consultants from two consult ing firms tried to referee amo ng the feuding operating units.
Another large company labored for more than six months to unify a mast er customer list for a
centralized receivables and decentralized order entry system.
Transition activit ies at large companies need special attention. Training end users can be
a logist ical challenge and can require considerable planning. For example, if you have 800 users
to train and each user needs an average of three classes of two hours each and you have one
month, how many classrooms and instructors do you need? Another example is that loading data
Software Engineering
from a legacy s ystem can be a problem. If you have one million customers to load into Oracle
receivables at the rate of 5,000/hour and the database administrator allows you to load 20 hours
per day, you have a 10-day task.
Because they spend huge amounts of money on their ERP systems, many big co mpanies
try to optimize the systems and capture specific returns on the investment. However, sometimes
companies can be incredibly insensitive and unco ordinated as they tr y to make money fro m their
ERP software. For example, one business announced at the beginning of a pro ject that the
accounts payable depart ment would be cut from 50–17 emplo yees as soon as the system went
live. Another company decided to centralize about 30 accounting sites into one shared service
center and advised about 60 accountants that they would lo se their jo bs in about a year. Several
of the 60 employees were offered positions on the ERP implementation team.
Small companies have other problems when creating an implementation team. Occasionally, the
small co mpany tries to put clerical emplo yees on the team and they have problems with issue
resolution or some of the ERP concepts. In another case, one small co mpany didn‘t create the
position of project manager. Each department worked on its own modules and ignored the
integration points, testing, and requirements of other users. When Y2K deadlines forced the
system startup, results were disastrous with a cost impact that doubled the cost of the ent ire
project.
Project team members at small companies sometimes have a hard time relating to the cost
of the implementation. We once worked with a company where the pro ject manager (who was
also the database administrator) advised me within the first hour of our meet ing that he thought
consulting charges of $3/minute were outrageo us, and he couldn‘t rationalize how we could
possibly make such a contribution. We agreed a consultant could not contribute $3 in value each
and every minute to his project. However, when I told him we would be able to save him
$10,000/week and make the difference between success and failure, he realized we should get to
work.
Because the small co mpany might be relat ively simple to implement and the technical
staff might be inexperienced with the database and software, it is possible that the technical staff
will be on the crit ical path o f the pro ject. If the database administrator can‘t learn how to handle
the production database by the time the users are ready to go live, you might need to hire so me
temporary help to enable the users to keep to the schedule. In addition, we often s ee small
companies with just a single database administrator who might be working 60 or mo re hours per
week. They feel they can afford to have more DBAs as employees, but they don‘t know how to
establish the right ratio of support staff to user requirements. These companies can burn out a
DBA quickly and then have to deal with the problem of replacing an important skill.
Software Engineering
UNIT V
Software metric
• Any type of measurement which relates to a software system, process or related
documentation
• Lines of code in a program, the Fog index, number of person-days required to
develop a component.
• Allow the software and the software process to be quantified.
• May be used to predict product attributes or to control the software process.
• Product metrics can be used for general predictions or to identify anomalous components.
Metrics assumptions
• A software property can be measured.
• The relationship exists between what we can measure and what we want to know. We can
only measure internal attributes but are often more interested in external software attributes.
• This relationship has been formalised and validated.
• It may be difficult to relate what can be measured to desirable external quality attributes.
Data collection
• A metrics programme should be based on a set of product and process data.
• Data should be collected immediately (not in retrospect) and, if possible, automatically.
• Three types of automatic data collection
• Static product analysis;
• Dynamic product analysis;
• Process data collation.
Data accuracy
• Don‘t collect unnecessary data
• The questions to be answered should be decided in advance and the required data
identified.
• Tell people why the data is being collected.
• It should not be part of personnel evaluation.
• Don‘t rely on memory
• Collect data when it is generated not after a project has finished.
Software Engineering
Product metrics
• A quality metric should be a predictor of product quality.
• Classes of product metric
• D ynamic metrics which are collected by meas urements made of a program in
execution;
• Static metrics which are collected by measurements made of the system
representations;
• Dynamic metrics help assess efficiency and reliabilit y; static metrics help assess
complexity, understand ability and maintainability.
Object-oriented metrics
Depth of inheritance tree This represents the number of discrete levels in the inheritance
tree where sub-classes inherit attributes and operations
(methods) from super-classes. The deeper the inheritance tree,
the more complex the design. Many different object classes may
have to be understood to understand the object classes at the
leaves of the tree.
Method fan-in/fan-out This is directly related to fan-in and fan-out as described above
and means essentially the same thing. However, it may be
appropriate to make a distinction between calls from other
methods within the object and calls from external methods.
Weighted methods per This is the number of methods that are included in a class
class weighted by the complexity of each method. Therefore, a simple
method may have a complexity of 1 and a large and complex
method a much higher value. The larger the value for this
metric, the more complex the object class. Complex objects are
more likely to be more difficult to understand. They may not be
logically cohesive so cannot be reused effectively as super-
classes in an inheritance tree.
Number of overriding This is the number of operations in a super-class that are over-
operations ridden in a sub-class. A high value for this metric indicates that
the super-class used may not be an appropriate parent for the
sub-class.
Measurement analysis
• It is not always obvious what data means
• Analysing collected data is very difficult.
• Professional statisticians should be consulted if available.
• Data analysis must take local circumstances into account.
Measurement surprises
• Reducing the number of faults in a program leads to an increased number of help desk calls
• The pro gram is now thought of as more reliable and so has a wider more diverse
market. The percentage of users who call the help desk may have decreased but the
total may increase;
• A more reliable system is used in a different way from a s ystem where users work
around the faults. This leads to more help desk calls.
ZIPF’s Law
• Zipf's Law as "the observation that frequency of occurrence of so me event (P), as a function
of the rank (i) when the rank is determined by the above frequenc y o f occurrence, is a power-
law function Pi ~ 1/ia with the exponent a close to unity (1)."
Software Engineering
• There is not a simple relationship between the development cost and the price charged to the
customer.
• Broader organisational, economic, political and business considerations influence the price
charged.
Software productivity
• A measure of the rate at which individual engineers involved in software development
produce software and associated documentation.
• Not quality-oriented although quality assurance is a factor in productivity assessment.
• Essentially, we want to measure useful functionality produced per time unit.
Productivity measures
• Size related measures based on some output from the software process. This may be lines o f
delivered source code, object code instructions, etc.
• Function-related measures based on an est imate of the functionality of the delivered
software. Function-points are the best known of this type of measure.
Measurement problems
• Estimating the size of the measure (e.g. how many function points).
• Estimating the total number of programmer months that have elapsed.
• Estimating contractor productivity (e.g. documentation team) and incorporating this
estimate in overall estimate.
Lines of code
• The measure was first proposed when programs were typed on cards with one line per card;
• How does this correspond to statements as in Java which can span several lines or where
there can be several statements on one line.
Productivity comparisons
• The lower level the language, the more productive the programmer
• The same functionality takes more code to implement in a lower-level language than
in a high-level language.
• The more verbose the programmer, the higher the productivity
• Measures o f productivity based on lines o f code suggest that pro grammers who write
verbose code are more productive than programmers who write compact code.
COCOMO model
• An empirical model based on project experience.
• Well-documented, ‗independent‘ model which is not tied to a specific software vendor.
• Long history from init ial version published in 1981 (COCOMO-81) through various
instantiations to COCOMO 2.
• COCOMO 2 takes into account different approaches to software development, reuse, etc.
COCOMO 81
COCOMO 2
• COCOMO 81 was developed with the assumption that a waterfall process would be used and
that all software would be developed from scratch.
• Since its formulation, there have been many changes in software engineering pract ice and
COCOMO 2 is designed to accommodate different approaches to software development.
COCOMO 2 models
• COCOMO 2 incorporates a range of sub-models that produce increasingly detailed software
estimates.
• The sub-models in COCOMO 2 are:
• Application composition model. Used when software is composed from exist ing
parts.
• Early design model. Used when requirements are available but design has not yet
started.
• Reuse model. Used to compute the effort of integrating reusable components.
Software Engineering
• Post-architecture model. Used once the system architecture has been designed and
more information about the system is available.
Multipliers
• Multipliers reflect the capability of the developers, the non-functional requirements, the
familiarity with the development platform, etc.
• RCPX - product reliability and complexity;
Software Engineering
Post-architecture level
• Uses the same formula as the early design model but with 17 rather than 7 associated
multipliers.
• The code size is estimated as:
• Number of lines of new code to be developed;
• Estimate of equivalent number of lines of new code computed using the reuse model;
• An estimate of the number of lines of code that have to be modified according to
requirements changes.
The exponent term
• This depends on 5 scale factors (see next slide). Their sum/100 is added to 1.01
• A co mpany takes on a project in a new domain. The client has not defined the process to be
used and has not allowed time for risk analysis. The company has a CMM level 2 rating.
• Precedenteness - new project (4)
• Development flexibility - no client involvement - Very high (1)
• Architecture/risk resolution - No risk analysis - V. Low .(5)
• Team cohesion - new team - nominal (3)
• Process maturity - some control - nominal (3)
Software Engineering
Multipliers
• Product attributes
• Concerned with required characteristics of the software product being developed.
• Computer attributes
• Constraints imposed on the software by the hardware platform.
• Personnel attributes
• Multipliers that take the experience and capabilities of the people working on the
project into account.
• Project attributes
• Concerned with the particular characteristics of the software development project.
Delphi method
The Delphi method is a systematic, interactive forecasting method which relies on a panel
of experts. The experts answer questionnaires in two or more rounds. After each round, a
facilitator provides an anonymous summar y of the experts‘ forecasts fro m the previous round as
well as the reasons they provided for their judgments. Thus, experts are encouraged to revise
their earlier answers in light of the replies of other members of their panel. It is believed that
during this process the range of the answers will decrease and the group will converge towards
the "correct" answer. Finally, the process is stopped after a pre-defined stop criterion (e.g.
number of rounds, achievement of consensus, stabilit y of results) and the mean or median scores
of the final rounds determine the results.
Software Engineering
The Delphi Technique is an essent ial project management technique that refers to an
information gathering technique in which the opinio ns of those whose opinio ns are most
valuable, traditionally industry experts, is solicited, with the ultimate hope and go al of attaining a
consensus. Typically, the po lling of these industry experts is done on an anonymous basis, in
hopes of attaining opinions that are unfettered by fears or ident ifiabilit y. The experts are
presented with a series of questions in regards to the pro ject, which is typically, but not alwa ys,
presented to the expert by a third-party facilitator, in hopes of elicit ing new ideas regarding
specific project points. The responses from all experts are typically co mbined in the form of an
overall summar y, which is then provided to the experts for a review and for the opportunity to
make further comments. This process t ypically results in consensus within a number of rounds,
and this technique t ypically helps minimize bias, and minimizes the possibility t hat any o ne
person can have too much influence on the outcomes.
Key characteristics
The following key characteristics of the Delphi method help the participants to focus on
the issues at hand and separate Delphi from other methodologies:
• Structuring of information flow
The initial contributions from the experts are collected in the form of answers to
questionnaires and their comments to these answers. The panel director controls the interactions
among the participants by processing the information and filt ering out irrelevant content. This
avoids the negat ive effects of face-to-face panel discussio ns and solves the usual problems o f
group dynamics.
• Regular feedback
Participants co mment on their own forecasts, the responses of others and on the pro gress
of the panel as a who le. At any moment they can revise their earlier statements. While in regular
group meet ings part icipants tend to stick to previously stated opinio ns and often conform too
much to group leader, the Delphi method prevents it.
• Anonymity of the participants
Usually all participants maintain anonymit y. Their identity is not revealed even after the
completion of the final report. This stops them from do minat ing others in the process using their
authority or personalit y, frees them to some extent from their personal biases, minimizes the
"bandwagon effect" or "halo effect", allows them to freely express their opinions, and
encourages open critique and admitting errors by revising earlier judgments.
The first step is to found a steering co mmittee (if you need one) and a management team
with sufficient capacit ies for the process. Then expert panels to prepare and formulate the
statements are helpful unless it is decided to let that be done by the management team. The
whole procedure has to be fixed in advance: Do you need panel meetings or do the teams work
virtually. Is the questionnaire an electronic or a paper one? This means, that logistics (fro m
Internet programming to typing the results from the paper versio ns) have to be organised. Will
there be follow-up work-shops,interviews, presentations? If yes, these also have to be organised
and pre-pared. Printing o f brochures, leaflets, questionnaire, reports have also be considered. The
last organisational point is the interface with the financing organisation if this is different fro m
the management team.
Software Engineering
Scheduling
Scheduling Principles
• compartmentalization—define distinct tasks
• interdependency—indicate task interrelationship
• effort validation—be sure resources are available
• defined responsibilities—people must be assigned
• defined outcomes—each task must have an output
• defined milestones—review for quality
Effo rt
4 4
Ea = m ( t d /t a )
Eo
Empirical Relationship: P vs E
Given Putnam‘s Software Equation (5-3),
E = L3 / (P3t4)
Software Engineering
Consider a pro ject est imated at 33 KLOC, 12 person- years of effort, with a P of 10K, the
completion time would be 1.3 years
If deadline can be extended to 1.75 years,
E = L3 / (P3t4) ≈ 3.8 p-years vs 12 p-years
Timeline Charts
Effort Allocation
• ―front endǁ activities
• customer communication
• analysis
• design
• review and modification
• construction activities
• coding or code generation
• testing and installation
• unit, integration
• white-box, black box
• regression
• Actual cost of work performed, ACWP, is the sum of the effort actually expended on work
tasks that have been completed by a po int in time on the project schedule. It is then possible
to compute
Cost performance index, CPI = BCWP/ACWP
Cost variance, CV = BCWP – ACWP
Problem
• Assume you are a software project manager and that you‘ve been asked to computer earned
value statistics for a small software project. The project has 56 planned work tasks that are
estimated to require 582 person-da ys to complete. At the time that you‘ve been asked to do
the earned value analysis, 12 tasks have been completed. However, the project schedu le
indicates that 15 tasks should have been completed. The following scheduling data (in
person-days) are available:
• T ask Planned Effort Actual Effort
• 1 12 12.5
• 2 15 11
• 3 13 17
• 4 8 9.5
• 5 9.5 9.0
• 6 18 19
• 7 10 10
• 8 4 4.5
• 9 1 2 1 0
• 10 6 6.5
• 11 5 4
• 12 14 14.5
• 13 16
• 14 6
• 15 8
Error Tracking
• Schedule Tracking
• conduct periodic project status meetings in which each team member reports progress
and problems.
• evaluate the results of all reviews conducted throughout the software engineering
process.
• determine whether formal project milestones (diamo nds in previous slide) have been
accomplished by the scheduled date.
• compare actual start-date to planned start-date for each project task listed in the
resource table
• meet informally with practitioners to obtain their subjective assessment of progress to
date and problems on the horizon.
• use earned value analysis to assess progress quantitatively.
• Progress on an OO Project-I
Software Engineering
Elements of SCM
• Component element
- Tools coupled with file management
• Process element
-Procedures define change management
• Construction element
-Automate construction of software
• Human elements
-Give guidance for activities and process features
Baselines
• A work product becomes a baseline only after it is reviewed and approved.
• Before baseline – changes informal
• Once a baseline is established each change request must be evaluated and verified before it is
processed.
Software Engineering
Importance of evolution
• Organizations have huge invest ments in their software s ystems - they are crit ical business
assets.
• To maintain the value of these assets to the business, they must be changed and updated.
• The majority of the software budget in large co mpanies is devoted to evo lving exist ing
software rather than developing new software.
Software Engineering
Software change
• Software change is inevitable
• New requirements emerge when the software is used;
• The business environment changes;
• Errors must be repaired;
• New computers and equipment is added to the system;
• The performance or reliability of the system may have to be improved.
• A key problem for organisations is implement ing and managing change to their exist ing
software systems.
Lehman’s laws
Law Description
Continuing change A program that is used in a real-world environment
necessarily must change or beco me progressively less
useful in that environment.
Increasing complexity As an evo lving program changes, its structure tends to
become more complex. Extra resources must be devoted to
preserving and simplifying the structure.
Large program Program evo lution is a self-regulat ing process. System
evolution attributes such as size, t ime between releases and the
number of reported errors is approximately invariant for
each system release.
Organisational stability Over a program‘s lifetime, its rate of development is
approximately constant and independent of the resources
devoted to system development.
Conservation of Over the lifetime of a system, the incremental change in
familiarity each release is approximately constant.
Continuing growth The functionality offered by systems has to continuall y
increase to maintain user satisfaction.
Declining quality The quality of systems will appear to be declining unless
they are adapted to changes in their operational
environment.
Feedback system Evolution processes incorporate multi-agent, multi-loop
feedback systems and you have to treat them as feedback
systems to achieve significant product improvement.
• Small organisations;
• Medium sized systems.
Software maintenance
• Modifying a program after it has been put into use or delivered.
• Maintenance does not normally involve major changes to the system‘s architecture.
• Changes are implemented by modifying existing components and adding new components to
the system.
• Maintenance is inevitable
• The system requirements are likely to change while the system is being developed because
the environment is changing. Therefore a delivered system won't meet its requirements!
• Systems are tightly coupled with their environment. When a system is installed in an
environment it changes that environment and therefore changes the system requirements.
• Systems MUST be maintained therefore if they
are to remain useful in an environment.
Types of maintenance
• Maintenance to repair software faults
• Code ,design and requirement errors
• Code & design cheap. Requirements most expensive.
• Maintenance to adapt software to a different operating environment
• Changing a system‘s hardware and other support so that it operates in a different
environment (computer, OS, etc.) from its initial implementation.
• Maintenance to add to or modify the system‘s functionality
• Modifying the system to satisfy new requirements for org or business change.
Maintenance costs
• Usually greater than development costs (2* to 100* depending on the application).
Software Engineering
Development/maintenance costs
Maintenance prediction
• Maintenance prediction is concerned with assessing which parts of the system may cause
problems and have high maintenance costs
• Change acceptance depends on the maintainabilit y of the components affected by
the change;
• Implementing changes degrades the system structure and reduces its
maintainability;
• Maintenance costs depend on the number of changes and costs of change depend
on maintainability.
Change prediction
• Predicting the number of changes requires and understanding of the relationships between a
system and its environment.
• Tightly coupled systems require changes whenever the environment is changed.
Software Engineering
Complexity metrics
• Predictions of maintainability can be made by assessing the complexity of system
components.
• Studies have shown that most maintenance effort is spent on a relat ively small number o f
system components of complex system.
• Reduce maintenance cost – replace complex components with simple alternatives.
• Complexity depends on
• Complexity of control structures;
• Complexity of data structures;
• Object, method (procedure) and module size.
Process metrics
• Process measurements may be used to assess maintainability
• Number of requests for corrective maintenance;
• Average time required for impact analysis;
• Average time taken to implement a change request;
• Number of outstanding change requests.
• If any or all of these is increasing, this may indicate a decline in maintainability.
• COCOMO2 model maintenance = understand existing code + develop new code.
Project management
Objectives
• To explain the main tasks undertaken by project managers
• To introduce software project management and to describe its distinctive characteristics
• To discuss project planning and the planning process
Software Engineering
Project planning
• Probably the most time-consuming project management activity.
• Continuous activity from initial concept through to system delivery. Plans must be
regularly revised as new information becomes available.
• Various different t ypes of plan may be developed to support the main software project
plan that is concerned with schedule and budget.
Plan Description
Quality plan Describes the quality procedures and standards that
will be used in a project.
Validation plan Describes the approach, resources and schedule used
for system validation.
Configuration management Describes the configuration management procedures
Plan and structures to be used.
Maintenance plan Predicts the maintenance requirements of the system,
maintenance costs and effort required.
Development plan. Describes how the skills and experience of the project
team members will be developed.
project plan
The project plan sets out:
• resources available to the project
• work breakdown
• schedule for the work.
Project scheduling
• Split project into tasks and estimate time and resources required to complete each task.
• Organize tasks concurrently to make optimal
use of workforce.
• Minimize task dependencies to avoid delays
caused by one task waiting for another to complete.
• Dependent on project managers intuition and experience.
Software Engineering
Scheduling problems
• Estimating the difficulty of problems and hence the cost of developing a solution is hard.
• Productivity is not proportional to the number of people working on a task.
• Adding people to a late project makes it later because of communication overheads.
• The unexpected always happens. Always allow contingency in planning.
Activity network
1 4/7 /03 15 da y s
15 da y s
M1 T3
8 da ys
T9
T1 5 da y s 4/8/03 2 5/8/03
2 5/7 /03
4/7 /03 T6 M4 M6
M3
star t 2 0 da y s 7 da y s
15 da y s
T7 T11
T2
25/7 /03 11/8/03 5/9/03
10 da y s 10 da y s
M2 M7 M8
T4 T5 15 da y s
T10 10da ys
1 8/7 /03
T12
M5
2 5 da y s
T8 Finish
19/9/03
Activity timeline
4/7 11/7 18/7 2 5 /7 1/8 8/8 1 5 /8 22/8 2 9/8 5/9 12/9 1 9/9
Sta r t
T4
T1
T2
M1
T7
T3
M5
T8
M3
M2
T6
T5
M4
T9
M7
T10
M6
T11
M8
T12
Finish
Software Engineering
Staff allocation
4/7 1 1/7 18/7 2 5/7 1/8 8/8 15/8 2 2/8 2 9/8 5/9 1 2/9 19/9
Fred T4
T8 T11
T12
Ja ne T1
T3
T9
A nne T2
T6 T10
Jim T7
Ma ry T5
Risk management
• Risk management - identifying risks and drawing up plans to minimise their effect on a
project.
• A risk is a probability that some adverse circumstance will occur
• Project risks : affect schedule or resources. eg: loss of experienced designer.
• Product risks: affect the quality or performance of the software being developed.
eg: failure of purchased component.
• Business risks : affect organisation developing software. Eg: competitor
introducing new product.
Software risks
Risk identification
• Discovering possible risk
• Technology risks.
• People risks.
• Organisational risks.
• Tool risk.
• Requirements risks.
• Estimation risks.
Requirements Changes to requirements that require major design rework are proposed.
Customers fail to understand the impact of requirements changes.
Estimation The time required to develop the software is underestimated.
The rate of defect repair is underestimated.
The size of the software is underestimated.
Risk analysis
• Make judgement about probability and seriousness of each identified risk.
• Made by experienced project managers
• Probability may be very low(<10%), low(10-25%), moderate(25-50%), high(50-75%) or
very high(>75%). not precise value. Only range.
• Risk effects might be catastrophic, serious, tolerable or insignificant.
Risk planning
• Consider each identified risk and develop a strategy to manage that risk.
• categories
Software Engineering
• Avoidance strategies
• The probability that the risk will arise is reduced;
• Minimisation strategies
• The impact of the risk on the project will be reduced;
• Contingency plans
• If the risk arises, contingency plans are plans to deal with that risk. eg: financial
problems
Risk monitoring
• Assess each identified risks regularly to decide whether or not it is becoming less or more
probable.
• Also assess whether the effects of the risk have changed.
• Cannot be observed directly. Factors affecting will give clues.
• Each key risk should be discussed at management progress meetings & review.
Risk indicators
By
Asst. Prof. Mrs. Mrs Etuari Oram
Asst. Prof. Mr Sanjib Kumar Nayak
Asst. Prof. Mr Bighnaraj Naik
SYLLABUS
Module I (10 Lectures)
Design and Analysis: Cohesion and coupling, Data flow oriented Design: Transform centered
design, Transaction centered design. Analysis of specific systems likes Inventory control,
Reservation system.
Module II (10 Lectures)
Object-oriented Design: Object modeling using UML, use case diagram, class diagram,
interaction diagrams: activity diagram, unified development process.
Software quality: SEI CMM and ISO-9001. Software reliability and fault-tolerance, software
project planning, monitoring, and control. Computer-aided software engineering (CASE),
Component model of software development, Software reuse.
Book:
Contents
Module: I
Lecture 1: Introduction to Software Engineering
2 *Under revision
processes.
fall Model.
Complex Logic.
Module II
Module III
Module IV
MODULE-I
Lecture Note: 1
Software:
3 *Under revision
can be engineer or developed and second thing is software is complex in nature.
Important of software are due to much reason as it is used in:
i)Business decision making
Ex- accounting s/w, billing s/w
ii)For scientific research & engineering problem solving.
Ex-weather forecasting system, space research s/w
Software Quality
Types of software:-
Computer s/w is mainly divided into two types.
a)system s/w
Application s/w consists of programs to perform user oriented tasks. System s/w
includes the operating system & all the utilities to enable the computer to run. Ex-
window operating system
b)application s/w
4 *Under revision
Application s/w consists of programs to perform user oriented tasks. Ex-word processor,
database management. Application s/w sits about the system s/w because it needs help of the
system s/w to run.
PROGRAMS PRODUCTS
Set of instruction related each other Collection of program designed for specific
task.
Programs are defined by individuals for A sum product is usually developed by a
their personal use. group of engineers working as a team.
Usually small size. Usually large size.
Single user. Large no of users.
Single developer. Team of developer.
Lack proper documentation. Good documentation support.
ADHOC development. Systematic development.
Lack of UI. Good UI.
Have limited functionality. Exhibit more functionality.
programs
Source
Object
code
code documenta
Operating tion
procedure
5 *Under revision
-Customized (or bespoke) products: This type of software products are
developed by a software contractor and especially for a customer.
Software Engineering
1. General Skill (Analytical skill, Problem solving skill, Group work skill)
2. Programming Skill (Programming language , Data structure , Algorithm , Tools(
Compiler, Debugger))
3. Communication skill (Verbal , Written, Presentation)
4. Design Skill (s/w engineer must be familiar with several application domain)
Lecture Note : 2
6 *Under revision
1. People who are developing software were consistently wrong in their estimation
of time, effort and cost.
2. Reliability and maintainability was difficult of achieved
3. Fixing bug in a delivered software was difficult
4. Delivered software frequently didn’t work
5. Changes in ration of hw to s/w cost
6. Increased cost of software maintenance
7. Increased demand of software
8. Increased demand for large and more complex software system
9. Increasing size of software
Software engineering methods provide the technical how-to's for building software. That
encompass requirements analysis, design, program construction, testing, and support.
7 *Under revision
Software engineering methods rely on a set of basic principles that govern each area of
the technology and include modeling activities and other descriptive techniques.
S/W CHARACTERISICS:-
Characteristics of a s/w can be easily distinguished as of from the h/w.
8 *Under revision
The change of failure rate over the product lifetime for a typical hardware and a
software product are sketched in above fig.
For hardware products, it can be observed that failure rate is initially high but
decreases as the faulty components are identified and removed. The system then enters
its useful life.
After some time (called product life time) the components wear out, and the failure rate
increases. This gives the plot of hardware reliability over time its characteristics is like
“bath tub” shape.
On the other hand, for software the failure rate is at its highest during integration and
test. As the system is tested, more and more errors are identified and removed resulting
in reduced failure rate. This error removal continues at a slower pace during the useful
life of the product. As the software becomes obsolete no error corrections occurs and the
failure rate remains unchanged.
Therefore after analyzing the facts we can write the key characteristics as follows:-
a)Most s/w s are custom built rather than assembled from existing
components.
b)s/w is developed or engineered not manufactured.
c)s/w is flexible.
d)s/w does not wear out.
9 *Under revision
Lecture Note : 3
Organizations are spending larger and larger portions of their budget on software not
only are the software products turning out to be more expensive than hardware, but
also presented lotst of other problems to the customers such as: software products are
difficult to alter, debug, and enhance; use resources non optimally; often fail to meet the
user requirements; are far from being reliable; frequently crash; and are often delivered
late.
Due to ineffective development of the product characterized by inefficient resource
usage and time and cost over-runs.
Other factors are larger problem sizes, lack of adequate training in software
engineering, increasing skill shortage, and low productivity Improvements.
10 *Under revision
S/W crisis from programmer point of view:-
i)Problem of compatibility.
ii)Problem of Portability.
iii)Proclaiming documentation.
iv)Problem of pirated s/w.
v)Problem in co-ordination of work of different people.
vi)Problem of proper maintenance.
S/W Application:-
Process: The process is a series of states that involves activities, constraints, resources
that produce an intended output of some kind. Or it is a state that takes some input and
produced output
Software process: A s/w process is a related set of activities & sub processes that are
involved in developing & involving a s/w system. There are four fundamental process
activities carried out by s/w engineering while executing the s/w process are .
i) s/w specification
The functionality of s/w & constraints on its operation must be defined.
ii)s/w development
11 *Under revision
The s/w that mixes the specification must be produced.
iii)s/w validation
The s/w must be validated to ensure that it performs desired customer activities.
iv)s/w evolution:-
The s/w must evolve to meet changing customer needs with time.
The scenario of s/w process & its sub process are shown below:-
The s/w industry considers the entire s/w development task as a process according to
Booch & Rumbaugh. According to them a process defines who is doing what, when &
how to reach a certain goal.
Software Project:
1. A project is a temporary endeavor undertaken to create a unique product.
2. Temporary means every project has a definite beginning and a definite end.
3. Unique means the product must be different in some ways from all similar
product
12 *Under revision
Software Product:
Outcome of software project is known as software product.
13 *Under revision
Lecture Note : 4
Introduction:-
A software life cycle model (also called process model) is a descriptive and
diagrammatic representation of the software life cycle. A life cycle model represents all
the activities required to make a software product transit through its life cycle phases. It
also captures the order in which these activities are to be undertaken.
In other words, a life cycle model maps the different activities performed to develop
software product from its inception to retirement. Different life cycle models may map
the basic development activities to phases in different ways.
-A software life cycle model defines entry and exit criteria for every phase. A phase can start
only if its phase-entry criteria have been satisfied. So without software life cycle model the entry
and exit criteria for a phase cannot be recognized. Without software life cycle models (such as
classical waterfall model, iterative waterfall model, prototyping model, evolutionary model,
spiral model etc.) it becomes difficult for software project managers to monitor the progress of
the project.
Many life cycle models have been proposed so far. Each of them has some advantages
as well as some disadvantages. A few important and commonly used life cycle models
are as follows:
14 *Under revision
a. Classical Waterfall Model:
Different phases of the classic waterfall model:-
The classical waterfall model is intuitively the most obvious way to develop software. Though
the classical waterfall model is elegant and intuitively obvious, it is not a practical model in the
sense that it cannot be used in actual software development projects. Thus, this model can be
considered to be a theoretical way of developing software.
Classical waterfall model divides the life cycle into the following phases as shown in
fig.2.1:
-Feasibility Study
-Requirements Analysis and Specification
-Design
-Coding and Unit Testing
-Integration and System Testing
-Maintenance
15 *Under revision
Activities in each phase of the life cycle:
The main aim of feasibility study is to determine whether it would be financially and
technically feasible to develop the product. Rough understanding between the team
members about estimate based on the client side requirement. After over all discussion
they search for variety of solution on the basis of kind of resources and time
requirement etc.
The aim of the requirements analysis and specification phase is to understand the exact
requirements of the customer and to document them properly. This phase consists of
two distinct activities, namely
16 *Under revision
The goal of the requirements gathering activity is to collect all relevant information
from the customer regarding the product to be developed. This is done to clearly
understand the customer requirements so that incompleteness and inconsistencies are
removed.
-After all ambiguities, inconsistencies, and incompleteness have been resolved and all
the requirements properly understood, the requirements specification activity can start.
-During this activity, the user requirements are systematically organized into a
Software Requirements Specification (SRS) document.
The goal of the design phase is to transform the requirements specified in the SRS
document into a structure that is suitable for implementation in some programming
language. During the design phase the software architecture is derived from the SRS
document. Two distinctly different approaches are available:
-the traditional design approach and
- the object-oriented design approach.
The purpose of the coding and unit testing phase (sometimes called the
implementation phase) of software development is to translate the software design into
source code. Each component of the design is implemented as a program module. The
end-product of this phase is a set of program modules that have been individually
tested then proceeds for next stage. During this phase, each module is unit tested to
determine the correct working of all the individual modules. It involves testing each
module in isolation way as this is the most efficient way to debug the errors identified
at this stage.
Integration of different modules is undertaken once they have been coded and unit
tested. During the integration and system testing phase, the modules are integrated in a
planned manner. Integration is normally carried out incrementally over a number of
steps. During each integration step, the partially integrated system is tested and a set of
previously planned modules are added to it. Finally, when all the modules have been
successfully integrated and tested, system testing is carried out. The goal of system
testing is to ensure that the developed system conforms to its requirements laid out in
the SRS document. System testing usually consists of three different kinds of testing
activities:
17 *Under revision
acceptance testing: It is the system testing performed by the customer himself after
the product delivery to decide whether to accept or reject the delivered product.
Maintenance of a typical software product requires much more effort than the effort
necessary to develop the product itself. Maintenance involves performing any one or
more of the
following three kinds of activities:
-Correcting errors that were not discovered during the product development phase.
This is
called corrective maintenance.
- Improving the implementation of the system, and enhancing the functionalities of the
system according to the customer’s requirements. It is called perfective maintenance.
- Porting the software to work in a new environment. For example, porting may be
required to get the software to work on a new computer platform or with a new
operating system. It is called adaptive maintenance.
i)It can not handle satisfactorily different types of risks associated with real time s/w
project, because, the requirements have to be pre decided by the client.
ii)Most real life project can’t follow the exact frame sequence of the waterfall model.
18 *Under revision
Lecture Note : 5
This waterfall model allows us to correct the error committed during the
developmental phase.
The principle of detecting errors as close to their point of introduction as possible is
known as phase containment of errors. These errors are not possible to be always
detected at their point of occurrence. But, they must be detected as they are possible,
because finding the errors at higher stage causes entire system testing hence cost is
increased/high.
Development
Requirements Gathering
Maintenance
Initial design
Design
Implementation
Testing
Maintainance
This model specify that before the actual system is being built the working model or the
prototype system should be built in. Prototype means dummy, it is a modern and
advance implementation system with limited functional capabilities & is comparatively
inefficient with the actual system.
There are several uses of a prototype. An important purpose is to illustrate the input
data formats, messages, reports, and the interactive dialogues to the customer. This is a
valuable mechanism for gaining better understanding of the customer’s needs. The
possibilities may be:
• how the screens might look like
• how the user interface would behave
• how the system would produce outputs
20 *Under revision
technical issues associated with the product development. Often, major design
decisions depend on issues like the response time of a hardware controller, or the
efficiency of a sorting algorithm, etc. In such circumstances, a prototype may be the best
or the only way to resolve the technical issues.
ADVANTAGES:-
i)The prototype which is developed is generally discarded after the system is being built
but the experience gain during the development of prototype helps the design issue as
expected from the customer.
ii)Developing a prototype in place of actual system & putting it for customer reference
resolves different technical & design issue as expected from the customer.
C
B
A B
A
A
21 *Under revision
This life cycle model can be defined as follows:
Maintenance
ADVANTAGES:-
ii)It is also reduces the maintenance tasks duration because before delivery of a module,
the customers are consulted.
iii)As the individual module takes place, so final product will contain limited amount of
errors.
iii)It can be built upon object oriented platform which promotes modular s/w
development.
DISADVANTAGES:-
i)It is only helpful for large s/w products because we can find individual modules for
incremental implementation.
ii)It is also used when the customer is ready to receive the product.
22 *Under revision
e. SPIRAL MODEL/RISK MANAGEMENT MODEL:-
RA
Rapid prototype RA
RA Changed requirements
Specification
RA
Design
RA
Implementation
RA
Retirement
[ RA-Risk analysis ]
------------>maintenance
Development
This model contains the elements from all the other life cycle model along with the
necessary risks involves in each of the developmental phase. So it is called as meta
model.
The Spiral model of software development is shown in below fig. 2.2. The
diagrammatic representation of this model appears like a spiral with many loops. The
exact number of loops in the spiral is not fixed. Each loop of the spiral represents a
phase of the software process. For example, the innermost loop might be concerned
with feasibility study. The next loop with be requirements specification, the next one
with design, and so on. Each phase in this model is split into four sectors (or quadrants)
23 *Under revision
as shown in fig. The activities are carried out during each phase of a spiral model are
described below.
The radial dimension of the full spiral model provided by Bohem in 1988 to represent
the cumulating cost along with the triangular dimension.
• Develop and validate the next level of the product after resolving the identified
risks.
• Review the results achieved so far with the customer and plan the next iteration
24 *Under revision
around the spiral.
• Progressively more complete version of the software gets built with each iteration
around the spiral.
The classical waterfall model can be considered as the basic model and all other life
cycle models as embellishments of this model. However, the classical waterfall model
cannot be used in practical development projects, since this model supports no
mechanism to handle the errors committed during any of the phases. This problem may
be overcome in the iterative waterfall model. The iterative waterfall model is probably
the most widely used software development model evolved so far. This model is simple
to understand and use. However, this model is suitable only for well-understood
problems; it is not suitable for very large projects and for projects that are subject to
many risks.
The prototyping model is suitable for projects for which either the user requirements or
the underlying technical aspects are not well understood. It is especially popular for
development of the user-interface part of the projects.
The evolutionary approach is suitable for large problems which can be decomposed
into a set of different modules for incremental development and delivery of the
product. This model is also widely used for object-oriented development projects. Of
course, this model can only be used if the incremental delivery of the system is
acceptable to the customer.
The spiral model is called a meta model since it encompasses all other life cycle models.
Risk handling is inherently built into this model. The spiral model is suitable for
development of technically challenging software products that are prone to several
kinds of risks. However, this model is much more complex than the other models
25 *Under revision
Lecture Note : 6
The aim of the requirements analysis and specification phase is to understand the exact
requirements of the customer and to document them properly. This phase consists of
two distinct activities, namely
- Requirements gathering and analysis, and
- Requirements specification
The goal of the requirements gathering activity is to collect all relevant information
from the customer regarding the product to be developed and analyzed.
This phase is done to clearly understand the customer requirements so that
incompleteness and inconsistencies are removed. This activity begins by collecting all
relevant data regarding the product to be developed from the user and from the
customer through interviews and discussions.
b) Requirements specification:-
After all ambiguities, inconsistencies, and incompleteness have been resolved and all
the requirements properly understood, the requirements specification activity can start.
During this activity, the user requirements are systematically organized into a Software
Requirements Specification (SRS) document.
The customer requirements identified during the requirements gathering and analysis
activity are organized into a SRS document.
The important components of this document are:
-functional requirements of the system
-nonfunctional requirements of the system
-goal of implementation.
Functional requirements:-
26 *Under revision
The functional requirements part discusses the functionalities required from the
system. The system is considered to perform a set of high level functions {fi}. The
functional view of the system is shown in fig.3.1. Each function fi of the system can be
considered as a transformation of a set of input data (ii) to the corresponding set of
output data (oi). The user can get some meaningful piece of work done using a high-
level function.
Nonfunctional requirements:-
Nonfunctional requirements deal with the characteristics of the system which cannot
be expressed as functions - such as the maintainability of the system, portability of the
system, usability of the system, etc. It may include:
# reliability issues,
# accuracy of results,
# human - computer interface issues,
# constraints on the system implementation, etc.
Goals of implementation:-
27 *Under revision
Properties of a good SRS document
• Some of the important properties of a good SRS document are the following:
a)Concise:
The SRS document should be concise and at the same time unambiguous,
consistent, and complete. Verbose and irrelevant descriptions reduce readability
and also increase error possibilities.
b)Structured:
It should be well-structured. A well-structured document is easy to
understand and modify. In practice, the SRS document undergoes several revisions
to cope up with the customer requirements. Often, the customer requirements evolve
over a period of time. Therefore, in order to make the modifications to the SRS
document easy, it is important to make the document well-structured.
c)Black-box view:
It should only specify what the system should do and refrain from
stating how to do these. This means that the SRS document should specify the
external behavior of the system and not discuss the implementation issues. The SRS
document should view the system to be developed as black box, and should specify
the externally visible behavior of the system. For this reason, the SRS document is
also called the black-box specification of a system.
d)Conceptual integrity:
It should show conceptual integrity so that the reader can easily understand it.
f)Verifiable:
All requirements of the system as documented in the SRS document should be
verifiable. This means that it should be possible to determine whether or not
requirements have been met in an implementation.
28 *Under revision
developing is what exactly required by the customer.
-Without SRS document, it will be very much difficult for the maintenance engineers to
understand the functionality of the system.
-It would be very much difficult for user document writers to write the users’ manuals
properly without understanding the SRS document.
29 *Under revision
Lecture Note : 7
Good SRS documents sometimes may have the conditions which are complex & which
may have overlapping interactions & processing sequences. There are two main
techniques available to analyze & represent complex processes logic are.
A) Decision tree
B) Decision table
After these two techniques are finalizing the decision making logic is captured in form
of tree or table. We can automatically find out the test cases to validate the decision
from the decision making logic. These two techniques are widely used in applications of
information theory & switching theory.
Decision tree:
A decision tree gives a graphic view of the processing logic involved in decision
making and the corresponding actions taken. The edges of a decision tree represent
conditions and the leaf nodes represent the actions to be performed depending on the
outcome of testing the condition.
Example: -
Consider Library Membership Automation Software (LMS) where it should support the
following three options:
-New member to join
-Renewal books
-Cancel membership
-New member option-
Decision:
When the 'new member' option is selected, the software asks details about the
member like the member's name, address, phone number, id etc.
Action: If proper information is entered then a membership record for the member is
created and a bill is printed for the annual membership charge plus the security deposit
payable.
Renewal option-
Decision: If the 'renewal' option is chosen, the LMS asks for the member's name and
membership number to check whether he is a valid member or not.
30 *Under revision
Action: If the membership is valid then membership expiry date is updated and the
annual membership bill is printed, otherwise an error message is displayed.
31 *Under revision
Example: -
Consider the previously discussed LMS example. The following decision table (fig. 3.5)
shows how to represent the LMS problem in a tabular form. Here the table is divided
into two parts, the upper part shows the conditions and the lower part shows what
actions are taken. Each column of the table is a rule.
From the above table we can easily understand that, if the valid selection condition is
false then the action taken for this condition is 'display error message'. Similarly, the
actions taken for other conditions can be inferred from the table.
(a)Over specification:-
Over specification occurs when the SRS document includes how to issue. Ex:- In
case of library automation system we must not record the fact whether the
membership records are sorted in descending order by considering members first
name.
b) Forward Reference:-
This aspect specifies that, we must not include details of the requirements in the
initial stage which will be discussed later in the SRS documents. For example in case of
faster processing, the books may be kept separately by indexing with respect to their
ISBN(International standard book number). These details are irrelevant in the initial
stages 1 & 2 etc.
32 *Under revision
(c)Whish-full Thinking:-
This aspect specifies that requirements those will be difficult to implement need
not be describe/mention in the SRS.
(d)Noise:-
Noise means irrelevant materials associated to software development which might
rarely or not used at all.
Axiomatic specification
In axiomatic specification of a system, first-order logic is used to write the pre and post-
conditions to specify the operations of the system in the form of axioms.
The pre-conditions basically capture the conditions that must be satisfied before an
operation. In essence, the pre-conditions capture the requirements on the input
parameters of a function. The post-conditions are the conditions that must be satisfied
when a function completes execution. Thus, the post conditions are essentially
constraints on the results produced for the function execution to be considered
successful.
The following are the sequence of steps that can be followed to systematically develop
the axiomatic specifications of a function:
• It establishes the range of input values over which the function should behave
correctly. And also it finds out other constraints on the input parameters and writes it in
the form of a predicate.
• It specifies a predicate defining the conditions which must hold on the output of the
function.
33 *Under revision
• It establishs the changes made to the function’s input parameters after execution of
the function. Pure mathematical functions do not change their input and therefore this
type of assertion is not necessary for pure functions.
•Now on combining all of the above into pre and post conditions of the function as in
below example
Example1: -
Specify the pre- and post-conditions of a function that takes a real number as argument
and returns half the input value if the input is less than or equal to 100, or else returns
double the value.
f (x : real) : real
pre: x ∈ R
post: {(x≤100) ∈ (f(x) = x/2)} ∈ {(x>100) ∈ (f(x) = 2∈x)}
Algebraic specification
Types section:-
In this section, the sorts (or the data types) being used is specified.
Exceptions section:-
This section gives the names of the exceptional conditions that might occur when
different operations are carried out. These exception conditions are used in the later
sections of an algebraic specification.
For example, in a queue, possible exceptions are no value (empty queue),
underflow (removal from an empty queue), overflow etc.
34 *Under revision
Syntax section:-
This section defines the signatures of the interface procedures. The collection of sets that
form input domain of an operator and the sort where the output is produced are called
the signature of the operator.
For example, the append operation takes a queue and an element and returns
a new queue. It is represented as:
append: queue x element → queue
Equations section:-
This section gives a set of rewrite rules (or equations) defining the meaning of
the interface procedures in terms of each other. In general, this section is allowed to
contain conditional expressions.
For example, a rewrite rule to identify an empty queue may be written as:
isempty(create()) = true
Example:-
Let us specify a FIFO queue supporting the operations create, append, remove, first, and
isempty where the operations have their usual meaning.
Types:
defines queue uses boolean, integer
Exceptions:
underflow, no value
Syntax:
1. create : φ → queue
2. append : queue x element → queue
3. remove : queue → queue + {underflow}
4. first : queue → element + {no value}
5. isempty : queue → Boolean
Equations:
1. isempty(create()) = true
2. isempty((append(q,e)) = false
3. first(create()) = no value
4. first(append(q,e)) = is isempty(q) then e else first(q)
5. remove(create()) = underflow
6. remove(append(q,e)) = if isempty(q) then create() else
append(remove(q),e)
35 *Under revision
In this example, there are two basic constructors (create and append), one extra
construction operator (remove) and two basic inspectors (first and empty). Therefore,
there are 2 x (1+2) + 0 = 6 equations.
Example:-
Let us specify a data type point supporting the operations create, xcoord, ycoord,
isequal; where the operations have their usual meaning.
Types:
defines point, uses boolean, integer
Syntax:
1. create : integer × integer → point
2. xcoord : point → integer
3. ycoord : point → integer
4. isequal : point × point → Boolean
Equations:
1. xcoord(create(x, y)) = x
2. ycoord(create(x, y)) = y
3. isequal(create(x1, y1), create(x2, y2)) = ((x1 = x2) and (y1 = y2))
In this example, there is only one basic constructor (create), and three basic inspectors
(xcoord, ycoord, and isequal). Therefore, there are only 3 equations.
36 *Under revision
2.6 user environments
2.7 assumptions & dependencies
2.8 apportioning of requirements
3. SPECIFIC REQUIREMENTS
4. SUPPORTING INFORMATION
4.1 table of content & index
4.2 appendixes
37 *Under revision
Lecture Note : 8
Cohesion
When function of one module cooperates with another to perform single objective
then module is said to be good cohesion. The primary characteristics of neat module
decomposition are high cohesion and low coupling. Cohesion is a measure of functional
strength of a module. A module having high cohesion and low coupling is said to be
functionally independent of other modules. By the term functional independence, we
mean that a cohesive module performs a single task or function. A functionally
independent module has minimal interaction with other modules. High cohesion has
features of reliability, robustness and reusability where as low cohesion has difficult to
test, reuse even difficult to understand and maintenance.
Classification of cohesion
The different classes of cohesion that a module may possess are described as follows
from lower cohesion to higher where coincidental cohesion worst type and functional is
best type.
Low High
38 *Under revision
even if they are different by nature (e.g grouping all mouse and keyboards input
handling routines).
Temporal cohesion: When a module contains functions that are related with each other
and all the functions must be executed in the same time span, then module is said to
exhibit temporal cohesion. For example when computer booted several functions need
to be performed at the same time one by one such as initialization of memory, devices,
loading OS etc. and The set of functions in a single module responsible for initialization,
start-up, shutdown of some process, etc. exhibit temporal cohesion.
Another example in an online store system when customer request for some item
then functions involved are follow as sequence of: create-order(), check-avail() and then
order ().
39 *Under revision
a module containing all the functions required to manage employees’ pay-roll exhibits
functional cohesion such as compute-overtime(), compute-workhr(), compute-
deduction() etc . It is considered one of the most superior cohesion in the module but in
certain cases not achievable and instead communicational cohesion overcome the
solution.
Coupling
Coupling between two modules/classes/components is a measure of the degree of
interdependence or interaction between the two modules or mutual interdependence
between modules. A module having high cohesion and low coupling is said to be
functionally independent of other modules.
Classification of Coupling
Classification of the different types of coupling will help to quantitatively estimate the
degree of coupling between two modules. Five types of coupling can occur between any
two modules. These are shown below according to flow of lower coupling to higher,
indicated by an arrow.
Low High
Data coupling: Two modules are data coupled, if they communicate by using an
elementary data item e.g. an integer, a float, a character, etc such as passing any float
value through function that computes square root. This data item should be problem
related and not used for the control purpose.
Stamp coupling: Two modules are stamp coupled, if they communicate using a
composite data item such as a record in PASCAL or a structure in C and used part of
these data.
Control coupling: Control coupling exists between two modules, if data from one
module is used in another module to direct the order of instructions execution. An
example of control coupling is a flag set in one module and tested in another module.
40 *Under revision
Common coupling: Two modules are common coupled, if they share data through
some global data items. It is also known as global coupling. Example, sharing global
variable. Changing global variable leads changes in all modules.
High coupling among modules makes design solution difficult to understand and
maintenance, increase development effort, harder to reuse and test particular module,
assembling of module may required more effort, change in one module usually leads a
ripple effect and difficult to develop modules in independent way, these are the
disadvantages. High cohesion is contrasted with high coupling and somehow it
correlates with loose coupling and vice versa.
41 *Under revision
Lecture Note : 9
In the late 1970s Data flow oriented design was developed. Experienced programmers
stated that to have a good program structure, one has to study how the data flows from
input to the output of the program. Every program reads data and then processes that
data to produce some output. Once the data flow structure is identified, then from there
one can derive the program structure.
Object-oriented design (1980s) is the latest and very widely used technique. Design
approach in which natural objects (such as employees, pay-roll register, etc.) occurring
in a problem are first identified. Relationships among objects (such as composition,
reference and inheritance) are determined. Each object essentially acts as a data hiding
entity.
42 *Under revision
MAIN
A B C
Here on activated, the main module carries out the entire task of the system by calling
upon its subordinate modules. A is the input controller module when it activated, will
enable the subordinate afferent modules to send the input data streams to flow towards
the main module. C is the output controller module which, when activated, will
likewise enable its subordinate modules to receive output data streams from the main
module and output them as desired. B is the transform flow controller which, when
activated, will receive the input streams from the main module, pass them down to its
subordinate modules, receive their output data streams, and pass them up to the main
module for subsequent processing and outputting by the efferent modules.
4. The high-level structure chart is now factored again (the second level factoring) to
obtain the first-cut design. The second-level factoring is done by mapping individual
transforms (bubbles) in the data flow diagram into appropriate modules within the
program structure. A rule that is helpful during the second-level factoring process is to
ensure that, the processes appearing in the afferent flow in the data flow diagram form
themselves into modules that form the lowest-level in the structure chart and sending
data upwards to the main module. The processes appearing in the efferent flow in the
data flow diagram form themselves into modules that also appear at the lowest-level of
the structure chart and receive data from the main module downwards. Figure 13.16
shows the first-cut design.
43 *Under revision
The first-cut design is important as it helps the designer to write a brief processing
narrative that forms the first-generation design specification. The specification should
include
(a) The data in and out of every module (the interface design),
(b) The data stored in the module (the local data structure),
(c) A procedural narrative (major tasks and decisions), and
(d) Special restrictions and features.
5. The first-cut design is now refined by using design heuristics for improved software
quality. The design heuristics are the following:
(a) Apply the concepts of module independence that is, the modules should be
designed so as to be highly cohesive and loosely coupled.
(b) Minimize high fan-out, and strive for fan-in as depth increases, so that the
overall shape of the structure chart is dome-like.
(c) Avoid pathological connections by avoiding flow of control and by having
only single-entry, single-exit modules.
(d) Keep scope of effect of a module within the scope of control of that module.
We take a hypothetical data flow diagram (Figure 13.17) to illustrate the transform
analysis strategy for program design. It is a data flow diagram with elementary
functions. It contains 11 processes, two data stores, and 21 data flows. The two vertical
lines divide the data flow diagram into three parts, the afferent part, the central
transform, and the efferent part.
Figure 13.18 is the structure chart showing the first-level structuring of the data flow
diagram. Here module A represents the functions to be done by processes P1 through
44 *Under revision
P4. Module B does the functions P5 through P7, and module C does the functions P8
though P9.
We now carry out a second-order factoring and define subordinate modules for A, B,
and C. To do this, we look at the functions of various processes of the data flow
diagram which each of these modules is supposed to carry out.
Notice: in the above figure flow of data from and to the modules, the data flows are
consistent with the data flow diagrams also that we have chosen the bottom-level
modules in such a way that they have either functional or sequential or
communicational cohesion. The module P1+ P2 + P3 contains too many functional
components and perhaps can be broken down into its subordinate modules. A
modification of the first-cut design is given in Fig. 13.20 which may be accepted as the
final design of architecture of the problem depicted in the data flow diagram (Figure
13.17).
45 *Under revision
Lecture Note : 10
Transaction Analysis:
Transform analysis is the dominant approach in structured design; often special
structures of the data flow diagram can be utilized to adopt alternative approaches.
Transaction analysis is recommended in situations where a transform splits the input
data stream into several discrete output sub streams.
For example, a transaction may be a receipt of goods from a vendor or shipment of
goods to a customer. Thus once the type of transaction is identified, the series of actions
is fixed. The process in the data flow diagram that splits the input data into different
transactions is called the transaction center. In the below figure 13.20 gives a data flow
diagram in which the process P1 splits the input data streams into three different
transactions, each following its own series of actions. P1 is the transaction center here.
46 *Under revision
And an appropriate structure chart for a situation depicted in Fig. 13.21 is the one that
first identifies the type of transaction read and then invokes the appropriate
subordinate module to process the actions required for this type of transaction. Figure
13.22 is one such high-level structure chart.
47 *Under revision
Transaction analysis consists of five steps:
1. The problem specifications are examined and transaction sources are identified.
2. The data flow diagram (level 2 or level 3) is examined to locate the transaction
center that produces different types of transactions and locate and group various
functions for each type of transaction.
3. A high-level structure chart is created, where the top level is occupied by the
transaction center module that calls various transaction modules, each module for a
specific type of transaction.
4. The transaction modules are factored to build the complete structure chart.
5. Then ‘first-cut’ program structure refined using the design heuristics for improved
software quality. In practice, often a combination strategy is used. This strategy
combines the features of transform analysis and transaction analysis. For example,
when transform analysis alone cannot identify a reasonable central transform then,
transaction analysis is used to break the system (or program) into subsystems. Similarly,
during a transaction analysis, if defining the root module as at transaction center makes
it too complex, several transaction centers can be identified.
An inventory control system is required for a major supplier of auto parts. The analyst
finds that problems with the current manual system include
(1) Inability to obtain the status of a component rapidly
(2) two- or three-day turnaround to update a card file
(3) Multiple reorders to the same vendor
Because there is no way to associate vendors with components, and so forth.
Once problems have been identified, the analyst determines what information is to be
produced by the new system and what data will be provided to the system. For
instance, the customer desires a daily report that indicates what parts have been taken
from inventory and how many similar parts remain. The customer indicates that
inventory clerks will log the identification number of each part as it leaves the inventory
area.
Upon evaluating current problems and desired information (input and output),
the analyst begins to synthesize one or more solutions. To begin, the data objects,
processing functions, and behavior of the system are defined in detail. Once this
information has been established, basic architectures for implementation are
considered. A client/server approach would seem to be appropriate, but does the
software to support this architecture fall within the scope outlined in the Software Plan?
A database management system would seem to be required, but is the user/customer's
need for associatively justified? The process of evaluation and synthesis continues until
both analyst and customer feel confident that software can be adequately specified for
subsequent development steps.
48 *Under revision
Reservation system:
Reservation system used the concept of Reuse domain, consider the airline
reservation system, the reusable objects can be seats, flights, airports, crew, meal orders,
etc. The reusable operations can be scheduling a flight, reserving a seat, assigning crew
to flights, etc. The domain analysis generalizes the application domain. A domain
model transcends specific applications. The common characteristics or the similarities
between systems are generalized.
Similarly the reservation system also used the concept of host-slave, consider the
Railway-reservation system here the master at any time directs the slaves what to do. A
slave can only make requests and master takes over and tells what to do.
49 *Under revision
MODULE-II
Lecture Note: 11
Object Modeling using UML
Model:
A model is the graphical, textual, mathematical, or program code-based
representation. A model captures important aspect for some application while omitting
(or abstracting) the rest. Models are very useful in documenting the design and analysis
results.
50 *Under revision
• Shaler and Mellor methodology [Shaler 1992]
UML was adopted by Object Management Group (OMG) as a de facto standard in
1997. OMG is an association of industries which tries to facilitate early formation of
standards.
UML diagrams
UML can be used to construct several different types of diagrams to capture five
different views of a system. Just as a building can be modeled from several views (or
perspectives) such as ventilation perspective, electrical perspective, lighting
perspective, heating perspective, etc.
.
The UML diagrams can capture the following five views of a system:
• User’s view
• Structural view
• Behavioral view
• Implementation view
• Environmental view
User’s view:
This view defines the functionalities (facilities) made available by the system to its
users. The users’ view captures the external users’ view of the system in terms of the
functionalities offered by the system. The users’ view is a black-box view of the system
51 *Under revision
where the internal structure, the dynamic behavior of different system components, the
implementation etc. are not visible. It is very different from all other that it is a
functional model compared to the object model of all other views. The users’ view can
be considered as the central view and all others are expected to conform to this view.
Structural view:
The structural view defines the kinds of objects (classes) important to the
understanding of the working of a system and to its implementation. It also captures
the relationships among the classes (objects). The structural model is also called the
static model, since the structure of a system does not change with time.
Behavioral view:
The behavioral view captures how objects interact with each other to realize the
system behavior. The system behavior captures the time-dependent (dynamic) behavior
of the system.
Implementation view:
This view captures the important components of the system and their
dependencies.
Environmental view:
This view models how the different components are implemented on different
pieces of hardware platform
The use case model for any system consists of a set of “use cases”, users and
relationship among them within the system. Use case describes the action that user
takes on a system. Use case diagram model the process flow of a system. It is the way to
communicate with the user. Intuitively, use cases represent the different ways in which
a system can be used by the users. A simple way to find all the use cases of a system is
to ask the question: “What the users can do using the system?”. Four basic components
to construct use case diagram are:
a) System: Something that performs a function or system is a piece/multiple piece of
software that perform some function for its user.
b)actor: actor is something that uses our system. It is named based on their job title.
An actor can be a person or another external system like developer, student, clerk, teacher, officer
etc.
c)use cases: are the actions that a user takes on a system. According to above example
52 *Under revision
developer creates s/w, teacher record grade, officer create command etc.
d)relationship: connection between the actor to the use cases. Actor can relates to
multiple use cases and a use cases relate to multiple actors.
Thus for the Library Information System (LIS), the use cases could be:
• issue-book
• query-book
• return-book
• create-member
• add-book, etc
Similarly the use case model for the Supermarket Prize Scheme is shown in fig. 2. As
discussed earlier, the use cases correspond to the high level functional requirements.
From the problem description and the context diagram. In fig.2 we can identify three
use cases: “register-customer”, “register-sales”, and “select-winners”. As a sample, the
text description for the use case “register-customer” is shown below.
Text description
U1: register-customer: Using this use case, the customer can register
himself by providing the necessary details.
53 *Under revision
1. Customer: select register customer option.
2. System: display prompt to enter name, address,
and telephone number.
3. Customer: enter the necessary values.
4. System: display the generated id and the message
that the customer has been successfully
registered.
Generalization
Generalization is a technique that used to inherit an item in UML. It can be applied to
both actor and use cases to indicate that their child item inherit functionality from
parent. It can be used when one use case is similar to another. The child use case
inherits the behavior and meaning of the parent use case. But the base and the derived
use cases are separate use cases and should have separate text descriptions.
54 *Under revision
Fig. 3: Representation of use case generalization
Includes
The includes relationship in the older versions of UML (prior to UML 1.1) was known
as the use cases relationship. Include relationship indicate that use case will include
functionality from an additional use cases. The relationship involves one use case
including the behavior of another use case in its sequence of events and actions. The
includes relationship occurs when a chunk of behavior that is similar across a number
of use cases. Its advantage is to make helpful to decompose large and complex use cases
into more manageable part. It is pointed to represented as line and open arrow and
inside pre defines sterio type such as <<include> as in below.
Extends
Extended relationship indicates that use case may be extended by another use case.
The main idea behind the extends relationship among the use cases is that it allows us
to show optional system behavior. And an optional system behavior is extended only
under certain conditions. This relationship among use cases is also predefined as a
stereotype as shown below and as in the include relationship. The extend relationship is
similar to generalization. But unlike generalization, the extending use case can add
additional behavior only at an extension point only when certain conditions are
satisfied.
<<>extended>
55 *Under revision
Organization of use cases
Use cases are can be organized hierarchically. The high level use cases are refined into a
set of smaller and more refined use cases as shown below. Only the complex use cases
should be decomposed and organized in a hierarchy. It is not necessary to decompose
simple use cases. The functionality of the super-ordinate use cases is traceable to their
sub-ordinate use cases. Thus, the functionality provided by the super-ordinate use cases
is composite of the functionality of the sub-ordinate use cases.
Class diagrams
A class diagram describes the static structure of a system. It shows how a system is
structured rather than how it behaves. The static structure of a system comprises of a
number of class diagrams and their dependencies. The main constituents of a class
diagram are classes and their relationships: generalization, aggregation, association,
and various kinds of dependencies.
56 *Under revision
Classes
The classes represent entities with common features, i.e. attributes and operations.
Classes are represented as solid outline rectangles with compartments. It has a
mandatory name compartment where the name is written centered in boldface. The
class name is usually written using mixed case convention and begins with an
uppercase. The class names are usually chosen to be singular nouns.
Attributes
An attribute is a property of a class written in left justified. It represents the kind of data
that an object might contain. Attributes are listed with their names, and may be contain
specification of their type, an initial value, and constraints. The type of the attribute is
written by appending a colon and the type name after the attribute name as
Operation
Operation is the implementation of a service/activity that supported by class and
invoked by other class object. It can be requested from any object of the class to affect
behavior. An object’s data or state can be changed by invoking an operation of the
object. A class may have any number of operations or no operation at all. Generally the
first letter of an operation name is a small letter. Its return type is Boolean as E.g
issueBook(in bookName):Boolean
Association
When two classes associated with each other, their exists association relation. It is
represented by straight line between concerned classes. Associations enable objects to
communicate with each other. An association describes a connection between classes.
The association relation between two objects is called object connection or link. Links
are instances of associations. Mathematically, a link can be considered to be a tuple, i.e.
an ordered list of object instances. An association describes a group of links with a
common structure and common semantics. Each side of association relation multiplicity
is noted as an individual number or value range. Multiplicity (*) indicate how many
instance of one class are associated with the other. Range of multiplicity are noted by
specifying range of minimum to maximum by giving two dots i.e 1..5. An asterisk is
used as a wild card (last entry), zero or more.
Let us consider the statement that below illustrates the graphical representation of
the association relation. The name of the association is written alongside the association
line. An arrowhead is placed on the association line to indicate the reading direction of
the association. The arrowhead should not be misunderstood to be indicating the
57 *Under revision
direction of a pointer implementing an association. The multiplicity indicates how
many instances of one class are associated with each other.
Aggregation
Aggregation is a special type of association relation, where classes are not only
associated but also whole part relation exist between them. Here involved classes that
takes the responsibility of forwarding messages to the appropriate parts. Thus, it takes
the responsibility of delegation and leadership. When an instance of one object contains
instances of some other objects, then aggregation relationship exists between the
composite object and the component object. Aggregation is represented by the diamond
symbol at the composite end of a relationship. For example boo register is an
aggregation of book objects similarly document can be consider as an aggregation of
paragraph and aggregation of line. Here 1 and * means one document can have many
paragraph and many lines constitute a paragraph. This relation cannot be reflexive
means an object cannot have the object of same class as itself nor symmetric (i.e two
classes cannot contain instance of each other). However aggregation relationship is
transitive and it can consist of arbitrary number of levels.
Composition
Composition is a stricter form of aggregation, in which the parts are existence-
dependent on the whole. Means that the life of the parts closely ties to the life of the
whole. The composition relationship is represented as a filled diamond drawn at the
composite-end. An example of the composition relationship is
58 *Under revision
Polygon
Aggregation Composition
Vertices Properties
Color Area
Dependency
It represented by dotted arrow from dependent class to independent class. It provides
pre and post condition for operation to define ordering of an item.
• Association relationship can be reflexive (objects can have relation toitself), but
aggregation cannot be reflexive. Aggregation is anti-symmetric (If B is a part of A, A
cannot be a part of B).
• Composition has the property of exclusive aggregation i.e. an object can be a part of
only one composite at a time. For example, a Frame belongs to exactly one Window
whereas in simple aggregation, a part may be shared by several objects. For example, a
Wall may be a part of one or more Room objects.
• In composition, the whole has the responsibility for the decomposition of all its parts,
i.e. for their creation and destruction. For example, when a Frame is created, it has to be
attached to an enclosing Window. Similarly, when the Window is destroyed, it must in
turn destroy its Frame parts.
59 *Under revision
Inheritance vs. Aggregation/Composition
• Inheritance describes ‘is a’ / ‘is a kind of’ relationship between classes (base class -
derived class) whereas aggregation describes ‘has a’ relationship between classes.
Inheritance means that the object of the derived class inherits the properties of the base
class; aggregation means that the object of the whole has objects of the part.
• Inheritance means the objects of the subclass can be used anywhere the super class
may appear, but not the reverse; i.e. wherever we could use instances of ‘payment’ in
the system, we could substitute it with instances of ‘cash payment’, but the reverse
cannot be done.
For example, consider this situation in a business system. A Business Partner might be
a Customer or a Supplier or both. During its lifetime, a business partner might become
a customer as well as a supplier, or it might change from one to the other. In such cases,
we prefer aggregation instead. Here, a business partner is a Customer if it has an
aggregated Customer object, a Supplier if it has an aggregated Supplier object and a
"Customer Supplier" if it has both. Here, we can have only two types. Hence, we are
able to model it as inheritance.
60 *Under revision
• The advantage of aggregation is the integrity of encapsulation. The operations of an
object are the interfaces of other objects which imply low implementation dependencies.
The disadvantage of aggregation is the increase in the number of objects and their
relationships. On the other hand, inheritance allows for an easy way to modify
implementation for reusability.
.
Interaction Diagrams
Interaction diagram describe the interaction among group of objects through message
passing. Interaction diagrams are models that describe how group of objects
collaborate to realize some behavior. Each interaction diagram realizes the behavior of a
single use case. An interaction diagram shows a number of example objects and the
messages that are passed between the objects. There are two kinds of interaction
diagrams: sequence diagrams and collaboration diagrams.
Sequence Diagram:
A sequence diagram shows interaction among objects as a two dimensional chart. The
chart is read from top to bottom. The objects participating in the interaction are shown
at the top of the chart as boxes attached to a vertical dashed line. Vertical dashed line is
called object life line. Any point on life line implies that object exist at that point. If
object is destroyed, lifeline of object is crossed at that point and lifeline of that object is
not drowned at that point. Control rectangle is used as activation symbol drown from
lifeline of an object that the point at which object is active. Object is active as long as
control rectangle is exist in lifeline of object. Each message is labeled with message
name. Inside the box the name of the object is written with a colon separating it from
the name of the class and both the name of the object and the class is underlined. The
objects appearing at the top signify that the object already existed when the use case
execution was initiated. Note: single use case represent single sequence diagram.
61 *Under revision
Object1 Object2c Object3
message
[invalid]
62 *Under revision
Fig. 8: Sequence diagram for the renew book use case
Collaboration Diagram
63 *Under revision
Fig. 9: Collaboration diagram for the renew book use case
Activity diagrams
Activity diagram represent the various activity or chunk of process and their sequence
of activation. It shows the system execution and changes of direction based on different
condition. It model workflow for use case. It is possibly based on the event diagram of
Odell [1992] through the notation is very different from that used by Odell. An
interesting feature of the activity diagrams is the swim lanes. Swim lanes enable us to
group activities based on who is performing them, e.g. academic department vs. hostel
office. This is carried out during the initial stages of requirements analysis and
specification. Activity diagram gives start and end state and can show the path within
the use case as well as between the use cases. It explains what condition needs to meet
for use cases for use case to be valid condition state etc.
Components of activity diagram are:
a)Activities or action state: notation used for activity/action is rectangle with
rounded corner and it indicate action.
b)State: activity diagram can have only one start state but can have several
end/stop state. UML may describe two special state called start state and
stop state represented as: black dot and black dot with round circle.
64 *Under revision
c)Transition: used to show control flow from one state to another state. It shows
flow from state to an activity, between activity or between states.
Guard is noted on transition between two activity or states. And diamond is used as
decision point for condition. An activity is a state with an internal action and one or
more outgoing transition which automatically follow the internal activity termination.
Activity diagram is similar to procedural flow chart, difference is that activity diagram
support description of parallel activity and synchronization exist between activity and
parallel activities are represented by swim lane.
65 *Under revision
Unified Development Process
Qualified process for every project is most important which is to be follow thoroughly.
Many parts of the process are iterative, especially during the design and planning
phases. This flexibility in procedure allows for constant review and improvement, even
during the course of rapid development. Some of the approaches are
• A Modular Process
• A Strategic Focus
• A User Centered Approach
A Modular Process
Key competitive advantages of any project is the modularity of overall procedure. All
of products and services can be delivered as part of a full development schedule, or
individually when needed. In some cases, it leads the strategic planning section of a
project where others complete the graphic design or programming tasks.
In some cases, it is provided usability and information architecture services upon
which others build functional systems.
In some cases, it is designed the presentation for a campaign that others execute,
or we create a graphical interface for software that others programmed.
A Strategic Focus
Every aspect of a project must be driven be a clearly defined, relevant digital strategy.
We strongly focuses in the strategy in setting clear, measurable goals, and actively
analyzing the achievement of those goals to identify a project's rate of success.
This approach focus on the product's users and potential users and uses from the very
beginning. The design process developer generally follow is based on the principles
of User Centered Design (UCD). UCD has a broader scope than purely "usability"; and
continually throughout the planning, conceptualization, design and development
process.
Programming Languages
A programming language is a formal constructed language designed to
communicate instructions to a machine, particularly a computer. Programming
66 *Under revision
languages can be used to create programs to control the behaviour of a machine or to
express algorithms.
– machine languages;
– assembly languages;
– high-level languages.
Every processor has its own language and can execute only those programs that are
written in that language. For the processor to understand the program written in the
high-level language (i.e. the source text), some method of translation must be in place.
There are two techniques to achieve this aim:
The compiler is a special program which creates an object program in machine code
from the source program written in high-level language. The compiler treats the source
program as a single unit, and executes the following steps:
– Lexical analysis;
– Syntactic analysis;
– Semantic analysis;
– Code generation.
Classification
I. Imperative (algorithmic) languages
When the programmer writes a program text in these languages, he or she codes an
algorithm, and this algorithm makes the processor work. The program is a sequence of
statements and instruction. The most important programming feature is the variable,
which provides direct access to the memory, and makes it possible to directly
manipulate the values stored within. The algorithm changes the values of variables, so
67 *Under revision
the program takes effect on the memory. Imperative languages are closely connected to
the von Neumann architecture.
- Procedural languages
- Object-oriented languages
These languages are not connected as closely to the von Neumann architecture as
imperative languages. The programmer has to present only the problem, as the mode of
the solution is included in language implementations. The programmer cannot perform
memory operations, or just in a limited way.
- Logic languages
- Other languages
Characteristics
The following are the characteristics of a programming language
4. Error checking: Being human, a programmer is likely to make many mistakes in the
development of a computer program. Many high-level languages enforce a great deal of
error checking both at compile-time and at run-time.
68 *Under revision
5. Efficiency: It should permit the generation of efficient object code.
Classes
The classes represent entities with common features, i.e. attributes and operations.
Classes have optional attributes and operations compartments.
Attributes
An attribute is a named property of a class. It represents the kind of data that an object
might contain. An example for an attribute is given.
Book-Name : String
Operation
Operation is the implementation of a service that can be requested from any object of
the class to affect behaviour. An example for an operation is given.
Issue-Book (in book-Name): Boolean
Association
Associations are needed to enable objects to communicate with each other. An
association describes a connection between classes.
Coding
Any organizations normally require their programmers to adhere to some well-defined
and standard style of coding called coding standards. Most software development
organizations formulate their own coding standards that suit them most, and require
their engineers to follow these standards rigorously. The purpose of requiring all
engineers of an organization to adhere to a standard style of coding is the following:
• A coding standard gives a uniform appearance to the codes written by different
engineers.
• It enhances code understanding.
• It encourages good programming practices.
A coding standard lists several rules to be followed during coding, such as the way
variables are to be named, the way the code is to be laid out, error return conventions,
etc.
69 *Under revision
Contents of the headers preceding codes for different modules:
The information contained in the headers of different modules should be standard for
an organization. The exact format in which the header information is organized in the
header can also be specified. The following are some standard header data:
• Name of the module.
• Date on which the module was created.
• Author’s name.
• Modification history.
• Synopsis of the module.
• Different functions supported, along with their input/output parameters.
• Global variables accessed/modified by the module.
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.
Do not use a coding style that is too clever or too difficult to understand:
Code should be easy to understand. Clever coding can obscure meaning of the
code and hamper understanding. It also makes maintenance difficult.
70 *Under revision
with this approach and hence should be avoided. Some of the problems caused by use
of variables for multiple purposes as follows:
• Each variable should be given a descriptive name indicating its purpose. This is not
possible if an identifier is used for multiple purposes. Use of a variable for multiple
purposes can lead to confusion and make it difficult for somebody trying to read and
understand the code.
• Use of variables for multiple purposes usually makes future enhancements more
difficult.
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. Code reviews are extremely cost-effective
strategies for reduction in coding errors and to produce high quality code. 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.
71 *Under revision
through is an informal analysis technique, several guidelines have evolved over
the years for making this naïve but useful analysis technique more effective.
6. Therefore, these guidelines should be considered as examples rather than
accepted as rules to be applied dogmatically. Some of these guidelines are the
following.
• The team performing code walk through should not be either too big or too small.
Ideally, it should consist of between three to seven members.
• Discussion should focus on discovery of errors and not on how to fix the
discovered errors.
• In order to foster cooperation and to avoid the feeling among engineers that they
are being evaluated in the code walk through meeting. Managers should not
attend the walk through meetings.
Code Inspection
1. In contrast to code walk through, the aim of code inspection is to discover some
common types of errors caused due to oversight and improper programming.
2. During code inspection the code is examined for the presence of certain kinds of
errors, in contrast to the hand simulation of code execution done in code walk
through.
3. In addition to the commonly made errors, adherence to coding standards is also
checked during code inspection. Good software development companies collect
statistics regarding different types of errors commonly committed by their
engineers and identify the type of errors most frequently committed. Such a list
of commonly committed errors can be used during code inspection to look out
for possible errors.
Following is a list of some classical programming errors which can be checked during
code inspection:
Software documentation
When various kinds of software products are developed then not only the executable
files and the source code are developed but also various kinds of documents such as
72 *Under revision
users’ manual, software requirements specification (SRS) documents, design
documents, test documents, installation manual, etc are also developed as part of any
software engineering process. All these documents are a vital part of good software
development practice. Good documents are very useful and server the following
purposes:
• Good documents enhance understand ability and maintainability of a software
product. They reduce the effort and time required for maintenance.
• Production of good documents helps the manager in effectively tracking the progress
of the project. The project manager knows that measurable progress is achieved if a
piece of work is done and the required documents have been produced and reviewed.
Different types of software documents can broadly be classified into the following:
• Internal documentation
• External documentation
Internal documentation:
It is the code comprehension features provided as part of the source code
itself. Internal documentation is provided through appropriate module headers and
comments embedded in the source code. Internal documentation is also provided
through the useful variable names, module and function headers, code indentation,
code structuring, use of enumerated types and constant identifiers, use of user-defined
data types, etc. Careful experiments suggest that out of all types of internal
documentation meaningful variable names is most useful in understanding the code.
External documentation:
It is provided through various types of supporting documents such as users’
manual, software requirements specification document, design document, test
documents etc. A systematic software development style ensures that all these
documents are produced in an orderly fashion.
Program Testing
Testing a program consists of providing the program with a set of test inputs (or test
cases) and observing if the program behaves as expected. If the program fails to behave
as expected, then the conditions under which failure occurs are noted for later
debugging and correction. Some commonly used terms associated with testing are:
• Failure: This is a manifestation of an error (or defect or bug). But, the mere
presence of an error may not necessarily lead to a failure.
73 *Under revision
• Test case: This is the triplet [I,S,O], where I is the data input to the system, S is the
state of the system at which the data is input, and O is the expected output of the
system.
• Test suite: This is the set of all test cases with which a given software product is to be
tested.
Aim of testing
The aim of the testing process is to identify all defects existing in a software product.
However for most practical systems, even after thoroughly carrying out the testing
phase, it is not possible to guarantee that the software is error free. Because of the fact
that the input data domain of most software products is very large. It is not practical to
test the software exhaustively with respect to each value that the input data may
assume. Testing provides a practical way of reducing defects in a system and increasing
the users’ confidence in a developed system.
Testing
After design phase is over software products are normally tested first at the individual
component (or unit) level. This is referred to as testing in the small. After testing all the
components individually, the components are slowly integrated and tested at each level
of integration (integration testing). Finally, the fully integrated system is tested (called
system testing). Integration and system testing are known as testing in the large.
Unit testing
Unit testing is undertaken after a module has been coded and successfully reviewed.
Unit testing (or module testing) is the testing of different units (or modules) of a system
in isolation. In order to test a single module, a complete environment is needed to
provide all that is necessary for execution of the module. That is, besides the module
under test itself, the following steps are needed in order to be able to test the module:
• The procedures belonging to other modules that the module under test calls.
• Non-local data structures that the module accesses.
• A procedure to call the functions of the module under test with appropriate
parameters.
Modules required to provide the necessary environment (which either call or are called
by the module under test) is usually not available until they too have been unit tested,
stubs and drivers are designed to provide the complete environment for a module. The
role of stub and driver modules is pictorially shown below. A stub procedure is a
dummy procedure that has the same I/O parameters as the given procedure but has a
highly simplified behaviour. For example, a stub procedure may produce the expected
behaviour using a simple table lookup mechanism and it may use global data. A driver
74 *Under revision
module contains the nonlocal data structures accessed by the module under test, and
would also have the code to call the different functions of the module with appropriate
parameter values.
1. If the input data values to a system can be specified by a range of values, then one
valid and two invalid equivalence classes should be defined.
2. If the input data assumes values from a set of discrete members of some domain, then
one equivalence class for valid input values and another equivalence class for invalid
input values should be defined.
75 *Under revision
Example#1: For a software that computes the square root of an input integer which can
assume values in the range of 0 to 5000, there are three equivalence classes: The set of
negative integers, the set of integers in the range of 0 and 5000, and the integers larger
than 5000. Therefore, the test cases must include representatives for each of the three
equivalence classes and a possible test set can be: {-5,500,6000}.
Example#2: Design the black-box test suite for the following program. The program
computes the intersection point of two straight lines and displays the result. It reads
two integer pairs (m1, c1) and (m2, c2) defining the two straight lines of the form y=mx
+ c.
The equivalence classes are the following:
• Parallel lines (m1=m2, c1≠c2)
• Intersecting lines (m1≠m2)
• Coincident lines (m1=m2, c1=c2)
Now, selecting one representative value from each equivalence class, the test suit (2, 2)
(2, 5), (5, 5) (7, 7), (10, 10) (10, 10) are obtained.
Example: For a function that computes the square root of integer values in the range of
0 and 5000, the test cases must include the following values: {0, - 1, 5000, 5001}
76 *Under revision
Basic concepts associated with the white box testing are testing strategy that can be
either:
-coverage based testing
-statement coverage
-branch coverage
-condition coverage
-path coverage
Statement coverage
The statement coverage strategy aims to design test cases so that every statement in a
program is executed at least once. The principal idea governing the statement coverage
strategy is that unless a statement is executed, it is very hard to determine if an error
exists in that statement. Unless a statement is executed, it is very difficult to observe
whether it causes failure due to some illegal memory access, wrong result computation,
etc. However, executing some statement once and observing that it behaves properly
for that, input value is no guarantee that it will behave correctly for all input values. In
the following, designing of test cases using the statement coverage strategy have been
shown.
Example: Consider the Euclid’s GCD computation algorithm:
int compute_gcd(x, y)
int x, y;
{
1 while (x! = y){
2 if (x>y) then
77 *Under revision
3 x= x – y;
4 else y= y – x;
5}
6 return x;
}
By choosing the test set {(x=3, y=3), (x=4, y=3), (x=3, y=4)}, we can exercise the program
such that all statements are executed at least once.
Branch coverage
In the branch coverage-based testing strategy, test cases are designed to make each
branch condition to assume true and false values in turn. Branch testing is also known
as edge testing as in this testing scheme, each edge of a program’s control flow graph is
traversed at least once.
Branch testing guarantees statement coverage and thus is a stronger testing strategy
compared to the statement coverage-based testing. For Euclid’s GCD computation
algorithm , the test cases for branch coverage can be {(x=3, y=3), (x=3, y=2), (x=4, y=3),
(x=3, y=4)}.
Condition coverage
In this structural testing, test cases are designed to make each component of a
composite conditional expression to assume both true and false values. For example, in
the conditional expression (([Link].c2).or.c3), the components c1, c2 and c3 are each
made to assume both true and false values. Branch testing is probably the simplest
condition testing strategy where only the compound conditions appearing in the
different branch statements are made to assume the true and false values. Thus,
condition testing is a stronger testing strategy than branch testing and branch testing is
stronger testing strategy than the statement coverage-based testing. For a composite
conditional expression of n components, for condition coverage, 2ⁿ test cases are
required. Thus, for condition coverage, the number of test cases increases exponentially
with the number of component conditions. Therefore, a condition coverage-based
testing technique is practical only if n (the number of conditions) is small.
Path coverage
The path coverage-based testing strategy requires to design test cases such that all
linearly independent paths in the program are executed at least once. A linearly
independent path can be defined in terms of the control flow graph (CFG) of a program.
78 *Under revision
numbered statements serve as nodes of the control flow graph as shown below. An
edge from one node to another node exists if the execution of the statement
representing the first node can result in the transfer of control to the other node.
The CFG for any program can be easily drawn by knowing how to represent the
sequence, selection, and iteration type of statements in the CFG. After all, a program is
made up from these types of statements, how the CFG for these three types of
statements can be drawn. We have to note that for the iteration type of constructs such
as the while construct, the loop condition is tested only at the beginning of the loop and
therefore the control flow from the last statement of the loop is always to the top of the
loop. Using these basic ideas, the CFG of Euclid’s GCD computation algorithm can be
drawn as shown below.
79 *Under revision
Path
A path through a program is a node and edge sequence from the starting node to a
terminal node of the control flow graph of a program. There can be more than one
terminal node in a program. Writing test cases to cover all the paths of a typical
program is impractical. For this reason, the path-coverage testing does not require
coverage of all paths but only coverage of linearly independent paths.
Linearly independent path
A linearly independent path is any path through the program that introduces at least
one new edge that is not included in any other linearly independent paths. If a path has
one new node compared to all other linearly independent paths, then the path is also
linearly independent. This is because; any path having a new node automatically
implies that it has a new edge. But, a path that is sub path of another path is not
considered to be a linearly independent path.
80 *Under revision
The path-coverage testing does not require coverage of all paths but only coverage of
linearly independent paths. Linearly independent paths have been discussed earlier.
Cyclomatic complexity
For more complicated programs it is not easy to determine the number of independent
paths of the program. McCabe’s cyclomatic complexity defines an upper bound for the
number of linearly independent paths through a program. Also, it is very simple to
compute. Thus, the McCabe’s cyclomatic complexity metric provides a practical way of
determining the maximum number of linearly independent paths in a program. Though
the McCabe’s metric does not directly identify the linearly independent paths, but it
informs approximately how many paths to look for. There are three different ways to
compute the cyclomatic complexity.
Method 1:
Given a control flow graph G of a program, the cyclomatic complexity V(G) can be
computed as:
V(G) = E – N + 2
where N is the number of nodes of the control flow graph and E is the number of edges
in the control flow graph.
For the CFG of example shown in fig. 10.4, E=7 and N=6. Therefore, the cyclomatic
complexity = 7-6+2 = 3.
Method 2:
An alternative way of computing the cyclomatic complexity of a program from an
inspection of its control flow graph is as follows: V(G) = Total number of bounded
areas + 1
In the program’s control flow graph G, any region enclosed by nodes and edges can be
called as a bounded area. It is an easy way to determine the McCabe’s cyclomatic
complexity, But, what if the graph G is not planar, i.e. however you draw the graph,
two or more edges intersect? Actually, it can be shown that structured programs always
yield planar graphs. But, presence of GOTO’s statement can easily add intersecting
edges.
Therefore, for non-structured programs, this way of computing the McCabe’s
cyclomatic complexity cannot be used. The number of bounded areas increases with the
number of decision paths and loops. Therefore, the McCabe’s metric provides a
quantitative measure of testing difficulty and the ultimate reliability. For the CFG
example shown above, from a visual examination of the CFG the number of bounded
areas is 2. Therefore the cyclomatic complexity, computing with this method is also 2+1
= 3. This method provides a very easy way of computing the cyclomatic complexity of
CFGs, just from a visual examination of the CFG.
81 *Under revision
On the other hand, the other method of computing CFGs is more amenable to
automation, i.e. it can be easily coded into a program which can be used to determine
the cyclomatic complexities of arbitrary CFGs.
Method 3:
The cyclomatic complexity of a program can also be easily computed by computing the
number of decision statements of the program. If N is the number of decision statement
of a program, then the McCabe’s metric is
equal to N+1. From above example 2 decision statements ie if a and while so 2+1=3
Data flow-based testing method selects test paths of a program according to the
locations of the definitions and uses of different variables in a program. For a statement
numbered S, let
The process of generation and killing of mutants can be automated by predefining a set
of primitive changes that can be applied to the program. These primitive changes can be
82 *Under revision
alterations such as changing an arithmetic operator, changing the value of a constant,
changing a data type, etc. A major disadvantage of the mutation-based testing approach
is that:
-it is computationally very expensive, since a large number of possible mutants
can be generated.
-Since mutation testing generates a large number of mutants and requires us to
check each mutant with the full test suite, it is not suitable for manual testing.
Mutation testing should be used in conjunction of some testing tool
which would run all the test cases automatically.
Testing is a very important phase in software development life cycle. But the testing
may not be very effective if proper strategy is not used. For the implementation of
successful software testing strategy, the following issues must be taken care of: -
Before the start of the testing process, all the requirements must be
specified in a quantifiable manner.
Testing objectives must be clarified and stated explicitly.
A proper testing plan must be developed.
Build "robust" software that is designed to test itself.
Use effective formal technical reviews as a filter prior to testing. Formal
technical reviews can be as effective as testing in uncovering errors. For
this reason, reviews can reduce the amount of testing effort that is
required to produce high-quality software.
Conduct formal technical reviews to assess the test strategy and the cases
themselves. Formal technical reviews can uncover inconsistencies,
omissions, and outright errors in the testing approach. This saves time and
also improves product quality.
Develop a continuous improvement approach for the testing process. The test
strategy should be measured. The metrics collected during testing should be
used as part of a statistical process control approach for software testing.
Unit Testing
Unit testing compromises the set of tests performed by an individual programmer prior
to integration of the unit into a larger system. The situation is illustrated as follows:
83 *Under revision
A program unit is usually small part that can test it in great detail, and certainly in
greater detail there will be possible when the unit is integrated into an evolving
software product. There are four categories of tests that a programmer will typically
perform on a program unit:
• Function Tests
• Performance Test
• Stress Tests
• Structure Tests
Function test:
Functional test cases involve exercising the code with nominal input values for which
the expected results are known, as well as boundary values (minimum values,
maximum values, and values on and just outside the functional boundaries) and special
values such as logically related inputs, 1x1 matrices, the identity matrix, files of
identical elements, and empty files.
Performance testing:
Performances testing determines the amount of execution time spend in various parts
of the unit, program throughout, response time, and device utilization by the program
unit. A certain amount of performance tuning may be done during unit testing.
However, caution must be exercised to avoid expending too much effort on fine-tuning
of a program unit that contributes little to the overall performance of the entire system.
Performance testing is most productive at the subsystem and system levels.
Stress Tests:
Stress tests are those tests designed to intentionally break the unit. Through
this testing we can learn about the strengths and limitations of a program by
examining the manner in which a program unit breaks.
Structure Tests:
Structure tests are concerned with exercising the internal logic part of a program and
traversing particular execution paths. Some authors refer collectively to functional,
performance, and stress testing as "black box" testing, while structure testing is referred
to as "white box" or "glass box". The major activities in structural attesting are deciding
which path to exercise, deriving test data to exercise those and measuring the test
coverage achieved when the test case are exercised.
84 *Under revision
Figure 6.7
Even if it were possible to successfully test all paths through a program, correctness
would not be guaranteed by path testing or by this testing. Because there would be the
possible of program of missing the paths and computational errors that were not
discovered by the particular test cases chosen. A missing path error occurs when a
branching statement and the associated computations are accidentally omitted. Missing
path errors can only be detected by functional test cases derived from the requirements
specifications. Thus, tests based solely on the program structure cannot detect all the
potential errors in a source program. Coincidental correctness occurs when a test case
fails to detect a computation error. For instance, the expressions (A + A) and (A*A) have
identical values when A has the value 2.
-domain errors.
Tai has observed that N + m1 linearly independent test cases are required to establish
computational correctness of a program that performs only linear calculations on N
input variables. By linear calculations, we can conclude that all computations are linear
functions of the input variables when symbolic execution techniques)
A domain error occurs when a program traverses the wrong path because of an
incorrect predicate in a branching statement. White and Cohen have shown that, for
very simple programs, domain errors can be detected by the test cases that are either on
or near the borders of the path domains.
The borders of a path domain are determined by the inequalities in the test cases.
85 *Under revision
1. Coincidental correctness does not occur for any test case. If a test traverses an
incorrect path, the output values are different from the values that would be
computed on the correct path.
2. There are no missing paths associated with the path being tested.
4. Each adjacent path domain computes a function different from the function
computed by the path being tested.
5. The border being tested is a linear function of the input variables. If the border
is in correct border is linear.
7. Each test case of the border (each off point) is a small distance, epsilon, from
the border.
Integration Testing
After tested each module individually, integrated testing phase is proceeded. Testing
approach can be either top-up or bottom-up. Bottom-up integration is the traditional
strategy to integrate the components of a software system into a functioning whole.
Bottom-up integration consists of unit testing, which is followed by subsystem testing,
followed by testing of the entire system. Unit testing has the goal of discovering errors
in the individual modules of the system. Modules are tested in isolation from one
another in an artificial environment known as a "test harness," which consists of the
driver programs and data necessary to exercise the modules. Unit testing is eased by a
system structure that is composed of small, loosely coupled modules.
A subsystem consists of several modules that communicate with each other through
interfaces. Subsystem implements a major segment operation of the interfaces between
modules in the subsystem. Both control and of subsystem testing: lower level
subsystems are successively combined to form higher-level subsystems. In most
software systems, sometimes testing subsystem is not possible due to the complexity of
module interface. Therefore test cases must be chosen carefully to exercise the manner.
System testing is concerned with subtleties in the interfaces, decision logic, control flow,
recovery procedures, throughput, capacity, and timing characteristics of the entire
system. Careful test planning is required to determine the extent and nature of system
testing to be performed and to establish criteria by which the results will be evaluated.
86 *Under revision
Disadvantages of bottom-up testing include the necessity to write and debug test
harness for the modules and subsystems, and the level of complexity that results from
combining modules and subsystems into larger and larger units.
The extreme case of complexity occurs when each module is unit tested in isolation and
"big bang" approach to integration testing. The main problem with big-bang integration
is the difficulty of isolating the sources of error.
Top-down integration starts with the main routine and one or two immediately
subordinate routines in the system structure. After this top-level, when "skeleton" has
been thoroughly tested, it becomes the test harness for its immediately subordinate
routines. Top-down integration requires the use of program stubs to simulate the effect
of lower-level routines that are called by those being tested.
Regression Testing
When some errors occur in a program then these are rectified. For rectification of these
errors, changes are made to the program. Due to these changes some other errors may
be incorporated in the program. Therefore, all the previous test cases are tested again.
This type of testing is called regression testing.
In a broader context, successful tests (of any kind) result in the discovery of errors, and
errors must be corrected. Whenever software is corrected, some aspect of the software
configuration (the program, its documentation, or the data that supports it) is changed.
Regression testing is the activity that helps to ensure that changes (due to testing or for
other reasons) do not introduce unintended behavior or additional errors.
Regression testing may be conducted manually, by re-executing a subset of all test cases
or using automated capture/playback tools. Capture/playback tools enable the
software engineer to capture test cases and results for subsequent playback and
comparison.
The regression test suite (the subset of tests to be executed) contains three different
classes of test cases:
-Additional tests that focus on software functions that are likely to be affected by
the change.
-Tests that focus on the software components that have been changed.
87 *Under revision
-As integration testing proceeds, the number of regression tests can grow quite
large.
Therefore, the regression test suite should be designed to include only those tests that
address one or more classes of errors in each of the major program functions. It is
impractical and inefficient to re-execute every test for every program function once a
change has occurred.
Levels of Testing
When we go through the testing process faults can occur during any phase in the
software development cycle. Verification is performed on the output of each phase, but
some faults are likely to remain undetected by these methods. These faults will be
eventually reflected in the further code. Testing is usually relied on to detect these
faults, in addition to the faults introduced during the coding phase itself. Due to this,
different levels of testing are used in the testing process; each level of testing aims to
test different aspects of the system.
Figure 6.8
The basic levels are unit testing, integration testing, testing system and acceptance
testing. These different levels of testing attempt to detect different types of faults. The
relation of the faults introduced in different phases, and the different levels of testing as
shown in figure 6.8.
ART OF DEBUGGING
Debugging means fixing the error. It is carried by the development team with
intentionally removed of the error. Debugging is a necessary process in almost any
new software or hardware development process, whether a commercial product or an
enterprise or personal application program. For complex products, debugging is done
88 *Under revision
as the result of the unit test for the smallest unit of a system, again at component test
when parts are brought together, again at system test when the product is used with
other existing products, and again during customer beta test, when users try the
product out in a real world situation. Program that has lots of bugs is referred to as
"buggy."
Debugging tools (called debuggers) help identify coding errors at various development
stages. Some programming language packages include a facility for checking the code
for errors as it is being written.
Debugging approaches
The following are some of the approaches popularly adopted by programmers for
Debugging.
Backtracking:
This is also a fairly common approach. In this approach, beginning from the statement
at which an error symptom has been observed, the source code is traced backwards
until the error is discovered. Unfortunately, as the number of source lines to be traced
back increases, the number of potential backward paths increases and may become
unmanageably large thus limiting the use of this
approach.
89 *Under revision
Program Slicing:
This technique is similar to back tracking. Here the search space is reduced by defining
slices. A slice of a program for a particular variable at a particular statement is the set of
source lines preceding this statement that can influence the value of that variable.
Debugging guidelines
Debugging is often carried out by programmers based on their ingenuity. The following
are some general guidelines for effective debugging:
Software Maintenance
Software maintenance is the modification of a software product after delivery to correct faults,
to improve performance or other attributes .A common perception of maintenance is that it
merely involves fixing defects. However, one study indicated that the majority, over 80%, of the
maintenance effort is used for non-corrective actions. This perception is perpetuated by users
submitting problem reports that in reality are functionality enhancements to the system.
Software maintenance is needed to correct error enhance feature, portability to new platform.
90 *Under revision
Thus, every software product continues to evolve after its development through
maintenance efforts. Therefore it can be stated that software maintenance is needed to
correct errors, enhance features, port the software to new platforms, etc.
• Adaptive:
A software product might need maintenance when the customers need the product to run on
new platforms, on new operating systems, or when they need the product to interface with new
hardware or software.
• Perfective:
A software product needs maintenance to support the new features that users want it to
support, to change different functionalities of the system according to customer demands, or to
enhance the performance of the system.
1. Software maintenance work typically is much more expensive than what it should be
and takes more time than required.
2. In software organizations, maintenance work is mostly carried out using adhoc
techniques.
3. There are no systematic and planned activities for maintaining software.
4. Software maintenance has a very poor image in industry. Therefore, an organization
often cannot employ bright engineers to carry out maintenance work.
5. Even though maintenance suffers from a poor image, the work involved is often more
challenging than development work.
6. During maintenance it is necessary to thoroughly understand someone else’s work and
then carry out the required modifications and extensions.
7. Another problem associated with maintenance work is that the majority of software
products needing maintenance are legacy products.
91 *Under revision
Factors on which software maintenance activities depend
The activities involved in a software maintenance project are depends on several factors such as:
1. The extent of modification to the product required
2. The resources available to the maintenance team
3. The conditions of the existing product (e.g., how structured it is, how well documented it is,
etc.)
4. The expected project risks, etc.
When the changes needed to a software product are minor and straightforward, the code can be
directly modified and the changes appropriately reflected in all the documents. But more
elaborate activities are required when the required changes are not so trivial. Usually, for
complex maintenance projects for legacy systems, the software process can be represented by a
reverse engineering cycle followed by a forward engineering cycle with an emphasis on as
much reuse as possible from the existing code and other documents.
Software reverse engineering is the process of recovering the design and the
requirements specification of a product from an analysis of its code. The purpose of
reverse engineering is to facilitate maintenance work by improving the understand
ability of a system and to produce the necessary documents for a legacy system.
Reverse engineering is becoming important, since legacy software products lack proper
documentation, and are highly unstructured. Even well-designed products become
legacy software as their structure degrades through a series of maintenance efforts.
The first stage of reverse engineering usually focuses on carrying out cosmetic
changes to the code to improve its readability, structure, and understand ability,
without changing of its functionalities. A process model for reverse engineering has
been shown in below fig. A program can be reformatted using any of the several
available pretty printer programs which layout the program neatly. Many legacy
software products with complex control structure and unthoughtful variable names are
difficult to comprehend. Assigning meaningful variable names is important because
meaningful variable names are the most helpful thing in code documentation. All
variables, data structures, and functions should be assigned meaningful names
wherever possible. Complex nested conditionals in the program can be replaced by
simpler conditional statements or whenever appropriate by case statements.
REQUIRMENTS
SPECIFICATION
92 *Under revision
DESIGN
MODULE
SPECIFICATION
CODE
After the cosmetic changes have been carried out on a legacy software,
the process of extracting the code, design, and the requirements specification can begin.
These activities are schematically shown in fig. In order to extract the design, a full
understanding of the code is needed. Some automatic tools can be used to derive the
data flow and control flow diagram from the code. The structure chart (module
invocation sequence and data interchange among modules) should also be extracted.
The SRS document can be written once the full code has been thoroughly understood
and the design extracted.
Simplify Remove
Processing GOTOs
93 *Under revision
[Cosmetic changes carried out before reverse engineering]
The activities involved in a software maintenance project are not unique and
depend on several factors such as:
• The conditions of the existing product (e.g., how structured it is, how well
documented it is, etc.)
94 *Under revision
Software maintenance process models:
The second process model for software maintenance is preferred for projects
where the amount of rework required is significant. This approach can be represented
by a reverse engineering cycle followed by a forward engineering cycle. Such an
95 *Under revision
approach is also known as software reengineering. This process model is depicted in
the below fig. The reverse engineering cycle is required for legacy products. During the
reverse engineering, the old code is analysed (abstracted) to extract the module
specifications. The module specifications are then analysed to produce the design. The
design is analysed to produce the original requirements specification. The change
requests are then applied to this requirements specification to arrive at the new
requirements specification. At the design, module specification, and coding a
substantial reuse is made from the reverse engineered products. An important
advantage of this approach is that it produces a more structured design compared to
what the original product had, produces good documentation, and very often results in
increased efficiency.
• Reengineering might be preferable for products which exhibit a high failure rate.
• Reengineering might also be preferable for legacy products having poor design and
code structure.
Changed Requirements
Requirements Requirements
Specification Specification
Design Design
Module Module
Specifications Specifications
Code Code
Software reengineering:
96 *Under revision
Software reengineering is a combination of two consecutive processes i.e.
software reverse engineering and software forward engineering as shown in the fig.
It is well known that maintenance efforts require about 60% of the total life
cycle cost for a typical software product. However, maintenance costs vary widely from
one application domain to another. For embedded systems, the maintenance cost can be
as much as 2 to 4 times the development cost. Boehm [1981] proposed a formula for
estimating maintenance costs as part of his COCOMO cost estimation model. Boehm’s
maintenance cost estimation is made in terms of a quantity called the Annual Change
Traffic (ACT). Boehm defined ACT as the fraction of a software product’s source
instructions which undergo change during a typical year either through addition or
deletion.
Where, KLOC added is the total kilo lines of source code added during
maintenance. KLOC deleted is the total KLOC deleted during maintenance. Thus, the
code that is changed, should be counted in both the code added and the code deleted.
The annual change traffic (ACT) is multiplied with the total development cost to arrive
at the maintenance cost:
The results (also called as the deliverables) of a large software development effort
typically consist of a large number of objects, e.g. source code, design document, SRS
document, test document, user’s manual, etc. These objects are usually referred to and
modified by a number of software engineers throughout the life cycle of the software.
The state of all these objects at any point of time is called the configuration of the
97 *Under revision
software product. The state of each deliverable object changes as development
progresses and also as bugs is detected and fixed.
Configuration management determines clearly about the items that make up the
software or system. These items include source code, test scripts, third-party
software, hardware, data and both development and test documentation.
Configuration management is also about making sure that these items are
managed carefully, thoroughly and attentively during the entire project and
product life cycle.
Configuration management has a number of important implications for testing.
Like configuration management allows the testers to manage their testware and
test results using the same configuration management mechanisms.
Configuration management also supports the build process, which is important
for delivery of a test release into the test environment. Simply sending Zip archives
by e-mail will not be sufficient, because there are too many opportunities for such
archives to become polluted with undesirable contents or to harbor left-over
previous versions of items. Especially in later phases of testing, it is critical to have
a solid, reliable way of delivering test items that work and are the proper version.
98 *Under revision
Techniques of SCM Process
SCM is closely related to the software quality assurance (SQA) activity. The goals of
SQA can be characterized as monitoring the software and its development process,
ensuring compliance with standards and procedures, and ensuring that product,
process, and standards defects are visible to management. SCM activities help in
accomplishing these SQA goals.
99 *Under revision
Tool Selection and Implementation
Different types of tool capabilities, and procedures for their use, support the SCM
activities. Depending on the situation, these tool capabilities can be made available
with some combination of manual tools, automated tools providing a single SCM
capability, automated tools integrating a range of SCM capabilities, or integrated tool
environments that serve the needs of multiple participants in the software
development process .
In this example, code management systems support the operation of software libraries
by controlling access to library elements, coordinating the activities of multiple users,
and helping to enforce operating procedures. Other tools support the process of
building software and release documentation from the software elements contained in
Most important and dynamic characteristic of software is its reliability. Informally, the
reliability of a software system is a measure of how well it provides the services
expected of it by its users but a useful formal definition of reliability is much harder to
express. Software reliability metrics such as ‘mean time between failures’ may be used
but they do not take into account the subjective nature appropriate and useful.
Users do not consider all services to be of equal importance and a system might be
viewed as unreliable if it ever fails to provide some critical service. For example, say a
system was used to control braking on an aircraft but failed to work a single set of very
rare conditions. If the aircraft crashed because these failure conditions occurred, pilots
of similar aircraft would (reasonably) regard the software as unreliable.
On the other hand, say a comparable software system provided some visual indication
of its actions to the pilot. Assume this failed once per month in a predictable way
without the main system function being affected and other indicators showed that the
control system was working normally. In spite of frequent failure, pilots would not
consider that software as unreliable as the system, which caused the catastrophic
failure.
Software faults are not just program defects. Unexpected behaviour can occur in
circumstances where the software conforms to its requirements themselves are
complete. Omissions in software documentations can also lead to unexpected
behaviour, although the software may not contain defects.
For example, the word processor used to write this book has an automatic hyphenation
capability. This facility is used when text columns are short and any faults might
manifest themselves when users produce multi-column documents. I never use
hyphenation so, from my viewpoint, faults in the hyphenation code do not affect the
reliability of the word
So far, we have used the intuitive meaning of the term error to refer to problems in
requirements, design, or code. Sometimes error, fault, and failure are used inter-
changeably, and sometimes they refer to different concepts. Let us start by defining
these concepts clearly. We follow the IEEE definitions for these terms.
The term error is used in two different ways. It refers to the discrepancy between a
computed, observed, or measured value and the true, specified, or theoretically correct
value. That is, error refers to the difference between the actual output of a software and
the correct output. In this interpretation, error is essentially a measure of the difference
between the actual and the ideal. Error is also used to refer to human action those
results in software containing a defect or fault. This definition is quite general and
encompasses all the phases.
Fault is a condition that causes a system to fail in performing its required function. A
fault is the basic reason for software malfunction and is synonymous with the
commonly used term bug. The term error is also often used to refer to defects (taking a
variation of the second definition of error). In this book, we will continue to use the
terms in the manner commonly used, and no explicit distinction will be made between
errors and faults, unless necessary. It should be noted that the only " faults that a
software has are "design faults"; there is no wear and tear in software.
There are some implications of these definitions. Presence of an error (in the state)
implies that a failure must have occurred, and the observance of a failure implies that a
fault must be present in the system. However, the presence of a fault does not imply
that a failure must occur. The presence of a fault in a system only implies that the fault
has a potential to cause a failure to occur. Whether a fault actually manifests itself in
certain time duration depends on many factors. This means that if we observe the
behaviour of a system for some time and we do not observe any errors, we cannot say
anything about the presence or absence of faults in the system. If, on the other hand, we
observe some failure in this duration, we can say that there are some faults in the
system.
Reliability behaviour for hardware and software are very different. For example, hardware
failures are inherently different from software failures. Most hardware failures are due to
component wear and tear. A logic gate may be stuck at 1 or 0,or a resistor might short circuit. To
fix hardware faults, one has to either replace or repair the failed part. On the other hand, a
software product would continue to fail until the error is tracked down and either the design or
the code is changed. For this reason, when a hardware is repaired its reliability is maintained at
the level that existed before the failure occurred; whereas when a software failure is repaired,
the reliability may either increase or decrease (reliability may decrease if a bug introduces new
errors). To put this fact in a different perspective, hardware reliability study is concerned with
stability (for example, inter-failure times remain constant). On the other hand, software
reliability study aims at reliability growth (i.e. inter-failure times increase). The change of failure
rate over the product lifetime for a typical hardware and a software product are sketched
below. For hardware products, it can be observed that failure rate is high initially but decreases
as the faulty components are identified and removed.
Reliability metrics
AVAILABILITY =
The simplest reliability growth model is a step function model where it is assumed that
the reliability increases by a constant increment each time an error is detected and
repaired. However, this simple model of reliability which implicitly assumes that all
errors contribute equally to reliability growth, is highly unrealistic since it is already
known that correction of different types of errors contribute differently to reliability
growth.
This model allows for negative reliability growth to reflect the fact that when a repair is
carried out, it may introduce additional errors. It also models the fact that as errors are
repaired, the average improvement in reliability per repair decreases .It treat’s an
error’s contribution to reliability improvement to be an independent random variable
having Gamma distribution. This distribution models the fact that error corrections
with large contributions to reliability growth are removed first. This represents
diminishing return as test continues.
Software quality:
A quality product is defined in terms of its fitness of purpose robustness. That is,
a quality product does exactly what the users want it to do. For software products,
fitness of purpose is usually interpreted in terms of satisfaction of the requirements laid
down in the SRS document.
The modern view of a quality associates with a software product several quality
factors such as the following:
Portability: A software product is said to be portable, if it can be easily made to
work in different operating system environments, in different machines, with
other software products, etc. It should platform independent.
Usability: A software product has good usability, if different categories of users
(i.e. both expert and novice users) can easily invoke the functions of the product
easy to handle.
Reusability: A software product has good reusability, if different modules of the
product can easily be reused to develop new products.
Correctness: A software product is correct, if different requirements as specified
in the SRS document have been correctly implemented.
Maintainability: A software product is maintainable, if errors can be easily
corrected as and when they show up, new functions can be easily added to the
product, and the functionalities of the product can be easily modified, etc.
SEI Capability Maturity Model (SEI CMM) helped organizations to improve the
quality of the software they develop and therefore adoption of SEI CMM model
has significant business benefits.
SEI CMM can be used two ways: capability evaluation and software process
assessment.
Capability evaluation:
Capability evaluation provides a way to assess the software process
capability of an organization.
Software process assessment:
Software process assessment is used by an organization with the objective to
improve its process capability.
SEI CMM classifies software development industries into the following five
maturity levels.
Level 1: Initial.
A software development organization at this level is characterized by ad
hoc activities. Very few or no processes are defined and followed.
Level 2: Repeatable.
At this level, the basic project management practices such as tracking cost
and schedule are established.
Level 3: Defined.
At this level the processes for both management and development
activities are defined and documented.
Level 4: Managed.
At this level, the focus is on software metrics.
Level 5: Optimizing.
At this stage, process and product metrics are collected.
ISO 9000 is a series of three standards: ISO 9001, ISO 9002, and ISO 9003.
ISO 9001:
ISO 9001 applies to the organizations that engaged in design, development,
production, and servicing of goods. This is the standard that is applicable to most
software development organizations.
ISO 9002:
ISO 9002 applies to those organizations which do not design products but are
only involved in production.
ISO 9003:
ISO 9003 applies to organizations that are involved only in installation and
testing of the products.
Software Reliability
Reliability of a product depends not only on the number of latent errors but also
on the exact location of the errors.
Reliability behaviour for hardware and software are very different. For example,
hardware failures are inherently different from software failures. Most hardware
failures are due to component wear and tear. A logic gate may be stuck at 1 or 0, or a
resistor might short circuit. To fix hardware faults, one has to either replace or repair
the failed part.
On the other hand, a software product would continue to fail until the error is
tracked down and either the design or the code is changed. For this reason, when a
hardware is repaired its reliability is maintained at the level that existed before the
failure occurred.
time
time
Reliability Metrices:
There are six reliability metrics which can be used to quantify the reliability of
software products.
6. Availability
It considers the time interval up to which the product remains unaffected.
Availability of a system is a measure of how likely shall the system be available
for use over a given period of time. This metric not only considers the number of
failures occurring during a time interval, but also takes into account the repair
time (down time) of a system when a failure occurs.
o This simple model of reliability which implicitly assumes that all errors
contribute equally to reliability growth, is highly unrealistic since it is already
known that correction of different types of errors contribute differently to
reliability growth.
ROCOF
Time
o This model allows for negative reliability growth to reflect the fact that when a
repair is carried out, it may introduce additional errors.
o It also models the fact that as errors are repaired, the average improvement in
reliability per repair decreases
ROCOF
Time
[Random-step function model of reliability growth]
Fault Tolerance
o Software fault tolerance is the ability for software to detect and recover from a
fault that is happening or has already happened in either the software or
hardware in the system in which the software is running in order to provide
service in accordance with the specification.
o Software fault tolerance is a necessary component in order to construct the next
generation of highly available and reliable computing systems from embedded
systems to data warehouse systems.
Metrics:
Metrics in the area of software fault tolerance, (or software faults,) are generally
pretty poor.
Tools:
Software fault tolerance has an extreme lack of tools in order to aid the
programmer in making reliable system.
This lack of adequate tools is not very different from the general lack of
functional tools in software development that go beyond an editor and a
compiler.
Techniques:
Recovery Blocks:
N-version Software:
Self-Checking Software:
Project planning:
The project monitoring and control activities are undertaken once the
development activities start with the aim of ensuring that the development proceeds as
per plan and changing the plan whenever required to cope up with the situation.
CASE is a tool that helps a software engineer to maintain the level of the
software.
This CASE tool is an integrated part of workshop of software engineering, which
is called integrated project support environment (IPSE).
CASE provides automated support to following software engineering processes.
Examples:
CASE REPOSITORY
• Case repository- case repository usually stores into that they may be shared by
multiple projects and participants..
Lavel of Case:
There are three different level of the CASE technology which are as follows.
Diagram:
1. User interface
2. Tool set
3. Object management system
4. CASE repository
1. User interface:
User interface provides a common framework for accessing different tools by
simplifying and reducing the time of learning of the tools.
2. Tool set:
Objectives of Case:
Disadvantages Of Case:
Components:
o Components provide a service without regard to where the component is
executing or its programming language.
o A component is an independent executable entity that can be made up of one or
more executable objects.
o The component interface is published and all interactions are through the
published interface.
Definitions:
Component model:
o A component model is a definition of standards for component implementation,
documentation and deployment.
o Examples of component models
EJB model (Enterprise Java Beans)
COM+ model (.NET model)
Corba Component Model
o The component model specifies how interfaces should be defined and the
elements that should be included in an interface definition.
Component-based development:
It is the enabler of the client-server technology. Component-based development
is radically different from traditional software development. In component-based
development, a developer essentially integrates pre-built components purchased off-the
shelf. This is akin to the way hardware developers integrate ICs on a Printed Circuit
Board (PCB). Components might reside on different computers which act as servers and
clients.
The main objectives of component based software engineering are given below.
a) Reduction of cost and time for building large and complicated systems: main
objective of Component based approach is to build complicated software systems using
off the shelf component so that the time to build the software diminish drastically.
c) Detection of defect within the systems: Component approach helps the system to find
its defect readily by testing the components. But the source of defects is difficult to find
in case of component development approach.
Software Reuse
Software reuse makes repeated use of component from the previously developed
software in order to reduce the software cost by providing high quality and reliability.
a. Requirement specification
b. Design
c. Coding
d. Test cases
e. Knowledge and Experience
1. It is very difficult to credit the component they can be reused across different
application.
2. Developers are not consulting about providing necessary attention toward
the component which can be reuse from the previously developed system.
a. Component Creation.
b. Component Index and Testing.
c. Component Search.
d. Component Understanding.
e. Component Adoption
f. Repository Maintenance
Reuse Approach:
Stage-3: Domain is made suitable for reuse by providing standard solution to the
problem. We can make knowledge in component reuse.
Stage-4: Complete domain development can be done by reuse and the program are
written using application generator.
Component Classification:
Component can be classified by their level of ambiguity for effective storage structure.
For this a classification is used called as Prito-Diaz’s Classification scheme.
Component Search:
Component searching for reuse can be easily written through a web based domain
repository contains thousands of items. However inside the repository there must be
classification between component / design /models / requirement / knowledge to
make searching easier.
Repository Maintenance:
It involves adding of new reused artifacts, deleting those items which are no use,
modifying the search criteria to improve effectiveness of search.
Reuse without modification is reused once standard solution for program models are
available.
Factor effective reuses of software product are mostly non-technically these are as
follows:
The architecture of a system describes its major components, their relationships (structures),
and how they interact with each other. Software architecture and design includes several
contributory factors such as Business strategy, quality attributes, human dynamics, design,
and IT environment.
We can segregate Software Architecture and Design into two distinct phases: Software
Architecture and Software Design. In Architecture, nonfunctional decisions are cast and
separated by the functional requirements. In Design, functional requirements are
accomplished.
Software Architecture
Further, it involves a set of significant decisions about the organization related to software
development and each of these decisions can have a considerable impact on quality,
maintainability, performance, and the overall success of the final product. These decisions
comprise of −
Selection of structural elements and their interfaces by which the system is composed.
Behavior as specified in collaborations among those elements.
Composition of these structural and behavioral elements into large subsystem.
Architectural decisions align with business objectives.
Architectural styles guide the organization.
Software Design
3.2
Software design provides a design plan that describes the elements of a system, how they fit,
and work together to fulfill the requirement of the system. The objectives of having a design
plan are as follows −
Domain analysis, requirements analysis, and risk analysis comes before architecture design
phase, whereas the detailed design, coding, integration, and testing phases come after it.
Goals of Architecture
The primary goal of the architecture is to identify requirements that affect the structure of the
application. A well-laid architecture reduces the business risks associated with building a
technical solution and builds a bridge between business and technical requirements.
Expose the structure of the system, but hide its implementation details.
Realize all the use-cases and scenarios.
Try to address the requirements of various stakeholders.
Handle both functional and quality requirements.
Reduce the goal of ownership and improve the organization’s market position.
Improve quality and functionality offered by the system.
Improve external confidence in either the organization or system.
Limitations
Software architecture is still an emerging discipline within software engineering. It has the
following limitations −
A Software Architect provides a solution that the technical team can create and design for the
entire application. A software architect should have expertise in the following areas −
Design Expertise
Expert in software design, including diverse methods and approaches such as object-
oriented design, event-driven design, etc.
Lead the development team and coordinate the development efforts for the integrity of
the design.
Should be able to review design proposals and tradeoff among themselves.
Domain Expertise
Expert on the system being developed and plan for software evolution.
Assist in the requirement investigation process, assuring completeness and
consistency.
Coordinate the definition of domain model for the system being developed.
Technology Expertise
Methodological Expertise
Besides, facilitating the technical work among team members, it has also some subtle roles
such as reinforce the trust relationship among team members and protect team members from
the external forces that could distract them and bring less value to the project.
SOFTWARE DESIGN
Software design is a process to transform user requirements into some suitable form,
which helps the programmer in software coding and implementation.
Software design is the first step in SDLC (Software Design Life Cycle), which moves
the concentration from problem domain to solution domain. It tries to specify how to fulfill
the requirements mentioned in SRS.
Architectural Design - The architectural design is the highest abstract version of the
system. It identifies the software as a system with many components interacting with
each other. At this level, the designers get the idea of proposed solution domain.
High-level Design- The high-level design breaks the ‘single entity-multiple
component’ concept of architectural design into less-abstracted view of sub-systems
and modules and depicts their interaction with each other. High-level design focuses
on how the system along with all of its components can be implemented in forms of
modules. It recognizes modular structure of each sub-system and their relation and
interaction among each other.
Detailed Design- Detailed design deals with the implementation part of what is seen
as a system and its sub-systems in the previous two designs. It is more detailed
towards modules and their implementations. It defines logical structure of each
module and their interfaces to communicate with other modules.
Modularization
Modular design unintentionally follows the rules of ‘divide and conquer’ problem-solving
strategy this is because there are many other benefits attached with the modular design of a
software.
Advantage of modularization:
Concurrency
Back in time, all software are meant to be executed sequentially. By sequential execution we
mean that the coded instruction will be executed one after another implying only one portion
of program being activated at any given time. Say, a software has multiple modules, then
only one of all the modules can be found active at any time of execution.
It is necessary for the programmers and designers to recognize those modules, which can be
made parallel execution.
Example
The spell check feature in word processor is a module of software, which runs along side the
word processor itself.
When a software program is modularized, its tasks are divided into several modules based on
some characteristics. As we know, modules are set of instructions put together in order to
achieve some tasks. They are though, considered as single entity but may refer to each other
to work together. There are measures by which the quality of a design of modules and their
interaction among them can be measured. These measures are called coupling and cohesion.
Cohesion
Coupling
Content coupling - When a module can directly access or modify or refer to the
content of another module, it is called content level coupling.
Common coupling- When multiple modules have read and write access to some
global data, it is called common or global coupling.
Control coupling- Two modules are called control-coupled if one of them decides the
function of the other module or changes its flow of execution.
Stamp coupling- When multiple modules share common data structure and work on
different part of it, it is called stamp coupling.
Data coupling- Data coupling is when two modules interact with each other by
means of passing data (as parameter). If a module passes data structure as parameter,
then the receiving module should use all its components.
Design Verification
The output of software design process is design documentation, pseudo codes, detailed logic
diagrams, process diagrams, and detailed description of all functional or non-functional
requirements.
The next phase, which is the implementation of software, depends on all outputs mentioned
above.
3.7
It is then becomes necessary to verify the output before proceeding to the next phase. The
early any mistake is detected, the better it is or it might not be detected until testing of the
product. If the outputs of design phase are in formal notation form, then their associated tools
for verification should be used otherwise a thorough design review can be used for
verification and validation.
By structured verification approach, reviewers can detect defects that might be caused by
overlooking some conditions. A good design review is important for good software design,
accuracy and quality.
The main aim of design engineering is to generate a model which shows firmness,
delight and commodity.
Software design is an iterative process through which requirements are translated into
the blueprint for building the software.
A design is generated using the recognizable architectural styles and compose a good
design characteristic of components and it is implemented in evolutionary manner for
testing.
A design of the software must be modular i.e the software must be logically
partitioned into elements.
In design, the representation of data , architecture, interface and components should
be distinct.
A design must carry appropriate data structure and recognizable data patterns.
Design components must show the independent functional characteristic.
A design creates an interface that reduce the complexity of connections between the
components.
A design must be derived using the repeatable method.
The notations should be use in design which can effectively communicates its
meaning.
Quality attributes
Functionality:
It evaluates the feature set and capabilities of the program.
Usability:
It is accessed by considering the factors such as human factor, overall aesthetics, consistency
and documentation.
Reliability:
It is evaluated by measuring parameters like frequency and security of failure, output result
accuracy, the mean-time-to-failure(MTTF), recovery from failure and the the program
3.8
predictability.
Performance:
It is measured by considering processing speed, response time, resource consumption,
throughput and efficiency.
Supportability:
It combines the ability to extend the program, adaptability, serviceability. These three
term defines the maintainability.
Testability, compatibility and configurability are the terms using which a system can
be easily installed and found the problem easily.
Supportability also consists of more attributes such as compatibility, extensibility,
fault tolerance, modularity, reusability, robustness, security, portability, scalability.
Design concepts
1. Abstraction
A solution is stated in large terms using the language of the problem environment at
the highest level abstraction.
The lower level of abstraction provides a more detail description of the solution.
A sequence of instruction that contain a specific and limited function refers in a
procedural abstraction.
A collection of data that describes a data object is a data abstraction.
2. Architecture
[Link]
A design pattern describes a design structure and that structure solves a particular design
problem in a specified content.
4. Modularity
5. Information hiding
3.9
Modules must be specified and designed so that the information like algorithm and data
presented in a module is not accessible for other modules not requiring that information.
6. Functional independence
The functional independence is the concept of separation and related to the concept of
modularity, abstraction and information hiding.
The functional independence is accessed using two criteria i.e Cohesion and coupling.
Cohesion
Coupling
Coupling is an indication of interconnection between modules in a structure of software.
7. Refinement
8. Refactoring
9. Design classes
DESIGN CONCEPTS
Overview
system. Each design product is reviewed for quality (i.e. identify and correct errors,
inconsistencies, or omissions, whether better alternatives exist, and whether the design model
can be implemented within the project constraints) before moving to the next phase of
software development.
Software Design
Encompasses the set of principles, concepts, and practices that lead to the development of
a high quality system or product
Design principles establish and overriding philosophy that guides the designer as the
work is performed
Design concepts must be understood before the mechanics of design practice are applied
Goal of design engineering is to produce a model or representation that is bug free
(firmness), suitable for its intended uses (commodity), and pleasurable to use (delight)
Software design practices change continuously as new methods, better analysis, and
broader understanding evolve
implement all explicit requirements from the analysis model and accommodate all
implicit requirements desired by the user
be readable and understandable guide for those who generate code, test components, or
support the system
provide a complete picture (data, function, behavior) if the software from an
implementation perspective
Design Concepts
Design Classes
3.13
Refine analysis classes by providing detail needed to implement the classes and
implement a software infrastructure the support the business solution
Five types of design classes can be developed to support the design architecture
o user interface classes – abstractions needed for human-computer interaction (HCI)
o business domain classes – refinements of earlier analysis classes
o process classes – implement lower level business abstractions
o persistent classes – data stores that persist beyond software execution
o System classes – implement software management and control functions
Complete (includes all necessary attributes and methods) and sufficient (contains only
those methods needed to achieve class intent)
Primitiveness – each class method focuses on providing one service
High cohesion – small, focused, single-minded classes
Low coupling – class collaboration kept to minimum
Design Model
Process dimension – indicates design model evolution as design tasks are executed during
software process
o Architecture elements
o Interface elements
o Component-level elements
o Deployment-level elements
Abstraction dimension – represents level of detail as each analysis model element is
transformed into a design equivalent and refined
o High level (analysis model elements)
o Low level (design model elements)
Many UML diagrams used in the design model are refinements of diagrams created in the
analysis model (more implementation specific detail is provided)
Design patterns may be applied at any point in the design process
Data Design
Architectural Design
Usually depicted as a set of interconnected systems that are often derived from the
analysis packages with in the requirements model
Interface Design
Interface is a set of operations that describes the externally observable behavior of a class
and provides access to its public operations
Important elements
o User interface (UI)
o External interfaces to other systems
o Internal interfaces between various design components
Modeled using UML communication diagrams (called collaboration diagrams in UML
1.x)
Component-Level Design
Deployment-Level Design
Indicates how software functionality and subsystems will be allocated within the physical
computing environment
Modeled using UML deployment diagrams
Descriptor form deployment diagrams show the computing environment but does not
indicate configuration details
Instance form deployment diagrams identifying specific named hardware configurations
are developed during the latter stages of design
COUPLING
Types of Coupling
5. Common coupling
6. Content coupling (Least Required)
Data Coupling
Stamp coupling
Control coupling
A module controls the logic of another module through the parameter
Controlling module needs to know how the other module works - not flexible!
Hybrid coupling
Common coupling
Content coupling
COHESION
Types of Cohesion
Functional cohesion
All elements contribute to the execution of one and only one problem-related task
Focussed - strong, single-minded purpose
No elements doing unrelated activities
Examples of functional cohesive modules:
Compute cosine of angle
Read transaction record
Assign seat to airline passenger
Sequential cohesion
Elements are involved in activities such that output data from one activity becomes
input data to the next
Usually has good coupling and is easily maintained
Not so readily reusable because activities that will not in general be useful together
Communicational Cohesion
Elements contribute to activities that use the same input or output data
Not flexible, for example, if we need to focus on some activities and not the others
Possible links that cause activities to affect each other
3.17
Procedural cohesion
Elements are related only by sequence, otherwise the activities are unrelated
Similar to sequential cohesion, except for the fact that elements are unrelated
Commonly found at the top of hierarchy, such as the main program module
Example of Procedural Cohesion
module write read and edit something
use out record
write out record
read in record
pad numeric fields with zeros
return in record
end module
Temporal cohesion
Logical cohesion
Elements contribute to activities of the same general category (type)
For example, a report module, display module or I/O module
Usually have control coupling, since one of the activities will be selected
Example of Logical Cohesion
module display record
use record-type, record
if record-type is student then
3.18
Coincidental cohesion
Redundancy
Fan-in/Fan-out
Restrictivity/Generality
FUNCTIONAL INDEPENDENCE
A module having high cohesion and low coupling is said to be functionally independent of
other modules. By the term functional independence, we mean that a cohesive module
performs a single task or function. A functionally independent module has minimal
interaction with other modules.
Functional independence is a key to any good design due to the following reasons:
• Error isolation: Functional independence reduces error propagation. The reason behind
this is that if a module is functionally independent, its degree of interaction with the other
modules is less. Therefore, any error existing in a module would not directly effect the other
modules.
• Scope of reuse: Reuse of a module becomes possible. Because each module does some
well-defined and precise function, and the interaction of the module with the other modules is
simple and minimal. Therefore, a cohesive module can be easily taken out and reused in a
different program.
Design patterns represent the best practices used by experienced object-oriented software
developers. Design patterns are solutions to general problems that software developers faced
during software development. These solutions were obtained by trial and error by numerous
software developers over quite a substantial period of time.
In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides
published a book titled Design Patterns - Elements of Reusable Object-Oriented Software
which initiated the concept of Design Pattern in Software development.
These authors are collectively known as Gang of Four (GOF). According to these authors
design patterns are primarily based on the following principles of object orientated design.
Design patterns provide a standard terminology and are specific to particular scenario. For
example, a singleton design pattern signifies use of single object so all developers familiar
with single design pattern will make use of single object and they can tell each other that
program is following a singleton pattern.
Best Practices
Design patterns have been evolved over a long period of time and they provide best solutions
to certain problems faced during software development. Learning these patterns helps
unexperienced developers to learn software design in an easy and faster way.
As per the design pattern reference book Design Patterns - Elements of Reusable Object-
Oriented Software , there are 23 design patterns which can be classified in three categories:
Creational, Structural and Behavioral patterns. We'll also discuss another category of design
pattern: J2EE design patterns.
MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate
application's concerns.
Model - Model represents an object or JAVA POJO carrying data. It can also have
logic to update controller if its data changes.
View - View represents the visualization of the data that model contains.
3.21
Controller - Controller acts on both model and view. It controls the data flow into
model object and updates the view whenever data changes. It keeps view and model
separate.
Implementation
We are going to create a Student object acting as a [Link] will be a view class
which can print student details on console and StudentController is the controller class
responsible to store data in Student object and update view StudentView accordingly.
MVCPatternDemo, our demo class, will use StudentController to demonstrate use of MVC
pattern.
[Link]
}
public void setName(String name) {
[Link] = name;
}
}
[Link]
[Link]
Step 4 - Use the StudentController methods to demonstrate MVC design pattern usage.
[Link]
3.23
Student:
Name: Robert
Roll No: 10
Student:
Name: John
Roll No: 10
PUBLISH–SUBSCRIBE
In software architecture, publish–subscribe is a messaging pattern where senders
of messages, called publishers, do not program the messages to be sent directly to specific
receivers, called subscribers, but instead categorize published messages into classes without
knowledge of which subscribers, if any, there may be. Similarly, subscribers express interest
in one or more classes and only receive messages that are of interest, without knowledge of
which publishers, if any, there are.
Publish–subscribe is a sibling of the message queue paradigm, and is typically one part of a
larger message-oriented middleware system. Most messaging systems support both the
pub/sub and message queue models in their API, e.g. Java Message Service (JMS).
This pattern provides greater network scalability and a more dynamic network topology, with
a resulting decreased flexibility to modify the publisher and the structure of the published
data.
The three variations of the Publish/Subscribe pattern you can use to create a mechanism that
sends messages to all interested subscribers are List-Based Publish/Subscribe, Broadcast-
Based Publish/Subscribe, and Content-Based Publish/Subscribe.
3.24
List-Based Publish/Subscribe
A List-Based Publish/Subscribe pattern advises you to identify a subject and to
maintain a list of subscribers for that subject. When events occur, you have the subject notify
each subscriber on the subscription list. A classic way to implement this design is described
in the Observer [Gamma95] pattern. When you use this pattern, you identify two classes:
subjects and observers. Assuming you use a push model update, you add three methods to the
subject: Attach(),Detach(), and Notify().You add one method to the observer—Update().
To use an observer, all interested observers register with the subject by using
the Attach()method. As changes occur to the subject, the subject then calls each registered
observer by using the Notify()method. An observer works fine if you have created instances
of objects that reify all your observers and subjects. An observer is especially well suited to
situations where you have one-to-many relationships between your subjects and your
observers. However, in the context of integration, you often have many observers that are
linked to many subjects, which complicates the basic Observer pattern. One way to
implement this many-to-many relationship is to create many subjects and to have each
subject contain a list of observers.
If you use this object structure to implement Publish/Subscribe, you must write these
relationships to persistent storage between process executions. To do so within a relational
database, you must add an associative table to resolve the many-to-many dependencies
between subject and observer. After you write this information to persistent storage in a set of
tables, you can directly query the database for the list of subscribers for a topic.
Maintaining lists of published topics (subjects) and subscribers (observers) and then
notifying each one individually as events occur is the essence of List-Based
Publish/Subscribe implementations. A very different means of achieving the same result is
a Broadcast-Based Publish/Subscribeimplementation.
Broadcast-Based Publish/Subscribe
When you use a Broadcast-Based Publish/Subscribe approach [Tannebaum01,
Oki93], an event publisher creates a message and broadcasts it to the local area network
(LAN). A service on each listening node inspects the subject line. If the listening node
matches the subject line to a subject that it subscribes to, the listening node processes the
message. If the subject does not match, the listening node ignores the message.
Subject lines are hierarchical and may contain multiple fields that are separated by
periods. Listening nodes that are interested in a particular subject can subscribe to these fields
by using wildcards, if required.
Although this Broadcast-Based Publish/Subscribe implementation is an effective
method for decoupling producers from consumers, it is sometimes useful to identify
particular topic subscribers. To identify topic subscribers, a coordinating process sends a
message that asks listening nodes to reply if they subscribe to a particular topic. Responses
are then returned by each listening node to the provider to identify the subscribers.
Because all messages are sent to all listening nodes, and because each node is
responsible for filtering unwanted messages, some authors refer to this as a publish/subscribe
channel with reactive filtering [Hohpe04].
Content-Based Publish/Subscribe
Both Broadcast-Based Publish/Subscribe implementations and List-Based
Publish/Subscribe implementations can be broadly categorized as topic-based because they
both use predefined subjects as many-to-many channels. Publish/Subscribe implementations
have recently evolved to include a new form—Content-Based Publish/Subscribe. The
difference between topic-based and content-based approaches is as follows:
3.25
Applying Publish/Subscribe
Figure 1 shows an integration solution that consists of four applications. The sender
(also called a publisher) uses a topic-based approach to publish messages to topic A and to
topic B. Three receivers (also called subscribers) subscribe to these topics; one receiver
subscribes to topic A, one receiver subscribes to topic B, and one receiver subscribes to both
topic A and to topic B. The arrows show messages flowing from the publisher to each
subscriber according to these subscriptions.
Figure 1. Subscription to topics controls the message types that reach each subscriber
broker integration, you can implement the mechanism through subscription lists to the broker.
For point-to-point integration, you can implement the mechanism through subscription lists in
the publisher.
Finally, you must modify the integrated applications. The publisher must add the
topic-related information to each message that it publishes. For example, if the topic is
encoded as a header element, the publisher must insert the topic-related information into the
appropriate element. Likewise, the subscriber must specify the topics of interest.
Subscriptions can be either fixed or dynamic. With fixed subscriptions, the integration
architect sets the topics that an application subscribes to. Applications have no control over
their subscriptions. Usually, the subscriptions are specified when each application is added to
the integration solution. Figure 2 shows a fixed subscription to Topic A.
Figure 3 shows how dynamic subscriptions function. The top part of Figure 3 shows the
initial subscription to topic A. The application then sends a message that removes it from the
subscription list for topic A. The application then sends two messages that subscribe the
application to topic B and topic C. The bottom part of Figure 3 shows the final subscription
after these control messages are sent.
Related Decisions
After you decide to use Publish/Subscribe, you must make the following decisions:
Adapter pattern works as a bridge between two incompatible interfaces. This type of
design pattern comes under structural pattern as this pattern combines the capability of two
independent interfaces.
Implementation
Step 1 - Create interfaces for Media Player and Advanced Media Player.
[Link]
[Link]
[Link]
[Link]
[Link]
3.30
@Override
public void play(String audioType, String fileName) {
if([Link]("vlc")){
[Link](fileName);
}
else if([Link]("mp4")){
advancedMusicPlayer.playMp4(fileName);
}
}
}
[Link]
[Link]
In Strategy pattern, a class behavior or its algorithm can be changed at run time. This
type of design pattern comes under behavior pattern.
In Strategy pattern, we create objects which represent various strategies and a context
object whose behavior varies as per its strategy object. The strategy object changes the
executing algorithm of the context object.
Implementation
We are going to create a Strategy interface defining an action and concrete strategy
classes implementing the Strategy interface. Context is a class which uses a Strategy.
StrategyPatternDemo, our demo class, will use Context and strategy objects to
demonstrate change in Context behaviour based on strategy it deploys or uses.
[Link]
[Link]
[Link]
[Link]
[Link]
Step 4 - Use the Context to see change in behaviour when it changes its Strategy.
[Link]
3.33
10 + 5 = 15
10 - 5 = 5
10 * 5 = 50
Command pattern is a data driven design pattern and falls under behavioral pattern
category. A request is wrapped under an object as command and passed to invoker object.
Invoker object looks for the appropriate object which can handle this command and passes
the command to the corresponding object which executes the command.
Implementation
[Link]
[Link]
[Link]
[Link]
[Link]
import [Link];
import [Link];
public class Broker {
private List<Order> orderList = new ArrayList<Order>();
public void takeOrder(Order order){
[Link](order);
}
public void placeOrders(){
for (Order order : orderList) {
[Link]();
}
[Link]();
}
}
[Link]
Observer pattern is used when there is one-to-many relationship between objects such
as if one object is modified, its dependent objects are to be notified automatically. Observer
pattern falls under behavioral pattern category.
Implementation
3.36
Observer pattern uses three actor classes. Subject, Observer and Client. Subject is an
object having methods to attach and detach observers to a client object. We have created an
abstract class Observer and a concrete class Subject that is extending class Observer.
ObserverPatternDemo, our demo class, will use Subject and concrete class object to
show observer pattern in action.
[Link]
import [Link];
import [Link];
public class Subject {
private List<Observer> observers = new ArrayList<Observer>();
private int state;
public int getState() {
return state;
}
public void setState(int state) {
[Link] = state;
notifyAllObservers();
}
public void attach(Observer observer){
[Link](observer);
}
public void notifyAllObservers(){
for (Observer observer : observers) {
[Link]();
}
}
}
[Link]
[Link]
[Link]
[Link]
[Link]
In proxy pattern, a class represents functionality of another class. This type of design
pattern comes under structural pattern.
In proxy pattern, we create object having original object to interface its functionality
to outer world.
Implementation
We are going to create an Image interface and concrete classes implementing the
Image interface. ProxyImage is a a proxy class to reduce memory footprint of RealImage
object loading.
ProxyPatternDemo, our demo class, will use ProxyImage to get an Image object to
load and display as it needs.
3.39
[Link]
[Link]
[Link]
Step 3 - Use the ProxyImage to get object of RealImage class when required.
ProxyPatter [Link]
3.40
Loading test_10mb.jpg
Displaying test_10mb.jpg
Displaying test_10mb.jpg
Facade pattern hides the complexities of the system and provides an interface to the
client using which the client can access the system. This type of design pattern comes under
structural pattern as this pattern adds an interface to existing system to hide its complexities.
This pattern involves a single class which provides simplified methods required by
client and delegates calls to methods of existing system classes.
Implementation
We are going to create a Shape interface and concrete classes implementing the Shape
interface. A facade class ShapeMaker is defined as a next step.
ShapeMaker class uses the concrete classes to delegate user calls to these classes.
FacadePatternDemo, our demo class, will use ShapeMaker class to show the results.
[Link]
3.41
[Link]
[Link]
[Link]
[Link]
[Link]();
}
public void drawSquare(){
[Link]();
}
}
[Link]
Circle::draw()
Rectangle::draw()
Square::draw()
ARCHITECTURAL STYLE
The architectural style, also called as architectural pattern, is a set of principles which
shapes an application. It defines an abstract framework for a family of system in terms of the
pattern of structural organization.
Provide a lexicon of components and connectors with rules on how they can be
combined.
Improve partitioning and allow the reuse of design by giving solutions to frequently
occurring problems.
Describe a particular way to configure a collection of components (a module with
well-defined interfaces, reusable, and replaceable) and connectors (communication
link between modules).
The software that is built for computer-based systems exhibit one of many architectural
styles. Each style describes a system category that encompasses −
Semantic constraints which define how components can be integrated to form the
system.
A topological layout of the components indicating their runtime interrelationships.
Architectural Design
Architectural design is a process for identifying the sub-systems making up a system and
the framework for sub-system control and communication. The output of this design process
is a description of the software architecture. Architectural design is an early stage of the
system design process. It represents the link between specification and design processes and
is often carried out in parallel with some specification activities. It involves identifying major
system components and their communications.
Software architecture is most often represented using simple, informal block diagrams
showing entities and relationships. Pros: simple, useful for communication with stakeholders,
great for project planning. Cons: lack of semantics, types of relationships between entities,
visible properties of entities in the architecture.
Architectural design is a creative process so the process differs depending on the type of
system being developed. However, a number of common decisions span all design processes
and these decisions affect the non-functional characteristics of the system:
Systems in the same domain often have similar architectures that reflect domain concepts.
Application product lines are built around a core architecture with variants that satisfy
particular customer requirements. The architecture of a system may be designed around one
of more architectural patterns/styles, which capture the essence of an architecture and can
be instantiated in different ways.
Architectural views
Each architectural model only shows one view or perspective of the system. It might show
how a system is decomposed into modules, how the run-time processes interact or the
different ways in which system components are distributed across a network. For both design
and documentation, you usually need to present multiple views of the software architecture.
A logical view, which shows the key abstractions in the system as objects or object
classes.
A process view, which shows how, at run-time, the system is composed of interacting
processes.
A development view, which shows how the software is decomposed for
development.
A physical view, which shows the system hardware and how software components
are distributed across the processors in the system.
3.45
Architectural patterns
Patterns are a means of representing, sharing and reusing knowledge. An architectural pattern
is a stylized description of a good design practice, which has been tried and tested in
different environments. Patterns should include information about when they are and when
the are not useful. Patterns may be represented using tabular and graphical descriptions.
LAYERED ARCHITECTURE
Repository architecture
Name Repository
All data in a system is managed in a central repository that is accessible to all
Description system components. Components do not interact directly, only through the
repository.
You should use this pattern when you have a system in which large volumes
of information are generated that has to be stored for a long time. You may
When used
also use it in data-driven systems where the inclusion of data in the repository
triggers an action or tool.
Components can be independent--they do not need to know of the existence of
other components. Changes made by one component can be propagated to all
Advantages
components. All data can be managed consistently (e.g., backups done at the
same time) as it is all in one place.
The repository is a single point of failure so problems in the repository affect
the whole system. May be inefficiencies in organizing all communication
Disadvantages
through the repository. Distributing the repository across several computers
may be difficult.
CLIENT-SERVER ARCHITECTURE
Distributed system model which shows how data and processing is distributed across
a range of components, but can also be implemented on a single computer.
Set of stand-alone servers which provide specific services such as printing, data
management, etc.
Set of clients which call on these services.
Network which allows clients to access servers.
3.47
Name Client-server
In a client-server
server architecture, the functionality of the system is organized into
Description services, with each service delivered from a separate server. Clients are users
of these services and access servers to make use of them.
Used when data in a shared database has to be accessed from a range of
When used locations. Because servers can be replicated, may also be used when the load
on a system is variable.
The principal advantage of this model is that servers can be distributed across
Advantages a network. General functionality (e.g., a printing service) can be available to
all clients and does not need to be implemented by all services.
Each service is a single point of failure so susceptible
susceptible to denial of service
attacks or server failure. Performance may be unpredictable because it
Disadvantages
depends on the network as well as the system. May be management problems
if servers are owned by different organizations.
Application architectures
Application systems are designed to meet an organizational need. As businesses have much
in common, their application systems also tend to have a common architecture that reflects
the application requirements. A generic application architecture is an architecture for a
type of software system that may be configured and adapted to create a system that meets
specific requirements. application architectures can be used as a:
N-tier and 3-tier are architectural deployment styles that describe the separation of
functionality into segments in much the same way as the layered style, but with each segment
being a tier that can be located on a physically separate computer. They evolved through the
component-oriented approach, generally using platform specific methods for communication
instead of a message-based approach.
N-tier architectures usually have at least three separate logical parts, each located on a
separate physical server. Each part is responsible for specific functionality. When using a
layered design approach, a layer is deployed on a tier if more than one service or application
is dependent on the functionality exposed by the layer.
Consider either the N-tier or the 3-tier architectural style if the processing
requirements of the layers in the application differ such that processing in one layer could
absorb sufficient resources to slow the processing in other layers, or if the security
requirements of the layers in the application differ. For example, the presentation layer
should not store sensitive data, while this may be stored in the business and data layers. The
N-tier or the 3-tier architectural style is also appropriate if you want to be able to share
business logic between applications, and you have sufficient hardware to allocate the required
number of servers to each tier.
Consider using just three tiers if you are developing an intranet application where all
servers are located within the private network; or an Internet application where security
3.50
requirements do not restrict the deployment of business logic on the public facing Web or
application server. Consider using more than three tiers if security requirements dictate that
business logic cannot be deployed to the perimeter network, or the application makes heavy
use of resources and you want to offload that functionality to another server
User interface is the front-end application view to which user interacts in order to use
the software. User can manipulate and control the software as well as hardware by means of
user interface. Today, user interface is found at almost every place where digital technology
exists, right from computers, mobile phones, cars, music players, airplanes, ships etc.
User interface is part of software and is designed such a way that it is expected to
provide the user insight of the software. UI provides fundamental platform for human-
computer interaction.
UI can be graphical, text-based, audio-video based, depending upon the underlying
hardware and software combination. UI can be hardware or software or a combination of
both.
Attractive
Simple to use
Responsive in short time
Clear to understand
Consistent on all interfacing screens
CLI has been a great tool of interaction with computers until the video display
monitors came into existence. CLI is first choice of many technical users and programmers.
CLI is minimum interface a software can provide to its users.
CLI provides a command prompt, the place where the user types the command and
feeds to the system. The user needs to remember the syntax of command and its use. Earlier
CLI were not programmed to handle the user errors effectively.
A command is a text-based reference to set of instructions, which are expected to be
executed by the system. There are methods like macros, scripts that make it easy for the user
to operate.
CLI uses less amount of computer resource as compared to GUI.
CLI Elements
Cursor - It is a small horizontal line or a vertical bar of the height of line, to represent
position of character while typing. Cursor is mostly found in blinking state. It moves
as the user writes or deletes something.
Command - A command is an executable instruction. It may have one or more
parameters. Output on command execution is shown inline on the screen. When
output is produced, command prompt is displayed on the next line.
Graphical User Interface
Graphical User Interface provides the user graphical means to interact with the
system. GUI can be combination of both hardware and software. Using GUI, user
interprets the software.
Typically, GUI is more resource consuming than that of CLI. With advancing
technology, the programmers and designers create complex GUI designs that work
with more efficiency, accuracy and speed.
GUI Elements
GUI provides a set of components to interact with software or hardware.
Every graphical component provides a way to work with the system. A GUI system
has following elements such as:
Buttons - They imitate real life buttons and are used to submit inputs to the
software.
Radio-button - Displays available options for selection. Only one can be selected
among all offered.
Check-box - Functions similar
sim to list-box.
box. When an option is selected, the box is
marked as checked. Multiple options represented by check boxes can be selected.
List-box - Provides list of available items for selection. More than one item can be
selected.
Sliders
Combo-box
Data-grid
Drop-down list
There are a number of activities performed for designing user interface. The process of GUI
design and implementation is alike SDLC. Any model can be used for GUI implementation
among Waterfall, Iterative or Spiral Model.
A model used for GUI design and development should fulfill these GUI specific steps.
GUI Requirement Gathering - The designers may like to have list of all functional
and non-functional
functional requirements of GUI. This can be taken from user and their
existing software solution.
User Analysis - The designer studies who is going to use the software GUI. The
target audiencee matters as the design details change according to the knowledge and
competency level of the user. If user is technical savvy, advanced and complex GUI
can be incorporated. For a novice user, more information is included on how
how-to of
software.
Task Analysis - Designers have to analyze what task is to be done by the software
solution. Here in GUI, it does not matter how it will be done. Tasks can be
3.53
represented in hierarchical manner taking one major task and dividing it further into
smaller sub-tasks. Tasks provide goals for GUI presentation. Flow of information
among sub-tasks determines the flow of GUI contents in the software.
GUI Design & implementation - Designers after having information about
requirements, tasks and user environment, design the GUI and implements into code
and embed the GUI with working or dummy software in the background. It is then
self-tested by the developers.
Testing - GUI testing can be done in various ways. Organization can have in-house
inspection, direct involvement of users and release of beta version are few of them.
Testing may include usability, compatibility, user acceptance etc.
There are several tools available using which the designers can create entire GUI on a
mouse click. Some tools can be embedded into the software environment (IDE).GUI
implementation tools provide powerful array of GUI controls. For software customization,
designers can change the code [Link] are different segments of GUI tools
according to their different use and platform.
Example
Mobile GUI, Computer GUI, Touch-Screen GUI etc. Here is a list of few tools which come
handy to build GUI:
FLUID
AppInventor (Android)
LucidChart
Wavemaker
Visual Studio
The following rules are mentioned to be the golden rules for GUI design, described by
Shneiderman and Plaisant in their book (Designing the User Interface).
Offer simple error handling - As much as possible, le, design the system so the user
will not make a serious error. If an error is made, the system should be able to detect it
and offer simple, comprehensible mechanisms for handling the error.
Permit easy reversal of actions - This feature relieves anxiety,, since the user knows
that errors can be undone. Easy reversal of actions encourages exploration of
unfamiliar options. The units of reversibility may be a single action, a data entry, or a
complete group of actions.
Support internal locus of control - Experienced
perienced operators strongly desire the sense
that they are in charge of the system and that the system responds to their actions.
Design the system to make users the initiators of actions rather than the responders.
Reduce short-term
term memory load - The limitation
itation of human information processing
in short-term
term memory requires the displays to be kept simple, multiple page displays
be consolidated, window--motion
motion frequency be reduced, and sufficient training time be
allotted for codes, mnemonics, and sequences oof actions.
Sliders
Combo-box
Data-grid
Drop-down list
There are a number of activities performed for designing user interface. The process of GUI
design and implementation is alike SDLC.
SDLC. Any model can be used for GUI implementation
among Waterfall, Iterative or Spiral Model.
A model used for GUI design and development should fulfill these GUI specific steps.
GUI Requirement Gathering - The designers may like to have list of all functional
and non-functional
functional requirements of GUI. This can be taken from user and their
existing software solution.
User Analysis - The designer studies who is going to use the software GUI. The
target audiencee matters as the design details change according to the knowledge and
3.55
competency level of the user. If user is technical savvy, advanced and complex GUI
can be incorporated. For a novice user, more information is included on how-to of
software.
Task Analysis - Designers have to analyze what task is to be done by the software
solution. Here in GUI, it does not matter how it will be done. Tasks can be
represented in hierarchical manner taking one major task and dividing it further into
smaller sub-tasks. Tasks provide goals for GUI presentation. Flow of information
among sub-tasks determines the flow of GUI contents in the software.
GUI Design & implementation - Designers after having information about
requirements, tasks and user environment, design the GUI and implements into code
and embed the GUI with working or dummy software in the background. It is then
self-tested by the developers.
Testing - GUI testing can be done in various ways. Organization can have in-house
inspection, direct involvement of users and release of beta version are few of them.
Testing may include usability, compatibility, user acceptance etc.
There are several tools available using which the designers can create entire GUI on a mouse
click. Some tools can be embedded into the software environment (IDE).GUI implementation
tools provide powerful array of GUI controls. For software customization, designers can
change the code accordingly. There are different segments of GUI tools according to their
different use and platform.
Example
Mobile GUI, Computer GUI, Touch-Screen GUI etc. Here is a list of few tools which come
handy to build GUI:
FLUID
AppInventor (Android)
LucidChart
Wavemaker
Visual Studio
The following rules are mentioned to be the golden rules for GUI design, described by
Shneiderman and Plaisant in their book (Designing the User Interface).
UNIT IV TESTING
Testing – Unit testing – Black box testing– White box testing – Integration and System
testing– Regression testing – Debugging - Program analysis – Symbolic execution – Model
Checking
Aim of Testing
The aim of the testing process is to identify all defects existing in a software product.
However for most practical systems, even after satisfactorily carrying out the testing phase, it
is not possible to guarantee that the software is error free. This is because of the fact that the
input data domain of most software products is very large. It is not practical to test the
software exhaustively with respect to each value that the input data may assume. Even with
this practical limitation of the testing process, the importance of testing should not be
underestimated. It must be remembered that testing does expose many defects existing in a
software product. Thus testing provides a practical way of reducing defects in a
system and increasing the users’ confidence in a developed system.
What Exactly is Testing
Testing a program consists of providing the program with a set of test inputs (or test
cases) and observing if the program behaves as expected. If the program fails to behave as
expected, then the conditions under which failure occurs are noted for later debugging and
correction. Some commonly used terms associated with testing are:
• Failure: This is a manifestation of an error (or defect or bug). But, the mere presence of an
error may not necessarily lead to a failure.
• Test case: This is the triplet [I,S,O], where
I is the data input to the system,
S is the state of the system at which the data is input, and
O is the expected output of the system.
• Test suite: This is the set of all test cases with which a given software product is to be
tested.
Approaches to Testing
There are essentially two main approaches to systematically designing test cases. They are
Black-box Testing
White-box Testing
In the black-box testing approach, test cases are designed using only the functional
specification of the software, i.e. without any knowledge of the internal structure of the
software. For this reason, black-box testing is known as functional testing.
On the other hand, in the white-box testing approach, designing test cases requires thorough
knowledge about the internal structure of software, and therefore the white-box testing is
called structural testing.
UNIT TESTING
Unit testing, a testing technique using which individual modules are tested to determine if
there are any issues by the developer himself. It is concerned with functional correctness of
IV UNIT - TESTING 4.2
the standalone [Link] main aim is to isolate each unit of the system to identify, analyze
and fix the defects.
Reduces Defects in the Newly developed features or reduces bugs when changing the
existing functionality.
Reduces Cost of Testing as defects are captured in very early phase.
Improves design and allows better refactoring of code.
Unit Tests, when integrated with build gives the quality of the build as well.
Black Box Testing - Using which the user interface, input and output are tested.
White Box Testing - used to test each one of those functions behavior is tested.
Gray Box Testing - Used to execute tests, risks and assessment methods.
Unit testing
When testing object classes, tests should be designed to provide coverage of all of the
features of the object:
Whenever possible, unit testing should be automated so that tests are run and checked
without manual intervention. In automated unit testing, you make use of a test automation
framework (such as JUnit) to write and run your program tests. Unit testing frameworks
provide generic test classes that you extend to create specific test cases. They can then run all
of the tests that you have implemented and report, often through some GUI, on the success of
otherwise of the tests. An automated test has three parts:
A setup part, where you initialize the system with the test case, namely the inputs and
expected outputs.
A call part, where you call the object or method to be tested.
An assertion part where you compare the result of the call with the expected result. If
the assertion evaluates to true, the test has been successful if false, then it has failed.
The test cases should show that, when used as expected, the component that you are testing
does what it is supposed to do. If there are defects in the component, these should be revealed
by test cases. This leads to two types of unit test cases:
The first of these should reflect normal operation of a program and should show that
the component works as expected.
The other kind of test case should be based on testing experience of where common
problems arise. It should use abnormal inputs to check that these are properly
processed and do not crash the component.
BLACK-BOX TESTING
Unit testing
Unit testing is undertaken after a module has been coded and successfully reviewed.
Unit testing (or module testing) is the testing of different units (or modules) of a system in
isolation.
In order to test a single module, a complete environment is needed to provide all that
is necessary for execution of the module. That is, besides the module under test itself, the
following steps are needed in order to be able to test the module:
• The procedures belonging to other modules that the module under test calls.
• Nonlocal data structures that the module accesses.
IV UNIT - TESTING 4.4
• A procedure to call the functions of the module under test with appropriate
parameters.
Modules required to provide the necessary environment (which either call or are
called by the module under test) is usually not available until they too have been unit tested,
stubs and drivers are designed to provide the complete environment for a module. The role of
stub and driver modules is pictorially shown in fig. 10.1. A stub procedure is a dummy
procedure that has the same I/O parameters as the given procedure but has a highly simplified
behavior. For example, a stub procedure may produce the expected behavior using a simple
table lookup mechanism. A driver module contain the nonlocal data structures accessed by
the module under test, and would also have the code to call the different functions of the
module with appropriate parameter values.
Example#1: For a software that computes the square root of an input integer which can
assume values in the range of 0 to 5000, there are three equivalence classes: The set of
negative integers, the set of integers in the range of 0 and 5000, and the integers larger than
5000. Therefore, the test cases must include representatives for each of the three equivalence
classes and a possible test set can be: {-5,500,6000}.
Example#2: Design the black-box test suite for the following program. The program
computes the intersection point of two straight lines and displays the result. It reads two
integer pairs (m1, c1) and (m2, c2) defining the two straight lines of the form y=mx + c.
The equivalence classes are the following:
• Parallel lines (m1=m2, c1≠c2)
• Intersecting lines (m1≠m2)
• Coincident lines (m1=m2, c1=c2)
IV UNIT - TESTING 4.5
Now, selecting one representative value from each equivalence class, the test suit (2, 2) (2, 5),
(5, 5) (7, 7), (10, 10) (10, 10) are obtained.
Statement coverage
The statement coverage strategy aims to design test cases so that every statement in a
program is executed at least once. The principal idea governing the statement coverage
strategy is that unless a statement is executed, it is very hard to determine if an error exists in
that statement. Unless a statement is executed, it is very difficult to observe whether it causes
failure due to some illegal memory access, wrong result computation, etc. However,
executing some statement once and observing that it behaves properly for that input value is
no guarantee that it will behave correctly for all input values. In the following, designing of
test cases using the statement coverage strategy have been shown.
Example: Consider the Euclid’s GCD computation algorithm:
int compute_gcd(x, y)
int x, y;
{
1 while (x! = y){
IV UNIT - TESTING 4.6
2 if (x>y) then
3 x= x – y;
4 else y= y – x;
5}
6 return x;
}
By choosing the test set {(x=3, y=3), (x=4, y=3), (x=3, y=4)}, we can exercise the
program such that all statements are executed at least once.
Branch coverage
In the branch coverage-based testing strategy, test cases are designed to make each
branch condition to assume true and false values in turn. Branch testing is also known as edge
testing as in this testing scheme, each edge of a program’s control flow graph is traversed at
least once.
It is obvious that branch testing guarantees statement coverage and thus is a stronger
testing strategy compared to the statement coverage-based testing. For Euclid’s GCD
computation algorithm , the test cases for branch coverage can be {(x=3, y=3), (x=3, y=2),
(x=4, y=3), (x=3, y=4)}.
Condition coverage
In this structural testing, test cases are designed to make each component of a
composite conditional expression to assume both true and false values. For example, in the
conditional expression (([Link].c2).or.c3), the components c1, c2 and c3 are each made to
assume both true and false values. Branch testing is probably the simplest condition testing
strategy where only the compound conditions appearing in the different branch statements are
made to assume the true and false values. Thus, condition testing is a stronger testing strategy
than branch testing and branch testing is stronger testing strategy than the statement
coverage-based testing. For a composite conditional expression of n components, for
condition coverage, 2ⁿ test cases are required. Thus, for condition coverage, the number of
test cases increases exponentially with the number of component conditions. Therefore, a
condition coverage-based testing technique is practical only if n (the number of conditions) is
small.
Path coverage
The path coverage-based testing strategy requires us to design test cases such that all
linearly independent paths in the program are executed at least once. A linearly independent
path can be defined in terms of the control flow graph (CFG) of a program.
therefore the control flow from the last statement of the loop is always to the top of the loop.
Using these basic ideas, the CFG of Euclid’s GCD computation algorithm can be drawn as
shown in fig. 10.4
Fig. 10.3: CFG for (a) sequence, (b) selection, and (c) iteration type of constructs
new node compared to all other linearly independent paths, then the path is also linearly
independent. This is because, any path having a new node automatically implies that it has a
new edge. Thus, a path that is subpath of another path is not considered to be a linearly
independent path.
IV UNIT - TESTING 4.9
Method 1: Given a control flow graph G of a program, the cyclomatic complexity V(G) can
be computed as:
V(G) = E – N + 2 where N is the number of nodes of the control flow graph and E is
the number of edges in the control flow graph. For the CFG of example shown in fig. 10.4,
E=7 and N=6. Therefore, the cyclomatic complexity = 7-6+2 = 3.
Method 2:An alternative way of computing the cyclomatic complexity of a program from an
inspection of its control flow graph is as follows:
V(G) = Total number of bounded areas + 1
In the program’s control flow graph G, any region enclosed by nodes and edges can be called
as a bounded area. This is an easy way to determine the McCabe’s cyclomatic complexity.
But, what if the graph G is not planar, i.e. however you draw the graph, two or more edges
intersect? Actually, it can be shown that structured programs always yield planar graphs. But,
presence of GOTO’s can easily add intersecting edges. Therefore, for non-structured
programs, this way of computing the McCabe’s cyclomatic complexity cannot be used.
The number of bounded areas increases with the number of decision paths and loops.
Therefore, the McCabe’s metric provides a quantitative measure of testing difficulty and the
ultimate reliability. For the CFG example shown in fig. 10.4, from a visual examination of
the CFG the number of bounded areas is 2. Therefore the cyclomatic complexity, computing
with this method is also 2+1 = 3. This method provides a very easy way of computing the
cyclomatic complexity of CFGs, just from a visual examination of the CFG. On the other
hand, the other method of computing CFGs is more amenable to automation, i.e. it can be
easily coded into a program which can be used to determine the cyclomatic complexities of
arbitrary CFGs.
Mutation testing
In mutation testing, the software is first tested by using an initial test suite built up
from the different white box testing strategies. After the initial testing is complete, mutation
testing is taken up. The idea behind mutation testing is to make few arbitrary changes to a
program at a time. Each time the program is changed, it is called as a mutated program and
the change effected is called as a mutant. A mutated program is tested against the full test
suite of the program. If there exists at least one test case in the test suite for which a mutant
gives an incorrect result, then the mutant is said to be dead. If a mutant remains alive even
after all the test cases have been exhausted, the test data is enhanced to kill the mutant. The
process of generation and killing of mutants can be automated by predefining a set of
primitive changes that can be applied to the program. These primitive changes can be
alterations such as changing an arithmetic operator, changing the value of a constant,
changing a data type, etc. A major disadvantage of the mutation-based testing approach is
that it is computationally very expensive, since a large number of possible mutants can be
generated.
Since mutation testing generates a large number of mutants and requires us to check
each mutant with the full test suite, it is not suitable for manual testing. Mutation testing
should be used in conjunction of some testing tool which would run all the test cases
automatically.
Test cases for equivalence class testing and boundary value analysis for a problem.
Let’s consider a function that computes the square root of integer values in the range of 0 and
5000. For this particular problem, test cases corresponding to equivalence class testing and
boundary value analysis have been found out earlier.
Debugging
Need for debugging
Once errors are identified in a program code, it is necessary to first identify the
precise program statements responsible for the errors and then to fix them. Identifying errors
in a program code and then fix them up are known as debugging.
Debugging approaches
The following are some of the approaches popularly adopted by programmers for debugging.
Brute Force Method:
This is the most common method of debugging but is the least efficient method. In
this approach, the program is loaded with print statements to print the intermediate values
with the hope that some of the printed values will help to identify the statement in error. This
IV UNIT - TESTING 4.11
approach becomes more systematic with the use of a symbolic debugger (also called a source
code debugger), because values of different variables can be easily checked and break points
and watch points can be easily set to test the values of variables effortlessly.
Backtracking:
This is also a fairly common approach. In this approach, beginning from the statement
at which an error symptom has been observed, the source code is traced backwards until the
error is discovered. Unfortunately, as the number of source lines to be traced back increases,
the number of potential backward paths increases and may become unmanageably large thus
limiting the use of this approach.
Cause Elimination Method:
In this approach, a list of causes which could possibly have contributed to the error
symptom is developed and tests are conducted to eliminate each. A related technique of
identification of the error from the error symptom is the software fault tree analysis.
Program Slicing:
This technique is similar to back tracking. Here the search space is reduced by
defining slices. A slice of a program for a particular variable at a particular statement is the
set of source lines preceding this statement that can influence the value of that variable.
Debugging guidelines
Debugging is often carried out by programmers based on their ingenuity. The following are
some general guidelines for effective debugging:
• Many times debugging requires a thorough understanding of the program design. Trying to
debug based on a partial understanding of the system design and implementation may
require an inordinate amount of effort to be put into debugging even simple problems.
• Debugging may sometimes even require full redesign of the system. In such cases, a
common mistakes that novice programmers often make is attempting not to fix the error
but its symptoms.
• One must be beware of the possibility that an error correction may introduce new errors.
Therefore after every round of error-fixing, regression testing must be carried out.
Code walk throughs and code inspections might be considered as static analysis methods.
But, the term static program analysis is used to denote automated analysis tools. So, a
compiler can be considered to be a static program analysis tool.
Integration testing
The primary objective of integration testing is to test the module interfaces, i.e. there
are no errors in the parameter passing, when one module invokes another module. During
integration testing, different modules of a system are integrated in a planned manner using an
integration plan. The integration plan specifies the steps and the order in which modules are
combined to realize the full system. After each integration step, the partially integrated
system is tested. An important factor that guides the integration plan is the module
dependency graph. The structure chart (or module dependency graph) denotes the order in
which different modules call each other. By examining the structure chart the integration plan
can be developed.
Integration test approaches
There are four types of integration testing approaches. Any one (or a mixture) of the
following approaches can be used to develop the integration test plan. Those approaches are
the following:
• Big bang approach
• Top-down approach
• Bottom-up approach
• Mixed-approach
Big-Bang Integration Testing
It is the simplest integration testing approach, where all the modules making up a system are
integrated in a single step. In simple words, all the modules of the system are simply put
together and tested. However, this technique is practicable only for very small systems. The
main problem with this approach is that once an error is found during the integration testing,
it is very difficult to localize the error as the error may potentially belong to any of the
modules being integrated. Therefore, debugging errors reported during big bang integration
testing are very expensive to fix.
IV UNIT - TESTING 4.13
System testing
System tests are designed to validate a fully developed system to assure that it meets
its requirements. There are essentially three main kinds of system testing:
IV UNIT - TESTING 4.14
• Alpha Testing. Alpha testing refers to the system testing carried out by the test team
within the developing organization.
• Beta testing. Beta testing is the system testing performed by a select group of
friendly customers.
• Acceptance Testing. Acceptance testing is the system testing performed by the
customer to determine whether he should accept the delivery of the system.
In each of the above types of tests, various kinds of test cases are designed by
referring to the SRS document. Broadly, these tests can be classified into functionality and
performance tests. The functionality tests test the functionality of the software to check
whether it satisfies the functional requirements as documented in the SRS document. The
performance tests test the conformance of the system with the nonfunctional requirements of
the system.
Performance testing
Performance testing is carried out to check whether the system needs the non-
functional requirements identified in the SRS document. There are several types of
performance testing. Among of them nine types are discussed below. The types of
performance testing to be carried out on a system depend on the different non-functional
requirements of the system documented in the SRS document. All performance tests can be
considered as black-box tests.
• Stress testing
• Volume testing
• Configuration testing
• Compatibility testing
• Regression testing
• Recovery testing
• Maintenance testing
• Documentation testing
• Usability testing
Stress Testing
Stress testing is also known as endurance testing. Stress testing evaluates system
performance when it is stressed for short periods of time. Stress tests are black box tests
which are designed to impose a range of abnormal and even illegal input conditions so as to
stress the capabilities of the software. Input data volume, input data rate, processing time,
utilization of memory, etc. are tested beyond the designed capacity. For example, suppose an
operating system is supposed to support 15 multiprogrammed jobs, the system is stressed by
attempting to run 15 or more jobs simultaneously. A real-time system might be tested to
determine the effect of simultaneous arrival of several high-priority interrupts.
Stress testing is especially important for systems that usually operate below the
maximum capacity but are severely stressed at some peak demand hours. For example, if the
non-functional requirement specification states that the response time should not be more
than 20 secs per transaction when 60 concurrent users are working, then during the stress
testing the response time is checked with 60 users working simultaneously.
Volume Testing
It is especially important to check whether the data structures (arrays, queues, stacks,
etc.) have been designed to successfully extraordinary situations. For example, a compiler
might be tested to check whether the symbol table overflows when a very large program is
compiled.
IV UNIT - TESTING 4.15
Configuration Testing
This is used to analyze system behavior in various hardware and software
configurations specified in the requirements. Sometimes systems are built in variable
configurations for different users. For instance, we might define a minimal system to serve a
single user, and other extension configurations to serve additional users. The system is
configured in each of the required configurations and it is checked if the system behaves
correctly in all required configurations.
Compatibility Testing
This type of testing is required when the system interfaces with other types of
systems. Compatibility aims to check whether the interface functions perform as required.
For instance, if the system needs to communicate with a large database system to retrieve
information, compatibility testing is required to test the speed and accuracy of data retrieval.
Regression Testing
This type of testing is required when the system being tested is an upgradation of an
already existing system to fix some bugs or enhance functionality, performance, etc.
Regression testing is the practice of running an old test suite after each change to the system
or after each bug fix to ensure that no new bug has been introduced due to the change or the
bug fix. However, if only a few statements are changed, then the entire test suite need not be
run - only those test cases that test the functions that are likely to be affected by the change
need to be run.
Recovery Testing
Recovery testing tests the response of the system to the presence of faults, or loss of
power, devices, services, data, etc. The system is subjected to the loss of the mentioned
resources (as applicable and discussed in the SRS document) and it is checked if the system
recovers satisfactorily. For example, the printer can be disconnected to check if the system
hangs. Or, the power may be shut down to check the extent of data loss and corruption.
Maintenance Testing
This testing addresses the diagnostic programs, and other procedures that are required
to be developed to help maintenance of the system. It is verified that the artifacts exist and
they perform properly.
Documentation Testing
It is checked that the required user manual, maintenance manuals, and technical
manuals exist and are consistent. If the requirements specify the types of audience for which
a specific manual should be designed, then the manual is checked for compliance.
Usability Testing
Usability testing concerns checking the user interface to see if it meets all user
requirements concerning the user interface. During usability testing, the display screens,
report formats, and other aspects relating to the user interface requirements are tested.
Error seeding
Sometimes the customer might specify the maximum number of allowable errors that
may be present in the delivered system. These are often expressed in terms of maximum
number of allowable errors per line of source code. Error seed can be used to estimate the
number of residual errors in a system.
Error seeding, as the name implies, seeds the code with some known errors. In other
words, some artificial errors are introduced into the program artificially. The number of these
seeded errors detected in the course of the standard testing procedure is determined. These
values in conjunction with the number of unseeded errors detected can be used to predict:
• The number of errors remaining in the product.
• The effectiveness of the testing strategy.
IV UNIT - TESTING 4.16
Let N be the total number of defects in the system and let n of these defects be found by
testing.
Let S be the total number of seeded defects, and let s of these defects be found during testing.
n/N = s/S
or
N = S × n/s
Defects still remaining after testing = N–n = n×(S – s)/s
Error seeding works satisfactorily only if the kind of seeded errors matches closely
with the kind of defects that actually exist. However, it is difficult to predict the types of
errors that exist in a software. To some extent, the different categories of errors that remain
can be estimated to a first approximation by analyzing historical data of similar projects. Due
to the shortcoming that the types of seeded errors should match closely with the types of
errors actually existing in the code, error seeding is useful only to a moderate extent.
Regression testing
Regression testing does not belong to either unit test, integration test, or system
testing. Instead, it is a separate dimension to these three forms of testing. The functionality of
regression testing has been discussed earlier. Regression Testing is defined as a type of
software testing to confirm that a recent program or code change has not adversely affected
existing features. Regression Testing is nothing but full or partial selection of already
executed test cases which are re-executed to ensure existing functionalities work fine. This
testing is done to make sure that new code changes should not have side effects on the
existing functionalities. It ensures that old code still works once the new code changes are
done.
Retest All
This is one of the methods for Regression Testing in which all the tests in the existing
test bucket or suite should be re-executed. This is very expensive as it requires huge
time and resources.
Instead of re-executing the entire test suite, it is better to select part of test suite to be
run
Test cases selected can be categorized as 1) Reusable Test Cases 2) Obsolete Test
Cases.
Re-usable Test cases can be used in succeeding regression cycles.
Obsolete Test Cases can't be used in succeeding cycles.
Prioritize the test cases depending on business impact, critical & frequently used
functionalities. Selection of test cases based on priority will greatly reduce the
regression test suite.
It was found from industry data that good number of the defects reported by
customers were due to last minute bug fixes creating side effects and hence selecting the Test
Case for regression testing is an art and not that easy. Effective Regression Tests can be done
by selecting following test cases -
If your software undergoes frequent changes, regression testing costs will escalate. In
such cases, Manual execution of test cases increases test execution time as well as costs.
Automation of regression test cases is the smart choice in such cases. Extent of automation
depends on the number of test cases that remain re-usable for successive regression cycles.
Following are most important tools used for both functional and regression testing:
Selenium: This is an open source tool used for automating web applications. Selenium can be
used for browser based regression testing.
Rational Functional Tester (RFT): IBM's rational functional tester is a Java tool used to
automate the test cases of software applications. This is primarily used for automating
regression test cases and it also integrates with Rational Test Manager.
Retesting means testing the functionality or bug again to ensure the code is fixed. If it is not
fixed, Defect needs to be re-opened. If fixed, Defect is closed. Regression testing means
testing your software application when it undergoes a code change to ensure that the new
code has not affected other parts of the software. Also, check out the complete list of
differences over here .
Following are the major testing problems for doing regression testing:
With successive regression runs, test suites become fairly large. Due to time and
budget constraints, the entire regression test suite cannot be executed
Minimizing test suite while achieving maximum Test coverage remains a challenge
Determination of frequency of Regression Tests, i.e., after every modification or
every build update or after a bunch of bug fixes, is a challenge.
Symbolic execution
Example
Consider the program below, which reads in a value and fails if the input is 6.
int f() {
...
y = read();
z = y * 2;
if (z == 12) {
fail();
} else {
printf("OK");
}
}
During a normal execution ("concrete" execution), the program would read a concrete
input value (e.g., 5) and assign it to y. Execution would then proceed with the multiplication
and the conditional branch, which would evaluate to false and print OK.
During symbolic execution, the program reads a symbolic value (e.g., λ) and assigns
it to y. The program would then proceed with the multiplication and assign λ * 2 to z. When
reaching the if statement, it would evaluate λ * 2 == 12. At this point of the program, λ could
take any value, and symbolic execution can therefore proceed along both branches, by
"forking" two paths. Each path gets assigned a copy of the program state at the branch
instruction as well as a path constraint. In this example, the path constraint is λ * 2 == 12 for
the then branch and λ * 2 != 12 for the else branch. Both paths can be symbolically executed
independently. When paths terminate (e.g., as a result of executing fail() or simply exiting),
symbolic execution computes a concrete value for λ by solving the accumulated path
constraints on each path. These concrete values can be thought of as concrete test cases that
IV UNIT - TESTING 4.20
can, e.g., help developers reproduce bugs. In this example, the constraint solver would
determine that in order to reach the fail() statement, λ would need to equal 6.
Limitations
Path Explosion
Symbolically executing all feasible program paths does not scale to large programs. The
number of feasible paths in a program grows exponentially with an increase in program size
and can even be infinite in the case of programs with unbounded loop iterations.[1] Solutions
to the path explosion problem generally use either heuristics for path-finding to increase code
coverage,[2] reduce execution time by parallelizing independent paths,[3] or by merging
similar paths.[4]
Program-Dependent Efficacy
Environment Interactions
Programs interact with their environment by performing system calls, receiving signals, etc.
Consistency problems may arise when execution reaches components that are not under
control of the symbolic execution tool (e.g., kernel or libraries). Consider the following
example:
int main()
{
FILE *fp = fopen("[Link]");
...
if (condition) {
fputs("some data", fp);
} else {
fputs("some other data", fp);
}
...
data = fgets(..., fp);
}
This program opens a file and, based on some condition, writes different kind of data to the
file. It then later reads back the written data. In theory, symbolic execution would fork two
paths at line 5 and each path from there on would have its own copy of the file. The statement
at line 11 would therefore return data that is consistent with the value of "condition" at line 5.
In practice, file operations are implemented as system calls in the kernel, and are outside the
control of the symbolic execution tool. The main approaches to address this challenge are:
Executing calls to the environment directly. The advantage of this approach is that it is
simple to implement. The disadvantage is that the side effects of such calls will clobber all
IV UNIT - TESTING 4.21
states managed by the symbolic execution engine. In the example above, the instruction at
line 11 would return "some datasome other data" or "some other datasomedata" depending on
the sequential ordering of the states.
Modeling the environment. In this case, the engine instruments the system calls with a
model that simulates their effects and that keeps all the side effects in per-state storage. The
advantage is that one would get correct results when symbolically executing programs that
interact with the environment. The disadvantage is that one needs to implement and maintain
many potentially complex models of system calls. Tools such as KLEE,[5] Cloud9, and
Otter[6] take this approach by implementing models for file system operations, sockets, IPC,
etc.
Forking the entire system state. Symbolic execution tools based on virtual machines solve
the environment problem by forking the entire VM state. For example, in S2E[7] each state is
an independent VM snapshot that can be executed separately. This approach alleviates the
need for writing and maintaining complex models and allows virtually any program binary to
be executed symbolically. However, it has higher memory usage overheads (VM snapshots
may be large).
Model checking
Model checking or property checking refers to the following problem: Given a model of a
system, exhaustively and automatically check whether this model meets a given specification.
Typically, one has hardware or software systems in mind, whereas the specification contains
safety requirements such as the absence of deadlocks and similar critical states that can cause
the system to crash. Model checking is a technique for automatically verifying correctness
properties of finite-state systems.
IV UNIT - TESTING 4.22
Model Checking
• Given a Kripke structure M = (S,R,L) that represents a finite-state
concurrent system and a temporal logic formula f expressing some
desired specification, find the set of states in S that satisfy f:
{ s S | M,s ╞ f }
IV UNIT - TESTING 4.24
1.2DevOps processes:
Figure 1.1 gives an overview of DevOps processes. At its most basic, DevOps
advocates treating Operations personnel as first-class stakeholders. Preparing a release
can be a very serious and onerous process. (We describe that in the section “Release
Process.”)
As such, operations personnelmay need to be trained in the types of runtime errors
that can occur in a system under development;they may have suggestions as to the
type and structure of log files, and they may provide other types of input into the
requirements process.
At its most extreme, DevOps practices make developers
responsible for monitoring the progress and errors that occur during deployment and
execution, so theirs would be the voices suggesting requirements.
In between are practices that cover team practices, build processes, testing processes,
and deployment processes.
FIGURE 1.1 DevOps life cycle processes
1.6 Coordination
One goal of DevOps is to minimize coordination in order to reduce the time to market.
Two of the reasons to coordinate are, first, so that the pieces developed by the various teams
will work together and, second, to avoid duplication of effort.
Forms of Coordination
Coordination mechanisms have different attributes.
Direct—the individuals coordinating know each other (e.g., team members).
Indirect—the coordination mechanism is aimed at an audience known only by its
characterization (e.g., system administrators).
Persistent—the coordination artifacts are available after the moment of the
coordination (e.g.,documents, e-mail, bulletin boards).
Ephemeral—the coordination, per se, produces no artifacts (e.g., face to face
meetings,conversations, telephone/video conferencing). Ephemeral coordination can
be made persistent through the use of human or mechanical recorders.
Synchronous—individuals are coordinating in real time, (e.g., face to face).
Asynchronous—individuals are not coordinating in real time (e.g., documents, e-
mail).
Team Coordination
Team coordination mechanisms are of two types—human processes and automated
processes.
Cross-team Coordination
Examining the release process activities again makes it clear that cross-team
coordination is the most time-consuming factor. The role of the service owner is to perform
upstream coordination. Downstream coordination is accomplished by moving many
operations responsibilities to the development team. It is cross-team coordination that we
focus on now.
1. Making the code pieces work together. Architecture for the system being developed will
help make the pieces work together. Architecture specifies a number of the design decisions
to create an overall system. Six of these design decisions are:
a. Allocation of responsibilities.
b. Coordination model.
c. Data model.
d. Management of resources.
e. Mapping among architectural elements.
f. Binding time decisions.
2. Avoiding duplication of effort.
DevOps practices essentially argue that duplication of effort is a necessary cost for
shorter time to market. There are two portions to this argument.
First, since the task each team has to accomplish is small, any duplication is small.
Large potential areas of duplication, such as each team creating their own data store, are
handled by the architecture.
Second, since each team is responsible for its own service, troubleshooting problems
after deployment is faster with code written by the team, and it avoids escalating a problem to
a different team.
1.7 Barriers
Culture and Type of Organization
Culture depends not only on your role but also on the type of organization to which
you belong. For some organizations the risks of problems occurring outweigh a time-to-
market advantage.
Organizations that operate in regulated domains—financial, health care, or utility
services— have regulations to which they must adhere and face penalties, potentially
severe, if they violate the regulations under which they operate. Even organizations in
regulated domains may have products that are unregulated. So a financial organization
may use DevOps processes for some products. For products that require more oversight,
the practices may be adaptable, for example, by introducing additional gatekeepers.
Organizations that operate in mature and slow-moving domains—automotive or building
construction—have long lead times, and, although their deadlines are real, they are also
foreseeable far in advance.
Organizations whose customers have a high cost of switching to another supplier, such
as Enterprise Resource Planning systems, are reluctant to risk the stability of their
operations. The cost of downtime for some systems will far outweigh the competitive
advantage of introducing a new feature somewhat more quickly.
For other organizations, nimbleness and fast response are more important than the occasional
error caused by moving too fast.
Organizations that rely on business analytics to shape their products want to have shorter
and shorter times between the gathering of the data and actions inspired by the data. Any
errors that result can be quickly corrected since the next cycle will happen quickly.
Organizations that face severe competitive pressure want to have their products and new
features in the marketplace before their competitors.
Type of Department
One method for determining the culture of an organization is to look at what kinds of
results are incentivized. Salespeople who work on commission work very hard to get
sales. CEOs who are rewarded based on quarterly profits are focused on the results of
the next quarter. This is human nature. Developers are incentivized to produce and
release code.
Operations personnel, on the other hand, are incentivized to minimize downtime.
Minimizing downtime means examining and removing causes of downtime. Examining
anything in detail takes time. Furthermore, avoiding change removes one of the causes
of downtime.
Basically, developers are incentivized to change something (release new code), and
operations personnel are incentivized to resist change. These two different sets of
incentives breed different attitudes and can be the cause of culture clashes.
Silo Mentality
It is easy to say that two departments in an organization have a common goal—ensuring
the Organization’s success. It is much more difficult to make this happen in practice.
An individuals’ loyalty tends to be first to her or his team and secondarily to the overall
organization.
If the development team is responsible for defining the release plan that will include
what features get implemented in what priority, other portions of the organization will
see some of their power being usurped and, potentially, their customers become
unhappy. If activities formerly performed by operations personnel are now going to be
performed by developers, what happens to the operations personnel who now have less
to do?
These are the normal ebbs and flows of organizational politics but that does not make
them less meaningful and less real.
Tool Support
We described the advantages of automating processes previously, and these advantages
are real. They do not come without a cost, however.
There must be expertise in the installation, configuration, and use of each tool. Tools
have new releases, inputs, and idiosyncrasies. Tool expertise has to be integrated into
the organization.
If the organization uses common processes across a wide variety of development teams,
then there must be a means of defining these common processes and ensuring that all of
the development teams obey them. Use of a tool means subscribing to the process
implicit in that tool.
Personnel Issues
According to the Datamation 2012 IT salary guide, a software engineer earns about
50% more than a systems administrator. So by moving a task from a system
administrator (Ops) to a software engineer (Dev), the personnel performing the task cost
50% more. Thus, the time spent performing the task must be cut by a third just to make
the performance of the task cost the same amount.
A bigger cut is necessary to actually gain time, with automation being the prevalent
method to achieve these time savings. This is the type of cost/benefit analysis that an
organization must go through in order to determine which DevOps processes to adopt
and how to adopt them.
Developers with a modern skill set are in high demand and short supply, and they also
have a heavy workload. Adding more tasks to their workload may exacerbate the
shortage of developers.
CS6403 - SOFTWARE ENGINEERING
QUESTION BANK
UNIT I- SOFTWARE PRODUCT AND PROCESS
Part - A (2 M ARKS)
1. What is the prime objective of software engineering?
2. Define software engineering paradigm.
3. What do you mean by spiral model?
4. Write a brief note on waterfall model.
5. Distinguish between process and methods.
6. Give the importance of software engineering.
7. Define software process. State the important features of a process.
8. Write any two characteristics of software as a product.
9. List the process maturity levels in SEI' s CMM.
10. Distinguish clearly between verification & validation.
11. What are the functions of data architecture?
12. Define System Modeling.
13. State the System Engineering Hierarchy.
14. Mention some of the factors to be considered during System Modeling.
15. What are the different architectures developed during BPE?
16. Define Verification &Validation.
PART – B
1. Explain iterative waterfall and spiral model for software life cycle and discuss various
activities in each phase. (16)
2. List several software process paradigms. Explain how both waterfall model and prototyping
model can be accommodated in the spiral process model. (16)
3. Explain in detail Boehm's spiral model for softwre life cycle and discuss various activities in
each phase. (16)
4. a) Which is more important-the product or process? Justify your answer. (4)
b) Identify the umbrella activities in software engineering process. (4)
c) With suitable illustration explain SPIRAL model evolutionary software development . (8)
PART B
1) Explain the ways and means for collecting the software requirements and how are they
organized and represented? (16)
2) Describe various prototyping techniques and discuss on analysis sand modeling.(16)
3) a) Discuss in detail the data modeling activity (8)
b) Write briefly about the utility of state transition diagram in analysis modeling activity (8)
4) a) Compare functional and behavioral models. (4)
b) With a suitable diagram explain the elements of the analysis model (8)
c) With an example explain about DFD. (4)
5) a) Explain the extensions of DFD for real time systems. (8)
b) Discuss the features of state transition diagram and its application. (8)
6) a) Explain the feasibility studies. What are the outcomes? Does it have either implicit or
explicit effects on software requirement collection? (8)
b) What is the prototyping technique? How prototype models are prepared for a software
process? Discuss. (8)
7) a) Describe how software requirements are documented? State the importance of
documentation. (8)
b) Explain the software requirement analysis and modeling. (8)
8) Explain the state oriented approaches for representing behavioral specifications of software.
(16)
9) Narrate the importance of software specification of requirements.
Explain a typical SRS structure and its parts. (16)
10) Discuss in detail the FAST method of
a. Requirement elicitation with an example. (8)
b. What is software specification? (8)
11) Write short notes on data modeling? (6)
a. Discuss in detail the basic structure of analysis model. (10)
12) How is SRS for a development project arrived at? (6)
a. What minimum features are required to be present in a good SRS?(10)
PART B
1. What is transform mapping? Explain the process with an illustration. What is its strength and
weakness? (16)
2. a) Explain about the various design concepts considered during design? (12)
b) Write short notes on user interface design process? (4)
3. a) Explain data architectural and procedural design for a software? (8)
b) Describe the design procedure for data acquisition system (8)
4. Explain the importance of user interface design in sale of software. (16)
5. Describe decomposition levels of abstraction and modularity concepts in software design?
(16)
6. What are the characteristics of a good design? Describe different types of coupling and
cohesion. How design evaluation is performed? (16)
7. Draw the basic structure of analysis model and explain each entity in detail.(16)
8. a) discuss in detail about the design process in software development process (8)
b) Justify “Design is not coding and coding is not design”. (8)
9. a) Explain in detail about the characteristics and criteria for a good design. (10)
b) Describe the golden rules for interface design. (6)
10. a) What is the design document?
b) How is it organized?
11. What are the various software architectures available for the developer according to you?
Which is the best and why? (8)
12. What do you mean by modularity in software development? Why is it needed? What is its
strength? (8)
13. a) What are the various model of abstraction? Discuss any two in detail? (8)
b) How does a real time system design differ comparing distributed system design? (8)
14. a) Explain the set of principles for software engineering design? (10)
b) Describe the concept of information hiding. (6)
15. a) What is data flow oriented design. (3)
b) Draw a detailed dataflow diagram for library management. (10)
c) What are the components dataflow oriented design. (3)
16. a) What is SCM? (4)
b) How are SCM tasks practiced over the operational life of software? (6)
c) What is the impact of requirement changes during development of a software product? (6)
PART B
1. Discuss the differences between black box and white box testing [Link] how these
testing models may be used together to test a program schedule. (16)
2. a) What do you mean by system testing? Explain in detail (12)
b) Explain boundary value analysis. (4)
3. a) Justify the importance of testing process(8)
b) Discuss in detail about alpha and beta testing. (8)
4. What do you mean by integration testing? Explain their outcomes: (16)
5. What is black box testing? Is it necessary to perform this? Explain various test activities: (16)
6. Explain the integration testing process and system testing process and discuss their outcomes:
(16)
7. a) What do you mean by system testing? Give a case study of a system testing for operating
system? (8)
b) What do you mean by boundary value analysis? Give two examples of boundary value
testing.(8)
8. Explain black box testing methods and its advantages and disadvantages. (16)
9. Write short notes on
a) Data flow testing. (8)
b) Integration testing. (8)
10. a) Explain the testing procedures for boundary conditions.(8)
b) Describe verification and validation criteria for a software. (8)
11. a) Describe unit testing and integration testing. How test plans are generated? (8)
b) Suggest software testing sequence for a 100% bug free software. Explain. (8)
12. Discuss software failures and faults? What are test coverage criteria? Discuss testing issues:
(16)
13. Explain automated testing tools. How test cases are generated? Discuss when to stop testing?
What is performance testing? Describe.(16)
14. What are the various testing strategies to software testing? Discuss them briefly:(16)
Refactoring is a reorganization process aimed at improving the internal structure of a software system without changing its external behavior. It enhances code readability, reduces complexity, and makes the software easier to maintain, thus improving overall software quality .
Modular design offers several advantages: it simplifies maintenance and debugging, allows independent module development, enhances code readability, supports parallel work on system components, and promotes reusability of modules across different projects .
Cohesion refers to how closely-related the responsibilities of a module are, with higher cohesion generally indicating better quality. Coupling measures the degree of interdependence between modules, where lower coupling is preferable for reducing complexity. Together, high cohesion and low coupling contribute to a design's robustness and maintainability .
Key challenges in implementing software changes include managing the implications of early user identification of faults, dealing with project scope scope adjustments that could require comprehensive efforts, and resolving dependencies within software systems. Additionally, budget constraints and resource limitations can significantly impact project timelines and completion .
A specified testing strategy offers a structured approach to identifying and correcting errors systematically. Well-defined objectives guide the development of a focused and comprehensive testing plan, which can improve product quality and save time by efficiently uncovering errors .
User requirements are assessed and documented in a Software Requirements Specification (SRS) which informs the software design process. The design then translates these requirements into a functional blueprint, providing detailed considerations for data structure, interface, and component design necessary for implementation .
Software architecture provides the conceptual framework for a system, outlining the structure and interaction of components. It ensures consistency, supports scalability, and enhances maintainability by offering a clear structural plan before more detailed design work commences. This architectural layer is crucial in aligning technical strategies with business goals .
Modularity divides a software system into discrete, independently functioning modules. This separation allows for easier maintenance as each module can be updated or debugged independently, without impacting the entire system. It also facilitates reusability, improves code readability, and allows parallel development, thereby enhancing overall software development efficiency .
Regression testing ensures that recent changes have not adversely affected existing functionalities, focusing on re-executing a subset of all test cases. Integration testing, on the other hand, involves testing combined parts of an application to ensure they work together correctly, often using stubs and drivers for simulating missing components .
Mutation testing is powerful because it evaluates the adequacy of a test suite by intentionally introducing faults and checking if they are detected. However, it is resource-intensive, requiring significant computational power due to the large number of mutants generated and needing to be checked against the full test suite. It's better suited for automated testing environments .