Block 1
Block 1
Introduction
Objectives
Evolution of Software Engineering
Software Development Models
1.3.1
1.3.2
1.4
5
6
6
7
1.5
1.6
1.7
1.8
Page Nos.
12
Maturity Levels
Key Process Areas
15
20
20
21
1.0 INTRODUCTION
The field of software engineering is related to the development of software. Large
software needs systematic development unlike simple programs which can be
developed in isolation and there may not be any systematic approach being followed.
In the last few decades, the computer industry has undergone revolutionary changes in
hardware. That is, processor technology, memory technology, and integration of
devices have changed very rapidly. As the software is required to maintain
compatibility with hardware, the complexity of software also has changed much in the
recent past. In 1970s, the programs were small, simple and executed on a simple
uniprocessor system. The development of software for such systems was much easier.
In the present situation, high speed multiprocessor systems are available and the
software is required to be developed for the whole organisation. Naturally, the
complexity of software has increased many folds. Thus, the need for the application
of engineering techniques in their development is realised. The application of
engineering approach to software development lead to the evolution of the area of
Software Engineering. The IEEE glossary of software engineering terminology
defines the Software Engineering as:
(a) The application of a systematic, disciplined, quantifiable approach to the
development, operation and maintenance of software, that is, the application of
engineering to software. (b) The study of approaches in (a).
There is a difference between programming and Software Engineering. Software
Engineering includes activities like cost estimation, time estimation, designing,
coding, documentation, maintenance, quality assurance, testing of software etc.
whereas programming includes only the coding part. Thus, it can be said that
programming activity is only a subset of software development activities. The above
mentioned features are essential features of software. Besides these essential features,
additional features like reliability, future expansion, software reuse etc. are also
considered. Reliability is of utmost importance in real time systems like flight control,
medical applications etc.
An Overview of
Software Engineering
1.1 OBJECTIVES
After going through this unit, you should be able to:
Software Engineering
and its Model
Machine Code
Higher Order Languages
Project Development
Software Reuse
Correcting errors is easy. Though the changes in the software are possible, but,
making changes in large software is extremely difficult task.
2.
3.
4.
Software Standards
Various terms related to software engineering are regularly standardised by
organisations like IEEE (Institute of Electrical and Electronics Engineers), ANSI
(American National Standards Institute), OMG (Object Management Group), CORBA
(Common Object Request Broker Architecture).
IEEE regularly publishes software development standards.
OMG is international trade organisation (http://www.omg.org) and is one of the
largest consortiums in the software industry. CORBA defines the standard capabilities
that allow objects to interact with each other.
2.
The Other Engineering products are visible but the software as such is not
visible. Thats why, it is said that software is developed, but not manufactured.
Though, like other products, it is first designed, then produced, it cannot be
manufactured automatically on an assembly line like other engineering
products. Nowadays, CASE (Computer Aided Software Engineering) tools are
available for software development. Still it depends on the programmers skill
and creativity. The creative skills of the programmer is difficult to quantify and
An Overview of
Software Engineering
Software does not fail in the traditional sense. The engineering products has
wear and tear in the operation. Software can be run any number of times
without wear and tear. The software is considered as failed if:
a) It does not operate correctly.
b) Does not provide the required number of features.
4.
5.
6.
Unlike most of the other engineering products, software can be reused. Once a
piece of code is written for some application, it can be reused.
7.
8.
Thus, the characteristics of software are quite different from other engineering
products. Hence, the software industry is quite different from other industries.
1.3.1
As the application domains of software are becoming complicated and design of big
software without a systematic approach is virtually impossible, the field of software
engineering is increasingly gaining importance. It is now developing like an industry.
Thus, the industry has to answer following or similar queries of clients:
1)
2)
3)
4)
To answer all such queries, software development has adopted a systematic approach.
Software development should not remain an art. Scientific basis for cost, duration,
risks, defects etc. are required. For quality assurance, product qualities and process
qualities and must be made measurable as far as possible by developing metrics for
them.
Software Engineering
and its Model
Deliver the
product
Develop Code
Requirements analysis
Design
Coding
Testing
Maintenance
An Overview of
Software Engineering
A slight modification of the waterfall model is a model with feedback. Once software
is developed and is operational, then the feedback to various phases may be given.
Figure 1.3 depicts the Water Fall Model with feedback.
Requirements Analysis
Design
Coding
Testing
Maintenance
Iteration-2
Water fall Model
This model is useful when less manpower is available for software development and
the release deadlines are tight. It is best suited for in-house product development,
where it is ensured that the user has something to start with. The main disadvantage of
this model is that iteration may never end, and the user may have to endlessly wait for
the final product. The cost estimation is also tedious because it is difficult to relate the
software development cost with the number of requirements.
(iv) Prototyping Model
In this model, a working model of actual software is developed initially. The
prototype is just like a sample software having lesser functional capabilities and low
reliability and it does not undergo through the rigorous testing phase. Developing a
working prototype in the first phase overcomes the disadvantage of the waterfall
model where the reporting about serious errors is possible only after completion of
software development.
10
The working prototype is given to the customer for operation. The customer, after its
use, gives the feedback. Analysing the feedback given by the customer, the developer
refines, adds the requirements and prepares the final specification document. Once the
prototype becomes operational, the actual product is developed using the normal
waterfall model. Figure 1.5 depicts the prototyping model.
The prototype model has the following features:
(i)
It helps in determining user requirements more deeply.
(ii) At the time of actual product development, the customer feedback is available.
(iii) It does consider any types of risks at the initial level.
Software Engineering
and its Model
Feedback
Start
Quick Plan
Quick Design
Develop prototype
Deliver to customer
Finalising Objective: The objectives are set for the particular phase of the
project.
Risk Analysis: The risks are identified to the extent possible. They are analysed
and necessary steps are taken.
Development: Based on the risks that are identified, an SDLC model is selected
and is followed.
Planning: At this point, the work done till this time is reviewed. Based on the
review, a decision regarding whether to go through the loop of spiral again or not
will be decided. If there is need to go, then planning is done accordingly.
In the spiral model, these phases are followed iteratively. Figure 1.6 depicts the
Boehms Spiral Model (IEEE, 1988).
11
An Overview of
Software Engineering
As the name suggests, this model gives a quick approach for software development
and is based on a linear sequential flow of various development processes. The
software is constructed on a component basis. Thus multiple teams are given the task
of different component development. It increases the overall speed of software
development. It gives a fully functional system within very short time. This approach
emphasises the development of reusable program components. It follows a modular
approach for development. The problem with this model is that it may not work when
technical risks are high.
2)
3)
12
organisation should have to reach different levels of process maturity. This approach
evaluates the global effectiveness of a software company.
Software Engineering
and its Model
13
An Overview of
Software Engineering
2)
3)
4)
5)
6)
Level 3 KPAs:
14
1)
2)
3)
4)
5)
6)
7)
Peer reviews (PR): They remove defects from software engineering work
products.
Level 4 KPAs:
1)
2)
Software Engineering
and its Model
Level 5 KPAs:
1)
Defect Prevention (DP): It discovers the causes of defects and devises the
techniques which prevent them from recurring.
2)
3)
&
1)
2)
15
An Overview of
Software Engineering
Design
Coding
Software Testing
Maintenance.
Primary Design Phase: In this phase, the system is designed at block level.
The blocks are created on the basis of analysis done in the problem
identification phase. Different blocks are created for different functions
emphasis is put on minimising the information flow between blocks. Thus, all
activities which require more interaction are kept in one block.
ii)
Secondary Design Phase: In the secondary design phase the detailed design of
every block is performed.
The input to the design phase is the Software Requirements Specification (SRS)
document and the output is the Software Design Document (SDD). The general tasks
involved in the design process are the following:
i)
ii)
iii)
iv)
v)
vi)
vii)
System reviews.
The Software design is the core of the software engineering process and the first of
three important technical activities, viz., design, coding, and testing that are required
to build software. The design should be done keeping the following points in mind.
16
i)
ii)
iii)
iv)
It should be maintainable.
Software Engineering
and its Model
The following points should be kept in mind while performing the design:
i)
Practicality: This ensures that the system is stable and can be operated by a
person of average intelligence.
ii)
iii)
iv)
Coding
The input to the coding phase is the SDD document. In this phase, the design
document is coded according to the module specification. This phase transforms the
SDD document into a high level language code. At present major software companies
adhere to some well specified and standard style of coding called coding standards.
Good coding standards improve the understanding of code. Once a module is
developed, a check is carried out to ensure that coding standards are followed. Coding
standards generally give the guidelines about the following:
i)
ii)
iii)
Modification history
iv)
Testing
Testing is the process of running the software on manually created inputs with the
intention to find errors. In the process of testing, an attempt is made to detect errors, to
correct the errors in order to develop error free software. The testing is performed
keeping the users requirements in mind and before the software is actually launched
on a real system, it is tested. Testing is the process of executing a program with the
intention of finding errors.
Normally, while developing the code, the software developer also carries out some
testing. This is known as debugging. This unearths the defects that must be removed
from the program. Testing and debugging are different processes. Testing is meant for
finding the existence of defects while debugging stands for locating the place of errors
and correcting the errors during the process of testing. The following are some
guidelines for testing:
i)
Test the modules thoroughly, cover all the access paths, generate enough data to
cover all the access paths arising from conditions.
17
An Overview of
Software Engineering
ii)
iii)
Specifically create data for conditional statements. Enter data in test file which
would satisfy the condition and again test the script.
iv)
ii)
Good test cases should be designed which have a probability of finding, as yet
undiscovered error.
iii)
ii)
iii)
Code Testing: The code testing strategy examines the logic of the system. In
this, the analyst develops test cases for every instruction in the code. All the
paths in the program are tested. This test does not guarantee against software
failures. Also, it does not indicate whether the code is according to
requirements or not.
ii)
The objective of testing is to design test cases that systematically uncover different
classes of errors and do so with the minimum amount of time and effort. Testing
cannot show the absence of errors. It can only find the presence of errors. The test
case design is as challenging as software development. Still, however effective the
design is, it cannot remove 100% errors. Even, the best quality software are not 100 %
error free. The reliability of software is closely dependent on testing.
Some testing techniques are the black box and the white box methods.
White box testing: This method, also known as glass box testing, is performed early
in the testing process. Using this, the software engineer can derive a tests that
18
guarantees that all independent paths within the module have been exercised at least
once. It has the following features:
i)
ii)
Execute all loops at their boundaries and within their operational bounds.
iii)
Software Engineering
and its Model
Black box testing: This is applied during the later stage of testing. It enables the
software developer to derive a set of input conditions that will fully exercise the
functional requirements of a program. It enables him to find errors like incorrect or
missing functions, interface errors, data structures or external data base access errors
and performance errors etc.
Maintenance
Maintenance in the normal sense means correcting the problems caused by wear and
tear, but software maintenance is different. Software is either wrong in the beginning
or later as some additional requirements have been added. Software maintenance is
done because of the following factors.
i)
To rectify the errors which are encountered during the operation of software.
ii)
iii)
Corrective Maintenance
ii)
Adaptive Maintenance
iii)
Perfective Maintenance
ii)
No standards for maintenance have been developed and the area is relatively
unexplored area.
iii)
iv)
The various phases of the software development life cycle are tightly coupled, and the
output of one phase governs the activity of the subsequent phase. Thus, all the phases
need to be carefully planned and managed and their interaction requires close
monitoring. The project management becomes critical in larger systems.
19
An Overview of
Software Engineering
1.6 SUMMARY
Software engineering covers the entire range of activities used to develop software.
The activities include requirements analysis, program development using some
recognised approach like structured programming, testing techniques, quality
assurance, management and implementation and maintenance. Further, software
engineering expects to address problems which are encountered during software
development.
1.7 SOLUTIONS/ANSWERS
Check Your Progress 1
1)
2)
Out of all SDLC models, the most popular one is waterfall model. But, it insists
on having a complete set of requirements before commencement of design. It is
often difficult for the customer to state all requirements easily. The iterative
enhancement model, though better than waterfall model, in customised software
development where the client has to provide and approve the specification, it
may lead to time delays for software development. Prototype model provides
better understanding of customers needs and is useful for large systems, but, in
this, the use of inefficient inaccurate or dummy functions may produce
undesired results. The spiral model accommodates good features of other
models. In this, risk analysis and validation steps eliminate errors in early
phases of development. But, in this model, there is a lack of explicit process
guidance in determining objectives.
3)
Requirement analysis
Design
Coding
Testing
Maintenance
20
1)
2)
Level-1
2)
Software Engineering
and its Model
Reference websites
http://www.rspa.com
http://www.ieee.org
http://standards.ieee.org
21
An Overview of
Software Engineering
UNIT 2
PRINCIPLES OF SOFTWARE
REQUIREMENTS ANALYSIS
Structure
2.0
2.1
2.2
Introduction
Objectives
Engineering the Product
2.2.1
2.2.2
2.2.3
2.2.4
2.2.5
2.3
Page Nos.
Requirements Engineering
Types of Requirements
Software Requirements Specification (SRS)
Problems in SRS
Requirements Gathering Tools
22
23
23
26
34
2.5
2.6
2.7
2.8
Software Metrics
Summary
Solutions/Answers
Further Readings
35
36
37
38
2.0 INTRODUCTION
In the design of software, the first step is to decide about the objectives of software.
This is the most difficult aspect of software design. These objectives, which the
software is supposed to fulfill are called requirements.
The IEEE [IEEE Std 610.12] definition of requirement is:
1.
A condition or capability needed by a user to solve a problem or achieve an
objective.
2.
A condition or capability that must be met or possessed by a system component,
to satisfy a contract formally imposed document.
3.
A documented representation of a condition or capability as in (1) or (2).
Thus, requirements specify what the system is supposed to do? These requirements
are taken from the user. Defining the requirements is most elementary & most
difficult part of system design, because, at this level, sometimes, the user himself is
not clear about it. Many software projects have failed due to certain requirements
specification issues. Thus, overall quality of software product is dependent on this
aspect. Identifying, defining, and analysing the requirements is known as requirements
analysis. Requirements analysis includes the following activities:
1. Identification of end users need.
2. Preparation of a corresponding document called SRS (Software Requirements
Specification).
22
Principles of Software
Requirements Analysis
2.1 OBJECTIVES
After going through this unit, you should be able to:
2.2.1
Requirements Engineering
2.2.2
Types of Requirements
23
An Overview of
Software Engineering
Functional requirements: They define the factors like, I/O formats, storage
structure, computational capabilities, timing and synchronization.
ii)
2.2.3
External Interfaces of the system: They identify the information which is to flow
from and to to the system.
Functional and non-functional requirements of the system. They stand for the
finding of run time requirements.
Design constraints:
Purpose
Scope
Definitions, acronyms, and abbreviations
References
Overview
2. Overall description
2.1
2.2
2.3
2.4
2.5
Product perspective
Product functions
User characteristics
Constraints
Assumptions and dependencies
3. Specific requirements
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
External Interfaces
Functional requirements
Performance requirements
Logical Database requirements
Design Constraints
Software system attributes
Organising the specific requirements
Additional Comments
4. Supporting information
4.1
4.2
24
Principles of Software
Requirements Analysis
There are various features that make requirements analysis difficult. These are
discussed below:
1. Complete requirements are difficult to uncover. In recent trends in engineering,
the processes are automated and it is practically impossible to understand the
complete set of requirements during the commencement of the project itself.
2. Requirements are continuously generated. Defining the complete set of
requirements in the starting is difficult. When the system is put under run, the new
requirements are obtained and need to be added to the system. But, the project
schedules are seldom adjusted to reflect these modifications. Otherwise, the
development of software will never commence.
3. The general trends among software developer shows that they have over
dependence on CASE tools. Though these tools are good helping agents, over
reliance on these Requirements Engineering Tools may create false requirements.
Thus, the requirements corresponding to real system should be understood and
only a realistic dependence on tools should be made.
4. The software projects are generally given tight project schedules. Pressure is
created from customer side to hurriedly complete the project. This normally cuts
down the time of requirements analysis phase, which frequently lead to
disaster(s).
5. Requirements Engineering is communication intensive. Users and developers
have different vocabularies, professional backgrounds and psychology. User
writes specifications in natural language and developer usually demands precise
and well-specified requirement.
6. In present time, the software development is market driven having high
commercial aspect. The software developed should be a general purpose one to
satisfy anonymous customer, and then, it is customised to suit a particular
application.
7. The resources may not be enough to build software that fulfils all the customers
requirements. It is left to the customer to prioritise the requirements and develop
software fulfilling important requirements.
2.2.5
The requirements gathering is an art. The person who gathers requirements should
have knowledge of what and when to gather information and by what resources. The
requirements are gathered regarding organisation, which include information
regarding its policies, objectives, and organisation structure, regarding user staff. It
includes the information regarding job function and their personal details, regarding
the functions of the organisation including information about work flow, work
schedules and working procedure.
The following four tools are primarily used for information gathering:
1. Record review: A review of recorded documents of the organisation is
performed. Procedures, manuals, forms and books are reviewed to see format and
functions of present system. The search time in this technique is more.
2. On site observation: In case of real life systems, the actual site visit is performed
to get a close look of system. It helps the analyst to detect the problems of existing
system.
25
An Overview of
Software Engineering
2.3.1
A model showing bare minimum requirements is called Essential Model. It has two
components.
1. Environmental model: It indicates environment in which system exists. Any big
or small system is a sub-system of a larger system. For example, if software is
developed for a college, then college will be part of University. If it is developed
for University, the University will be part of national educational system. Thus,
when the model of the system is made these external interfaces are defined. These
interfaces reflect systems relationship with external universe (called
environment). The environment of a college system is shown in Figure 2.1.
Courses offered
to students
Department
College
Interfaces to
external systems
University
National Educational System
In environmental model, the interfaces should clearly indicate the inflow and outflow
of information from the system.
26
Principles of Software
Requirements Analysis
2.3.2
Input data
Level 1
Processing
Input data
External
Entity
Intermediate data
External
Entity
Input data
Level 2
Processing
Output data
External
Entity
Intermediate data
Level 3
Processing
Data store
Output data
External
Entity
27
An Overview of
Software Engineering
In this diagram, the external entities provide input data for the processing. During the
processing, some intermediate data is generated. After final processing, the final
output data is generated. The data store is the repository of data.
The structured approach of system design requires extensive modeling of the system.
Thus, instead of making a complete model exhibiting the functionality of system, the
DFDs are created in a layered manner. At the first layer, the DFD is made at block
level and in lower layers, the details are shown. Thus, level 0 DFD makes a
fundamental system (Figure 2.3).
I1
Output
Process A
I2
DFDs can represent the system at any level of abstraction. DFD of 0 level views
entire software element as a single bubble with indication of only input and output
data. Thus, 0 level DFD is also called as Context diagram. Its symbols are shown in
Figure 2.4.
Symbol
Name
Data Flow
Process
Description
Represents the connectivity between
various processes
Performs some processing of input data
External
Entity
Data Store
Repository of data
2.3.3
28
Principles of Software
Requirements Analysis
1. The system modeling is undertaken with some simplifying assumptions about the
system. Though these assumptions limit the quality of system model, it reduces
the system complexity and makes understanding easier. Still, the model
considers all important, critical and material factors. These assumptions are made
regarding all aspects like processes, behaviors, values of inputs etc.
2. The minute details of various components are ignored and a simplified model is
developed. For example, there may be various types of data present in the system.
The type of data having minute differences are clubbed into single category, thus
reducing overall number of data types.
3. The constraints of the system are identified. Some of them may be critical. They
are considered in modeling whereas others may be ignored. The constraints may
be because of external factors, like processing speed, storage capacity, network
features or operating system used.
4. The customers mentioned preferences about technology, tools, interfaces, design,
architecture etc. are taken care of.
Example 1: The 0th and 1st levels of DFD of Production Management System are
shown in Figure 2.5 (a) and (b)
Let us discuss the data flow diagram of Production Management System.
Production Planning
Sales
Inventory
Planning
report
PMS
Product
Order
Finished goods
Material
29
An Overview of
Software Engineering
Machine Code
Process table
Process type
1.0
Daily
Planning
List detail
Plan detail
Job Card
2.0
Listing
Master table
Machine detail
3.0
Production
Progress table
Job Card
Acknowledgement
4.0
Material
Billing
Manager
Product detail
Product detail
2.3.4
Data Dictionary
This is another tool of requirement analysis which reduces complexity of DFD. A data
dictionary is a catalog of all elements of a system. DFD depicts flow of data whereas
data dictionary gives details of that information like attribute, type of attribute, size,
names of related data items, range of values, data structure definitions etc. The name
specifies the name of attribute whose value is collected. For example, fee deposit may
be named as FD and course opted may be named as CO.
Related data items captures details of related attributes. Range of values store total
possible values of that data. Data structure definition captures the physical structure of
data items.
Some of the symbols used in data dictionary are given below:
X= [a/b]
X=a
X=a+b
30
X=y{a}z
|
**
@
()
Principles of Software
Requirements Analysis
Example 2: The data dictionary of payroll may include the following fields:
PAYROLL
[Payroll Details]
Employee name
* name of employee *
Employee id number
Basic Salary
Additional allowances =
Employee name
Employee address
2.3.5
E-R Diagram
Consists
of
students
31
An Overview of
Software Engineering
offers
College
Course
College
Course
offers
Mandatory - 1 cardinality
Mandatory many (m) cardinality, n is
n
highest range
Optional 0 or 1 cardinality
32
Roll no.
Principles of Software
Requirements Analysis
add
Name ,
Fathers name
class
Student
marks
33
An Overview of
Software Engineering
2.
3.
An existing program that performs all of the desired functions but additional
features are added for improvement.
Prototype is developed so that customers, users and developers can learn more about
the problem. Thus, prototype serves as a mechanism for identifying software
requirements. It allows the user to explore or criticise the proposed system before
developing a full scale system.
2.4.1
Types of Prototype
Broadly, the prototypes are developed using the following two techniques:
Throw away prototype: In this technique, the prototype is discarded once its purpose
is fulfilled and the final system is built from scratch. The prototype is built quickly to
enable the user to rapidly interact with a working system. As the prototype has to be
ultimately discarded, the attention on its speed, implementation aspects,
maintainability and fault tolerance is not paid. In requirements defining phase, a less
refined set of requirements are hurriedly defined and throw away prototype is
constructed to determine the feasibility of requirement, validate the utility of function,
uncover missing requirements, and establish utility of user interface. The duration of
prototype building should be as less as possible because its advantage exists only if
results from its use are available in timely fashion.
Evolutionary Prototype: In this, the prototype is constructed to learn about the
software problems and their solutions in successive steps. The prototype is initially
developed to satisfy few requirements. Then, gradually, the requirements are added in
the same prototype leading to the better understanding of software system. The
prototype once developed is used again and again. This process is repeated till all
requirements are embedded in this and the complete system is evolved.
According to SOMM [96] the benefits of developing prototype are listed below:
34
1.
2.
3.
4.
Principles of Software
Requirements Analysis
Stop
Requirements
Gathering
Quick
Design
Engineering product
Building
Prototype
Customer
evaluation of
prototype
Refine Prototype
2.4.2
Problems of Prototyping
2.4.3
Advantages of Prototyping
35
An Overview of
Software Engineering
2.6 SUMMARY
This unit discusses various aspects of software requirements analysis, the significance
of use of engineering approach in the software design, various tools for gathering the
requirements and specifications of prototypes.
Due to the complexity involved in software development, the engineering approach is
being used in software design. Use of engineering approach in the area of
requirements analysis evolved the field of Requirements Engineering. Before the
actual system design commences, the system architecture is modeled. Entityrelationship (E-R) diagram is detailed logical representation of data for an
36
Principles of Software
Requirements Analysis
2.7 SOLUTIONS/ANSWERS
Check Your Progress 1
1) In the present era, the development of software has become very systematic and
the specification of requirements is very important. Accordingly, to analyse
requirements completely, the engineering approach is used in requirements
analysis.
Dynamic programming
2) High level languages that are used for prototyping are as follows:
Java, Prolog, Small talk, Lisp etc.
37
An Overview of
Software Engineering
Reference Websites:
http://standards.ieee.org
http://www.rspa.com
38
Software Design
Page Nos.
Introduction
Objectives
Data Design
Architectural Design
Modular Design
Interface Design
Design of Human Computer Interface
Summary
Solutions/ Answers
Further Readings
39
39
39
42
43
46
49
51
51
52
3.0 INTRODUCTION
Software design is all about developing blue print for designing workable software.
The goal of software designer is to develop model that can be translated into software.
Unlike design in civil and mechanical engineering, software design is new and
evolving discipline contrary classical building design etc. In early days, software
development mostly concentrated on writing code. Software design is central to
software engineering process. Various design models are developed during design
phase. The design models are further refined to develop detailed design models which
are closely related to the program.
3. 1 OBJECTIVES
After going through this unit, you should be able to:
design data;
understand architectural design;
develop modular design, and
know the significance of Human Computer Interface.
Designing of Data
Architectural design which gives a holistic architecture of the software product
Design of cohesive and loosely coupled module
Design of interface and tips for good interface design
Design of Human interface
39
An Overview of
Software Engineering
actual realisation of the software. The goal of software design is to translate user
requirements into an implementable program.
Software design is the only way through which we can translate user requirements to
workable software. In contrary to designing a building software design is not a fully
developed and matured process. Nevertheless the techniques available provides us
tools for a systematic approach to the design of software. Figure 3.1 depicts the
process of software design.
Information
model
User
requirements
Data design
Functional
model
System design
Requirements
Procedural
design
Code
During the process of software design, the information model is translated to data
design. Functional model and behavioural model are translated to architectural design,
which defines major component of the software. Keeping in view of the importance of
design, it should be given due weightage before rushing to the coding of software.
Software design forms the foundation for implementation of a software system and
helps in the maintenance of software in future too. Software quality and software
design process are highly interrelated. Quality is built into the software during the
design phase.
High level design gives a holistic view of the software to be built, where as low level
refinements of the design are very closely related to the final source code. A good
design can make the work of programmer easy and hardly allow the programmer to
forget the required details. Sufficient time should be devoted to design process to
ensure good quality software.
The following are some of the fundamentals of design:
Data design is the first and the foremost activity of system Design. Before going into
the details of data design, let us discuss what is data? Data describes a real-world
information resource that is important for the application. Data describes various
entities like customer, people, asset, student records etc.
Identifying data in system design is an iterative process. At the highest level, data is
defined in a very vague manner. A high level design describes how the application
handles these information resources. As we go into more details, we focus more on
the types of data and its properties. As you keep expanding the application to the
business needs or business processes, we tend to focus more on the details.
40
Data design
Software Design
Architectural design
Modular Design
Human Computer Interface Design
Figure 3.2 : Technical aspects of design
The primary objective of data design is to select logical representation of data items
identified in requirement analysis phase. Figure 3.2 depicts the technical aspects of
design. As we begin documenting the data requirements for the application, the
description for each item of data typically include the following:
Data Sructure
A data structure defines a logical relationship between individual elements of a group
of data. We must understand the fact that the structure of information affects the
design of procedures/algorithms. Proper selection of data structure is very important
in data designing. Simple data structure like a scalar item forms the building block of
more sophisticated and complex data structures.
A scalar item is the simplest form of data. For example, January (Name of the Month),
where as the collection of months in a year form a data structure called a vector item.
Example:
Month as string
months_in_year = [Jan, , Dec]
The items in the vector called array is sequenced and index in a manner so as to retive
particular element in the arry.
Month_in_year[4] will retrieve Apr
The vector items are in contiguous memory locations in the computer memory. There
are other variety of lists which are non-contiguously stored. These are called linked
lists. There are other types of data structures known as hierarchical data structure such
as tree. Trees are implemented through linked lists.
41
An Overview of
Software Engineering
True
False
S1
S2
S5
S3
S4
S6
Problem
S1
S2
S3
S4
S5
S6
Figure 3.3: Problem, Solutions and Architecture
Accounts
Receivable System
Fixed Asset
Management
System
Sundry Debtors
42
Software Design
The number of level of component in the structure is called depth and the number of
component across the horizontal section is called width. The number of components
which controls a said component is called fan-in i.e., the number of incoming edges to
a component. The number of components that are controlled by the module is called
fan-out i.e., the number of outgoing edges.
S1
S0
S1
S2
S5
S5
S2
The architectural design provides holistic picture of the software architecture and
connectivity between different program components (refer to Figure 3.6).
43
An Overview of
Software Engineering
During designing of software one must keep a balance between number of modules
and integration cost. Although, more numbers of modules make the software product
more manageable and maintainable at the same time, as the number of modules
increases, the cost of integrating the modules also increases.
Modules are generally activated by a reference or through a external system interrupt.
Activation starts life of an module. A module can be classified three types depending
activation mechanism.
High cohesion
Undesirable
Desirable
Figure 3.7 : Cohesion
44
Logical : Modules perform series of action, but are selected by a calling module.
Procedural : Modules perform a series of steps. The elements in the module must
takeup single control sequence and must be executed in a specific order.
Communicational : All elements in the module is executed on the same data set
and produces same output data set.
Sequential : Output from one element is input to some other element in the
module. Such modules operates on same data structure.
Software Design
Difficult to maintain
Tends to depend on other module to perform certain tasks
Difficult to understand.
Coupling
In computer science, coupling is defined as degree to which a module interacts and
communicates with another module to perform certain task. If one module relies on
another the coupling is said to be high. Low level of coupling means a module doses
not have to get concerned with the internal details of another module and interact with
another module only with a suitable interface.
Loosely coupled
Tightly coupled
Desirable
Undesirable
Figure 3.8 : Coupling
The types of coupling from best (lowest level of coupling) to worst (high level of
coupling) are described below:
Control coupling: One module control logic flow of another module. For
example, passing a flag to another module which determines the sequence of
action to be performed in the other module depending on the value of flag such as
true or false.
Coupling and cohesion are in contrast to each other. High cohesion often correlates
with low coupling and vice versa.
In computer science, we strive for low-coupling and high cohesive modules.
The following are the disadvantages of high coupling:
Ripple effect.
Difficult to reuse. Dependent modules must be included.
Difficult to understand the function of a module in isolation.
45
An Overview of
Software Engineering
Figure 3.9 depicts highly cohesive and loosely coupled system. Figure 3.10 depicts a
low cohesive and tightly coupled system.
1)
2)
3)
True
False
46
Think of the days of text based system where user had to type command on the
command line to execute a simple task.
Software Design
The above command line interface executes a program prog1.exe with a input i=2
with message during execution set to on. Although such command line interface gives
liberty to the user to run a program with a concise command. It is difficult for a novice
user and is error prone. This also requires the user to remember the command for
executing various commands with various details of options as shown above.
Example of Menu with option being asked from the user (refer to Figure 3.11).
To run the program select the
option below
1.
2.
3.
4.
5.
Option 1
Option 2
Option 3
Back
Exit program
This simple menu allow the user to execute the program with option available as a
selection and further have option for exiting the program and going back to previous
screen. Although it provide grater flexibility than command line option and does not
need the user to remember the command still user cant navigate to the desired option
from this screen. At best user can go back to the previous screen to select a different
option.
Modern graphical user interface provides tools for easy navigation and interactivity to
the user to perform different tasks.
The following are the advantages of a Graphical User Interface (GUI):
Various information can be display and allow user to switch to different task
directly from the present screen.
Useful graphical icons and pull down menu reduces typing effort by the user.
47
An Overview of
Software Engineering
48
Allow user to undo the current command. This helps in undoing mistake
committed by the user.
Use proper navigational scheme for easy navigation within the application.
The text appearing on the screen are primary source of information exchange
between the user and the system. Avoid using abbreviation. Be very specific in
communicating the mistake to the user. If possible provide the reason for error.
Navigation within the screen is important and is specially useful for data entry
screen where keyboard is used intensively to input data.
Expect the user to make mistake and provide appropriate measure to handle such
errors through proper interface design.
Avoid high density screen layout. Keep significant amount of screen blank.
Make sure an accidental double click instead of a single click may does some
thing unexpected.
Provide file browser. Do not expect the user to remember the path of the required
file.
Provide key-board shortcut for frequently done tasks. This saves time.
Warn user about critical task, like deletion of file, updating of critical information.
Programmers are not always good interface designer. Take help of expert
professional who understands human perception better than programmers.
Include all possible features in the application even if the feature is available in
the operating system.
Software Design
A key board
A Computer Mouse
A Touch Screen (if equipped with)
A program on your Windows machine that includes a trash can, icons of various
programs, disk drives, and folders
System Model/
Design model
Interface design
What do these things have in common? These are all human-computer interfaces
which were designed to make it easier to accomplish things with a computer. If we
recall the early days computer, some one had to remember long cryptic strings of
commands in accomplish simplest to simplest thing with a computer like coping a file
from one folder to another or deleting a file etc. It is due to the evolution of humancomputer interface and human-computer interface designers thats now being
accomplished with the click of a mouse.
The overall process of design leads to the translation of design models to user model.
Human-Computer Interface design goal is to discover the most efficient way to design
interfaces for human interaction and understandable electronic messages. A lot of
research is taking place in this area that even helps physically disabled person to
operate computer as easily as a normal person. Figure 3.12 depicts the process of
interface design.
A branch of computer science is devoted to this area, with recommendations for the
proper design of menus, icons, forms, messages, dialogue as well as data display. The
user friendliness of the program we are using is a result of interface design. The
buttons, pull down menu, context sensitive help have been designed to make it easy
for you to access the program.
The process of HCI design begins with the a creation of a model of system function as
perceived by the end user. These models are designed by delineating them from
design issues and program structure. HCI establishes a user model of the overall
system.
The following are some of the principles of Good Human computer interface design:
Diversity: Consider the types of user frequently use the system. The designer must
consider the types of users ranging from novice user, knowledgeable but intermittent
49
An Overview of
Software Engineering
user and expert frequent user. Accommodating expectation of all types of user is
important. Each type of user expects the screen layout to accommodate their desires,
novices needing extensive help where as expert user want to accomplish the task in
quickest possible time.
For example providing a command such as ^P (control P) to print a specific report as
well as a printer icon to do the same job for the novice user.
Rules for Human Computer Interface Design:
1. Consistency :
o Interface is deigned so as to ensure consistent sequences of actions for
similar situations. Terminology should be used in prompts, menus, and
help screens should be identical. Color scheme, layout and fonts should
be consistently applied throughout the system.
2. Enable expert users to use shortcuts:
Use of short cut increases productivity. Short cut to increase the pace of
interaction with use of, special keys and hidden commands.
3. Informative feedback :
o
Screen design should be such that users are unlikely to make a serious
error. Highlight only actions relevant to current context. Allowing user
to select options rather than filling up details. Dont allow alphabetic
characters in numeric fields
In case of error, it should allow user to undo and offer simple,
constructive, and specific instructions for recovery.
Allow reversal of action : Allow user to reverse action committed. Allow user to
migrate to previous screen.
6. Reduce effort of memorisation by the user :
o
50
memory by having to remember too many things (icons, buttons and menus provide
us with knowledge in the world. The following are the mappings to be done:
Mapping between the information that is visible and the interpretation of the
system state. For example, it should be obvious what the function of a button or
menu is. Do not try to built your own meaning to the commonly used icons
instead use conventions already established for it. Never use a search icon to print
a page.
Software Design
3.7 SUMMARY
Design is a process of translating analysis model to design models that are further
refined to produce detailed design models. The process of refinement is the process of
elaboration to provides necessary details to the programmer. Data design deals with
data structure selection and design. Modularity of program increases maintainability
and encourages parallel development. The aim of good modular design is to produce
highly cohesive and loosely coupled modules. Independence among modules is
central to modularity. Good user interface design helps software to interact effectively
to external environment. Tips for good interface design helps designer to achieve
effective user interface.
Quality is built into software during the design of software. The final word is: Design
process should be given due weightage before rushing for coding.
3.8 SOLUTIONS/ANSWERS
Check Your Progress 1
1)
In building a design, where the quality of structural strength and other aspects
are determined by the design of the building. In software design, the design
process goes through a series of refinement process and reviews, to see whether
the user requirements and other quality parameters are properly not reflected in
the design model. A good design is more likely to deliver good software. The
process of getting it right starts from the software design stage.
51
An Overview of
Software Engineering
2) True.
3) Software design is the first step of translating user requirement to technical
domain of software development. Without designing there is always a risk of
designing an unstable system. Without design we cant review the requirements of
the product until it is delivered to the user. Design helps in future maintenance of
the system.
Reference Websites
http://www.ieee.org
http://www.rspa.com
http://sdg.csail.mit.edu
52
Software Testing
Introduction
Objectives
Basic Terms used in Testing
4.2.1
4.2.2
4.2.3
4.3
4.4
4.5
4.6
4.7
4.8
Page Nos.
53
54
54
Input Domain
Black Box and White Box testing Strategies
Cyclomatic Complexity
Testing Activities
Debugging
Testing Tools
Summary
Solutions/Answers
Further Readings
64
65
67
68
69
69
4.0 INTRODUCTION
Testing means executing a program in order to understand its behaviour, that is,
whether or not the program exhibits a failure, its response time or throughput for
certain data sets, its mean time to failure, or the speed and accuracy with which users
complete their designated tasks. In other words, it is a process of operating a system or
component under specified conditions, observing or recording the results, and making
an evaluation of some aspect of the system or component. Testing can also be
described as part of the process of Validation and Verification.
Validation is the process of evaluating a system or component during or at the end of
the development process to determine if it satisfies the requirements of the system, or,
in other words, are we building the correct system?
Verification is the process of evaluating a system or component at the end of a phase
to determine if it satisfies the conditions imposed at the start of that phase, or, in other
words, are we building the system correctly?
Software testing gives an important set of methods that can be used to evaluate and
assure that a program or system meets its non-functional requirements.
To be more specific, software testing means that executing a program or its
components in order to assure:
The purpose of testing is to show that the program has errors. The aim of most testing
methods is to systematically and actively locate faults in the program and repair them.
Debugging is the next stage of testing. Debugging is the activity of:
Determining the exact nature and location of the suspected error within
the program and
Fixing the error. Usually, debugging begins with some indication of the
existence of an error.
53
An Overview of
Software Engineering
4.1 OBJECTIVES
After going through this unit, you should be able to:
Testing can only be used to show the presence of errors, but never the absence
or errors.
A combination of different verification & validation (V&V) methods outprform
any single method alone.
Developers are unsuited to test their own code.
Approximately 80% of the errors are found in 20% of the code.
Partition testing, that is, methods that partition the input domain or the program
and test according to those partitions. This is better than random testing.
The adequacy of a test suite for coverage criterion can only be defined
intuitively.
54
Inputs passed in as parameters; Variables that are inputs to function under test
can be: (i) Structured data such as linked lists, files or trees, as well as atomic
data such as integers and floating point numbers;
(ii)
Software Testing
#define PI 3.14159
double circumference(double radius)
{
return 2*PI*radius;
}
In general, the inputs to a program or a function are stored in program variables. A
program variable may be:
4.2.2 Black Box and White Box Test Case Selection Strategies
Black box Testing: In this method, where test cases are derived from the
functional specification of the system; and
White box Testing: In this method, where test cases are derived from the
internal design specifications or actual code (Sometimes referred to as Glassbox).
Black box test case selection can be done without any reference to the program design
or the program code. Test case selection is only concerned with the functionality and
features of the system but not with its internal operations.
The real advantage of black box test case selection is that it can be done before
the design or coding of a program. Black box test cases can also help to get the
design and coding correct with respect to the specification. Black box testing
methods are good at testing for missing functions or program behavior that
deviates from the specification. Black box testing is ideal for evaluating
products that you intend to use in your systems.
The main disadvantage of black box testing is that black box test cases cannot
detect additional functions or features that have been added to the code. This is
especially important for systems that need to be safe (additional code may
interfere with the safety of the system) or secure (additional code may be used
to break security).
White box test cases are selected using the specification, design and code of the
program or functions under test. This means that the testing team needs access to the
internal designs or code for the program.
The chief advantage of white box testing is that it tests the internal details of the
code and tries to check all the paths that a program can execute to determine if a
problem occurs. White box testing can check additional functions or code that
has been implemented, but not specified.
The main disadvantage of white box testing is that you must wait until after
design and coding of the programs of functions under test have been completed
in order to select test cases.
55
An Overview of
Software Engineering
Boundary-value Analysis;
Equivalence Partitioning.
We will also study State Based Testing, which can be classified as opaque box
selection strategies that is somewhere between black box and white box selection
strategies.
Boundary-value-analysis
The basic concept used in Boundary-value-analysis is that if the specific test cases are
designed to check the boundaries of the input domain then the probability of detecting
an error will increase. If we want to test a program written as a function F with two
input variables x and y., then these input variables are defined with some boundaries
like a1 x a2 and b1 y b2. It means that inputs x and y are bounded by two
intervals [a1, a2] and [b1, b2].
Test Case Selection Guidelines for Boundary Value Analysis
The following set of guidelines is for the selection of test cases according to the
principles of boundary value analysis. The guidelines do not constitute a firm set of
rules for every case. You will need to develop some judgement in applying these
guidelines.
1.
2.
3.
4.
5.
If an input condition specifies a range of values, then construct valid test cases
for the ends of the range, and invalid input test cases for input points just
beyond the ends of the range.
If an input condition specifies a number of values, construct test cases for the
minimum and maximum values; and one beneath and beyond these values.
If an output condition specifies a range of values, then construct valid test cases
for the ends of the output range, and invalid input test cases for situations just
beyond the ends of the output range.
If an output condition specifies a number of values, construct test cases for the
minimum and maximum values; and one beneath and beyond these values.
If the input or output of a program is an ordered set (e.g., a sequential file, linear
list, table), focus attention on the first and last elements of the set.
56
Given sides (A; B; C) for a scalene triangle, the sum of any two sides is greater
than the third and so, we have boundary conditions A + B > C, B + C > A and A
+ C > B.
Given sides (A; B; C) for an isosceles triangle two sides must be equal and so
we have boundary conditions A = B, B = C or A = C.
Continuing in the same way for an equilateral triangle the sides must all be of
equal length and we have only one boundary where A = B = C.
For right-angled triangles, we must have A2+B2 = C2.
On the basis of the above boundary conditions, test cases are designed as follows
(Table 4.1):
Software Testing
Test case
1
2
3
4
5
6
7
8
9
10
x
100
50
40
3
10
2
100
1
2
1
y
100
3
50
4
10
2
50
2
3
3
z
100
50
40
5
10
5
100
3
4
1
Expected Output
Equilateral triangle
Isosceles triangle
Equilateral triangle
Right-angled triangles
Equilateral triangle
Isosceles triangle
Scalene triangle
Non-triangles
Scalene triangle
Isosceles triangle
Equivalence Partitioning
Equivalence Partitioning is a method for selecting test cases based on a partitioning of
the input domain. The aim of equivalence partitioning is to divide the input domain of
the program or module into classes (sets) of test cases that have a similar effect on the
program. The classes are called Equivalence classes.
Equivalence Classes
An Equivalence Class is a set of inputs that the program treats identically when the
program is tested. In other words, a test input taken from an equivalence class is
representative of all of the test inputs taken from that class. Equivalence classes are
determined from the specification of a program or module. Each equivalence class is
used to represent certain conditions (or predicates) on the input domain. For
equivalence partitioning it is usual to also consider valid and invalid inputs. The terms
input condition, valid and invalid inputs, are not used consistently. But, the following
definition spells out how we will use them in this subject. An input condition on the
input domain is a predicate over the values of the input domain. A Valid input to a
program or module is an element of the input domain that is expected to return a nonerror value. An Invalid input is an input that is expected to return an error value.
Equivalence partitioning is then a systematic method for identifying interesting input
conditions to be tested. An input condition can be applied to a set of values of a
specific input variable, or a set of input variables
as well.
57
An Overview of
Software Engineering
Equivalence class
ECscalene
ECisosceles
ECequilateral
ECright angled
ECnon _ triangle
ECinvalid1
ECinavlid2
ECinavlid3
Test Inputs
f(3, 5, 7), . . . g
f(2, 3, 3), . . . g f(2, 3, 3), . . g
f(7, 7, 7), . . . g f(7, 7, 7), . . . g
f(3, 4, 5), . . .
f(1, 1, 3), . . .
f(-1, 2, 3), (0, 1, 3), . . .
f(1, -2, 3), (1, 0, 3), . . .
f(1, 2, -3), (1, 2, 0),. . .
Expected Outputs
Scalene
Isosceles
Equilateral
Right Angled
Not a Triangle
Error Value
Error Value
Error Value
58
Software Testing
In this section, we will use the control flow graph to choose white box test cases
according to the criteria above. To motivate the selection of test cases, consider the
simple program given in Program 4.1.
Example 3:
void main(void)
{
int x1, x2, x3;
scanf("%d %d %d", &x1, &x2, &x3);
if ((x1 > 1) && (x2 == 0))
x3 = x3 / x1;
if ((x1 == 2) || (x3 > 1))
x3 = x3 + 1;
while (x1 >= 2)
x1 = x1 - 2;
printf("%d %d %d", x1, x2, x3);
}
59
Start
An Overview of
Software Engineering
int x1,x2,x3
scanf("%d %d %d", &x1, &x2, & A
x3)
(x1>1) &&
(x2==0)
True
x3 = x3/x1
C
False
(x1==2) ||
(x3 >1)
True
x3 = x3+1;
False
x1>= 2
True
x1 = x1 - 2; G
False
End
Figure 4.1: The flow chart for the program 4.1
Table 4.3: Test cases for the various coverage criteria for the program 4.1
Coverage Criteria
Execution Paths
Statement
(2, 0, 3)
(2, 0, 3),
(1, 1, 1)
(1, 0, 3),
(2, 1, 1)
(2, 0, 4),
(1, 1, 1)
ABCDEFGF
ABCDEFGF
ABDF
ABDEF
ABDFGF
ABCDEFGF
ABDF
(2, 0, 4),
(2, 1, 1),
(1, 0, 2),
(1, 1, 1)
(2, 0, 4),
(2, 1, 1),
(1, 0, 2),
(4, 0, 0),
ABCDEFGF
ABDEFGF
ABDEF
ABDF
ABCDEFGF
ABDFGF
ABDEF
ABCDFGFGF
Branch
Condition
Decision/ Condition
Multiple Condition
Path
60
Software Testing
Table 4.4: Multiple condition coverage for the program in Figure 4.1
Test
cases
C1
x1 > 1
C2
x2==0
C3
x1==2
C4
x3 > 1
B2
B1
(1,0,3)
(2,1,1)
(2,0,4)
(1,1,1)
(2,0,4)
(2,1,1)
(1,0,2)
(1,1,1)
F
T
T
F
T
T
F
F
T
F
T
F
T
F
T
F
F
F
T
F
T
F
F
F
F
T
T
F
T
T
F
F
T
F
T
F
T
F
T
F
T
F
T
F
T
T
T
F
4.2.3
B3
C5
x1 2
F
T
T
F
T
T
F
F
Cyclomatic Complexity
61
An Overview of
Software Engineering
2
3
4
5
Mutation Testing
Mutation Testing is a powerful method for finding errors in software programs. In this
technique, multiple copies of programs are made, and each copy is altered; this altered
copy is called a mutant. Mutants are executed with test data to determine whether the
test data are capable of detecting the change between the original program and the
mutated program. The mutant that is detected by a test case is termed killed and the
goal of the mutation procedure is to find a set of test cases that are able to kill groups
of mutant programs. Mutants are produced by applying mutant operators. An operator
is essentially a grammatical rule that changes a single expression to another
expression. It is essential that all mutants must be killed by the test cases or shown to
be equivalent to the original expression. If we run a mutated program, there are two
possibilities:
1.
The results of the program were affected by the code change and the test suite
detects it. We assumed that the test suite is perfect, which means that it must
detect the change. If this happens, the mutant is called a killed mutant.
2.
The results of the program are not changed and the test suite does not detect the
mutation. The mutant is called an equivalent mutant.
If we take the ratio of killed mutants to all the mutants that were created, we get a
number that is smaller than 1. This number gives an indication of the sensitivity of
program to the changes in code. In real life, we may not have a perfect program and
we may not have a perfect test suite. Hence, we can have one more scenario:
3.
62
The results of the program are different, but the test suite does not detect it
because it does not have the right test case.
Software Testing
3){
than 3\n");
> 5)
than 3\n");
/*
/* line
/*
/*
/*
/*
/* line
/*
/*
/* line
/*
/*
/* line
/*
/*
line 1 */
2 */
line 3 */
line 4 */
line 5 */
line 6 */
7 */
line 8 */
line 9 */
10 */
line 11 */
line 12 */
13 */
line 14 */
line 15 */
63
An Overview of
Software Engineering
1)
Levels of Testing:
Mainly, Software goes through three levels of testing:
Unit testing
Integration testing
System testing.
Unit Testing
Unit testing is a procedure used to verify that a particular segment of source code is
working properly. The idea about unit tests is to write test cases for all functions or
methods. Ideally, each test case is separate from the others. This type of testing is
mostly done by developers and not by end users.
The goal of unit testing is to isolate each part of the program and show that the
individual parts are correct. Unit testing provides a strict, written contract that the
piece of code must satisfy. Unit testing will not catch every error in the program. By
definition, it only tests the functionality of the units themselves. Therefore, it will not
catch integration errors, perfomance problems and any other system-wide issues. A
unit test can only show the presence of errors; it cannot show the absence of errors.
Integration Testing
Integration testing is the phase of software testing in which individual software
modules are combined and tested as a group. It follows unit testing and precedes
system testing. Integration testing takes as its input, modules that have been checked
out by unit testing, groups them in larger aggregates, applies tests defined in an
integration test plan to those aggregates, and delivers as its output, the integrated
system ready for system testing.The purpose of Integration testing is to verify
functional, performance and reliability requirements placed on major design items.
64
Software Testing
System Testing
System testing is conducted on a complete, integrated system to evaluate the system's
compliance with its specified requirements. As a rule, system testing takes, as its
input, all of the integrated software components that have successfully passed
integration testing and also the software system itself integrated with any applicable
hardware system(s). In system testing, the entire system can be tested as a whole
against the software requirements specification (SRS). There are rules that describe
the functionality that the vendor (developer) and a customer have agreed upon.
System testing tends to be more of an investigatory testing phase, where the focus is
to have a destructive attitude and test not only the design, but also the behavior and
even the believed expectations of the customer. System testing is intended to test up to
and beyond the bounds defined in the software requirements specifications.
Acceptance tests are conducted in case the software developed was a custom software
and not product based. These tests are conducted by customer to check whether the
software meets all requirements or not. These tests may range from a few weeks to
several months.
4.4 DEBUGGING
Debugging occurs as a consequence of successful testing. Debugging refers to the
process of identifying the cause for defective behavior of a system and addressing that
problem. In less complex terms - fixing a bug. When a test case uncovers an error,
debugging is the process that results in the removal of the error. The debugging
process begins with the execution of a test case. The debugging process attempts to
match symptoms with cause, thereby leading to error correction. The following are
two alternative outcomes of the debugging:
1.
The cause will be found and necessary action such as correction or removal will
be taken.
2.
Characteristics of bugs
1.
The symptom and the cause may be geographically remote. That is, the
symptom may appear in one part of a program, while the cause may
actually be located at a site that is far removed. Highly coupled program
structures exacerbate this situation.
2.
3.
4.
The symptom may be caused by human error that is not easily traced.
5.
6.
7.
8.
The symptom may be due to causes that are distributed across a number of
tasks running on different processors.
corrected.
65
An Overview of
Software Engineering
a)
Defect Identification/Confirmation
b)
Defect Analysis
Assuming that the software engineer concludes that the defect is genuine, the focus
shifts to understanding the root cause of the problem. This is often the most
challenging step in any debugging task, particularly when the software engineer is
debugging complex software.
Many engineers debug by starting a debugging tool, generally a debugger and try to
understand the root cause of the problem by following the execution of the program
step-by-step. This approach may eventually yield success. However, in many
situations, it takes too much time, and in some cases is not feasible, due to the
complex nature of the program(s).
c)
Defect Resolution
Once the root cause of a problem is identified, the defect can then be resolved by
making an appropriate change to the system, which fixes the root cause.
Debugging Approaches
Three categories for debugging approaches are:
Brute force
Backtracking
Cause elimination.
Brute force is probably the most popular despite being the least successful. We apply
brute force debugging methods when all else fails. Using a let the computer find the
error technique, memory dumps are taken, run-time traces are invoked, and the
program is loaded with WRITE statements. Backtracking is a common debugging
method that can be used successfully in small programs. Beginning at the site where a
symptom has been uncovered, the source code is traced backwards till the error is
found. In Cause elimination, a list of possible causes of an error are identified and
tests are conducted until each one is eliminated.
1)
What are the different levels of testing and their goals? For each level
specify which of the testing approaches are most suitable.
..
..
2)
....................................................................................................................
Software Testing
The following are different categories of tools that can be used for testing:
The following are some of the examples of commercial software testing tools:
Kind of Tool
Rational Test RealTime's Unit Testing feature automates C, C++ software
component testing.
Organisation
IBM Rational Software
Software Description
Platforms
Rational Test RealTime is available for most development and target systems
including Windows and Unix.
AQtest
Kind of Tool
Automated support for functional, unit, and regression testing
Organisation
AutomatedQA Corp.
Software Description
AQtest automates and manages functional tests, unit tests and regression tests, for
applications written with VC++, VB, Delphi, C++Builder, Java or VS.NET. It also
supports white-box testing, down to private properties or methods. External tests can
be recorded or written in three scripting languages (VBScript, JScript, DelphiScript).
Using AQtest as an OLE server, unit-test drivers can also run it directly from
application code. AQtest automatically integrates AQtime when it is on the machine.
Entirely COM-based, AQtest is easily extended through plug-ins using the complete
IDL libraries supplied. Plug-ins currently support Win32 API calls, direct ADO
access, direct BDE access, etc.
Platforms
67
An Overview of
Software Engineering
csUnit
Kind of Tool
Complete Solution Unit Testing for Microsoft .NET (freeware)
Organisation
csUnit.org
Software Description
csUnit is a unit testing framework for the Microsoft .NET Framework. It
targets test driven development using .NET languages such as C#, Visual
Basic .NET, and managed C++.
Platforms
Microsoft Windows
Sahi
http://sahi.sourceforge.net/
Software Description
Sahi is an automation and testing tool for web applications, with the facility to record
and playback scripts. Developed in Java and JavaScript, it uses simple JavaScript to
execute events on the browser. Features include in-browser controls, text based
scripts, Ant support for playback of suites of tests, and multi-threaded playback. It
supports HTTP and HTTPS. Sahi runs as a proxy server and the browser needs to use
the Sahi server as its proxy. Sahi then injects JavaScript so that it can access elements
in the webpage. This makes the tool independant of the website/ web application.
Platforms
4.6 SUMMARY
The importance of software testing and its impact on software is explained in this unit.
Software testing is a fundamental component of software development life cycle and
represents a review of specification, design and coding. The objective of testing is to
have the highest likelihood of finding most of the errors within a minimum amount of
time and minimal effort. A large number of test case design methods have been
developed that offer a systematic approach to testing to the developer.
Knowing the specified functions that the product has been designed to perform, tests
can be performed that show that each function is fully operational. A strategy for
software testing may be to move upwards along the spiral. Unit testing happens at the
vortex of the spiral and concentrates on each unit of the software as implemented by
the source code. Testing happens upwards along the spiral to integration testing,
where the focus is on design and production of the software architecture. Finally, we
perform system testing, where software and other system elements are tested together.
Debugging is not testing, but always happens as a response of testing. The debugging
process will have one of two outcomes:
68
1)
2)
The cause will not be found. Regardless of the approach that is used, debugging
has one main aim: to determine and correct errors. In general, three kinds of
debugging approaches have been put forward: Brute force, Backtracking and
Cause elimination.
Software Testing
The basic levels of testing are: unit testing, integration testing, system
testing and acceptance testing.
Acceptance Testing
Clients need
System Testing
Requirements
Design
Integration Testing
Code
Unit Testing
Figure 4.7: Testing levels
For unit testing, structural testing approach is best suited because the focus of testing
is on testing the code. In fact, structural testing is not very suitable for large programs.
It is used mostly at the unit testing level. The next level of testing is integration testing
and the goal is to test interfaces between modules. With integration testing, we move
slowly away from structural testing and towards functional testing. This testing
activity can be considered for testing the design. The next levels are system and
acceptance testing by which the entire software system is tested. These testing levels
focus on the external behavior of the system. The internal logic of the program is not
emphasized. Hence, mostly functional testing is performed at these levels.
2)
Defect Identification/Confirmation
Defect Analysis
Defect Resolution
2)
69
An Overview of
Software Engineering
3)
Reference websites
http://www.rspa.com
http://www.ieee.org
http://standards.ieee.org
http://www.ibm.com
http://www.opensourcetesting.org
70