Software Engineering
Software Engineering
ENGINEERING
Introduction to Software
Engineering l
The nature and complexity of software have changed significantly in the last 30 years. In the
1970s, applications ran on a single processor, produced a~phanumeric output, and received
their input from a linear source. Toqay's applications are far more complex; typically have
graphical user intocface and client-server architecture. They frequently run on two or more
processors, under d~fferent operating systems, and on geographically distributed machines.
Rarely, in history has a field of endeavor evolved as rapidly as software development.
The struggle to stay, abreast of new technology, deal with accumulated development backlogs,
and cope with people issues has become a treadmill race, as software groups work as hard as
they can, just to stay in place. The initial concept of one "guru", indispensable to a project and
hostage to its continued maintenance has changed. The Software Engineering Institute (SEI)
and group of"gurus" advise us to improve our development process. Improvement means "ready
to change". Not every member of an organization feels the need to change. It is too easy to
dismiss process improvement efforts as "just the latest management fad. Therein lie the seeds
of conflict, as some members of a team embrace new ways of working, while others mutter
"over- my dead body" [WIEG94].
Therefore, there is an urgent need to adopt software engineering concepts, strategies,
practices to avoid conflict, and to improve the software development process in order to deliver
good quality maintainable software in time and within budget.
developers who could not understand the importance of detecting and removing faults before
the customer experiences them as failures. It belongs to the legal system that has given a free
pass to software developers on bug related damages. It also belongs to universities and other
higher educational institutions that stress on programming over software engineering princi-
ples and practices.
1.2.1 Definition
At the first conference on software engineering in 1968, Fritz Bauer [FRIT68] defined software
engineering as "The establishment and use of sound engineering principles in order to obtain
economically developed software that is reliable and works efficiently on real machines". Stephen
Schach [SCHA90] defined the same as ''A discipline whose aim is the production of quality
software, software that is delivered on time, within budget, and that satisfies its requirements".
Both the definitio_n s are popular and acceptable to majority. However, due to increase in
cost of maintaining software, objective is now shifting to produce quality software that is
maintainable, delivered on time, within budget, and also satisfies its requirements.
Operating
procedures
Any program is a subset of software and it becomes software only if documentation and
operating procedure man1,1als are prepared. Program is a combination of source code and object
code. Documentation consists of different types of manuals as shown in Fig. 1.2.
Formal specification
Analysis\ Context-Diagram
Specification
Flow charts
Design
Entity-Relationship diagrams
Documentation
manuals
Source code listings
Implementation
Cross-Reference listing
Test data
Testing
Test results
Operating procedures consist of instructions to setup and use the software system and
instructions on how to react to system failure. List of operating procedure manuals/docume::.:5
is given in Fig. 1.3.
Software Engineering
System overview
Reference guide
Installation guide
- Operational manuals
I
Learning curve
'
Do not quit here!
- - Time -----
Fig. 1.4: The process improvement learning curve
8 Software Engineering
1. The problem is well understood. Only some parts of the proh!e:n are under-
stood, others are not.
2. There are many existing bridges. Every program is differen: .. ~i ce.signed for
special applications .
3. The requirements for a bridge typically do Requirements typically chz.::ge d uring all
not chan ge mu ch during construction. phases of development.
4. The strength and stability of a bridge can be Not possible to calculate au_ec:.:es.; of a pro-
calculated with reasonable precision. gram with existing me~
5. When a bridge collapses, there is a detailed When a prngram fails, the . - a...---e often
investigation and report. unav~able or even de ~ _ re=aled.
6. Engineers have been constructing bridges for Developers have been wr. ~ for
thousands of years. 50 years or so.
7. Materials (wood, stone, iron, steel) a n d tech- Hardware and software ~ ~dJy.
_niques (making joints in wood, carving stone,
casting iron) change slowly. •
Burn-in ,
phase :
i - - -- ,
~ Useful life phase ~
: Wear out
phase
'
- - -- - Time - - - --
12 Software Engineering
been computerized. Back in the days of manual accounting systems, human error was a fact of
life. Now, we have software error as well.
3. Testing software or 'proving' software correct can remove all the errors:
Testing can only show the presence of errors. It cannot show the absence of errors. Our aim is
to design effective test cases in order to find maximum possible errors. The more we test, the
more we are confident about our design.
4. Reusing software increases safety: This myth is particularly troubling because of
the false sense of security that code re-use can create. Code re-use is a very powerful tool that
can yield dramatic improvement in development efficiency, but it still requires analysis to
determine its suitability and testing to determine if it works.
5. Software can work right the first time: If we go to an aeronautical engineer, and
ask him to build a jet fighter craft, he will quote us a price. Ifwe demand that it is to be put in
production without building a prototype, he will laugh and may refuse the job. Yet, software
engineers are often asked to do precisely this sort of work, and they often accept the job.
6. Software can be designed thoroughly enough t o avoid most integration
problems: There is an old saying among software designers: "Too bad, there is no complier for
specifications": This points out the fundamental difficulty with detailed specifications. They
always have inconsistencies, and there is no computer tool to perform consistency checks on
these. Therefore, special care is required to understand the specifications, and if there is an
ambiguity, that should be resolved before proceeding for design.
7. Software with more features is better software: This is, of course, almost the
opposite of the truth. The best, most enduring programs are those which do one thing well.
8. Addition of more software engineers will make up the delay: This is not true
in most of the cases. By the process of adding more software engineers during the project, we
may further delay the project. This does not serve any purpose here, although this may be true
for any civil engineering work.
9. Aim is to develop working programs: The aim has been shifted from developing
working programs to good quality, maintainable programs. Maintaining software has _become
a very critical and crucial area for software engineering community.
This list is endless. These myths, poor quality of software, increasing cost and delay in
the delivery of the software have been the driving forces behind the emergence of software
engineering as a discipline. In addition, following are the contributing factors:
• Change in ratio of hardware to software cost s
• Increasing importance of maintenance
• Advances in software techniques
• Increased demand for software
• Demand for larger and more complex software systems.
SOFTWARE ARCHITECTURE
Software architecture refers to the fundamental structures of a software system and the
discipline of creating such structures and systems. Each structure comprises software elements,
relations among them, and properties of both elements and relations. The architecture of a
software system is a metaphor, analogous to the architecture of a building. It functions as a
blueprint for the system and the developing project, laying out the tasks necessary to be executed
by the design teams.
Software architecture is about making fundamental structural choices that are costly to change
once implemented. Software architecture choices include specific structural options from
possibilities in the design of the software. For example, the systems that controlled the Space
Shuttle launch vehicle had the requirement of being very fast and very reliable. Therefore, an
appropriate real-time computing language would need to be chosen. Additionally, to satisfy the
need for reliability the choice could be made to have multiple redundant and independently
produced copies of the program, and to run these copies on independent hardware while cross-
checking results.
Softvvare Life Cycle
2 Models
The ultimate objective of software engineering is to produce good quality maintainable
software within reasonable time frame and at affordable cost. This is achievable only if we
have matured processes to produce it. For a mature process, it should be possible to determine
in advance how much time a nd effort will be required to produce the final product. This can
only be done using data from past experience, which requires that we must measure the soft-
ware process.
Software development organizations follow some process when developing a software
product. In immature organizations, the process is usually not written down. In mature
organizations, the process is in writing and is actively managed. A k ey component of any
software development process is the life cycle model on which the process is based. The particular
life cycle model can significantly affect overall life cycle costs associated with a software product
[RAKI97]. Life cycle of the software starts from concept exploration and ends at the retirement
of the software.
In the IEEE standard Glossary of software Engineering Terminology, the software life
cycle is:
"The period of time that starts when a software product is conceived and ends when the
product is no longer available for use. The software life cycle typically includes a requirement
phase, design phase, implementation phase, test phase, installation and check out phase, op-
eration and maintenance phase, and sometimes retirement phase".
A software life cycle model is a particular abstraction that represents a software life
cycle. A software life cycle model is often called a software development life cycle (SDLC). A
variety of life cycle models h ave been proposed and ar e based on tasks involved in developing
a nd maintaining software. Few well known life cycles models are discussed in this chapter.
20
Software Life Cycle Models 21
Build
code
Fix
Although this approach may work well on small programming exercises 100 or 200 lines
long, this model is totally unsatisfactory for software of any reasonable size. Code soon becomes
unfixable and unenhanceable. Th ere is no room for design or any aspect of development process
to be carried out in a structured or detailed way. The cost of the development using this approach
is actually very high as compared to the cost of a properly specified and carefully designed
. product. In addition, maintenance of the product can be extremely difficult without specification
or design documents.
. ,
The SRS document may act as contract between the developer and customer. If developer
fails to implement full set ofrequirements, it may amount to failure to implement the contracted
system. /
/
Software Engineering
Requirement analysis
& Specification
~ - -o_e_s_ig_n_ _ ~
Implementation &
Unit testing
Operation &
Maintenance
2. Design phase: The SRS document is produced in the previous phase, which contains
the exact requirements of the customer. The goal of this phase is to transform the requirements
specification into a structure that is suitable for implementation in some programming language.
Here, overall software architecture is defined, and the high level and detailed design work is
performed. This work is documented and known as software design description (SDD) document.
The information contained in the SDD should be sufficient to begin the coding phase.
3. Implementation and unit testing phase: During this phase, design is implemented.
If the SDD is complete, the implementation or coding phase proceeds smoothly, because all the
information needed by the software developers is contained in the SDD.
During testing, the major activities are centered around the examination and modifica-
tion of the code. Initially, small modules are tested in isolation from the rest of the software
product. There are problems associated with testing a module in isolation. How do we run a
module without anything to call it, to be called by it or, possibly, to output intermediate values
obtained during execution? Such problems are solved in this phase and modules are tested
after writing some overhead code.
4. Integration and system testing phase: This is a very important phase. Effective
testing will contribute to the delivery of higher quality software products, more satisfied users,
lower maintenance costs, and more accurate and reliable results. It is a very expensive activity
and consumes one-third to one half of the cost of a typical development project.
As we know, the purpose of unit testing is to determine that each independent module is
correctly implemented. This gives little chance to determine that the interface between modules
is also correct, and for this reason integration testing is performed. System testing involves
the testing of the entire system, whereas software is a part of the system. This is essential to
build confidence in the developers before software is delivered to the customer or r eleased in
the market.
5. Operation and maintenance phase: Software maintenance is a task that every
development group has to face, when the software is delivered to the customer's site, installed
and is operational. Therefore, release of software inaugurates the operation and maintenance
phase of the life cycle. The time spent and effort required to keep the software operational
Software Life Cycle Models
after release is very significant. Despite the fact that it is a very important and challenging
task; it is routinely the poorly managed headache that nobody wants to face.
Software maintena nce is a very broad activity that includes error correction, enhance-
ment of capabilities, deletion of obsolete capabilities, and optimization. The purpose of this
phase is to preserve the value of the software over time. This phase may span for 5 to 50 years
whereas development may be 1 to 3 years.
This model is easy to understand and reinforces the notion of "define before design" and
"design before code". This model expects complete and accurate requirements early in the
process, which is unrealistic. Working software is not available until relatively late in the
process, thus delaying the discovery of serious errors. It also does not incorporate any kind of
risk assessment.
Problems of waterfall model
(i) It is difficult to define all requirements at the beginning of a project.
(ii) This model is not suitable for accomodating any change.
(iii) A working version of the system is not seen until late in the project's life.
(iv) It does not scale up well to large projects . .
(u) Real projects are rarely sequential.
Due to these weaknesses, the application of waterfall model should be limited to situa-
tions where the requirements and their implementation are well understood. For example, if
an organisation has experience in developing accounting systems then building a new accounting
system based on existing designs could be easily managed with the waterfall model.
The aim of the waterfall and prototyping models is the deli\·ery o: a co:::. ..e..
tional and good quality product. In contrast, this model does deliver an ope!'a~
product at each release, but one that satisfies only a subset of the cu tome'!'"·5 ~:P::::r£:~':'.:!::...
The complete product is divided into releases, and the developer deliver- ilie p:-oo~ .
by release. A typical product will usually have many releases as shown in F:~. 2 3 ..\:
release, customer has an operational quality product that does a portion of v.r,a: ~ ~-ed.
The customer is able to do some useful work after first r elease. With this mode:. fus. ..-....~...,.
may be available within few weeks or months, whereas t he customer generaUy v.a:-'= IDC::::t:..s
or years to receive a product u sing the waterfall and prototyping model.
Release I
Release II
Release Ill
Requirements User
planning description Construction Cut over
Software Engineering
Requirements
Quick design
Refinement of
requirements as
per suggestions
Implement
Customer Evaluation
Not accepted by customer
Accepted by customer
Design
The prototype may be a usable program, but is not suitable as the final software product.
The reason may_be poor performance, maintainability or overall quality. The cod for the
prototype is thrown away; however the experience gathered from developing the prototype
helps in developing the actual system. Therefore, the development of a prototype migh. involve
27
c . but overall cost might t urnout to be lower than that of an equivalent system developed
_ :!le waterfall model.
The developers should develop prototype as early as possible to s peed up the software
· y:nent process. After all, t he sole use of this is to determine the customer 's r eal needs.
+;s has been determined, the prototype is discarded. For this reason, the internal structure
~ prototype is not very important [SCHA96].
After t he finalization of software requirement and specification (SRS) document, the
- type is discarded and actual system is then developed using the waterfall approach. Thus,
- !!.Serl as an input t o waterfall model and produces maintainable and good quality software.
~ :nod.el requires extensive participation and involvement of th e customer, which is not
~- possible.
-::-ne radial dimension of the model represents the cumulative costs. Each path around
:p=_..-ai is indicative of increased costs. The angular dimension represents the progress made
_.,:::p!eting each cycle. Each loop of t he spiral from X-a xis clockwise through 360° r epresents
¢:age. One phase is split roughly into four sectors of major a ctivities:
• Planning: Determination of objectives, alternatives and constraints
• Risk analysis: Analyze alternatives a nd attempts t o identify and resolve the risks in-
volved
• Development: Product development a nd testing product
• Assessment: Customer eva luation
During t h e first phase, planning is performed, risks are analyzed, prototypes are built,
~ ~ mers evaluate the prototype. During t he second phase, a more r efined prototype is
:.. requirements are document ed and validated, and cu stomers are involved in assessing
_ :iew prototype. By the time third phase begins, risks are known, and a somewhat more
=.c:::onal development approach is taken IRAKI97].
The focus is the identification of problems and the classification of these into different
le\-e·- of risks, the aim being to eliminate high-risk problems before they t hreaten the software
cperarion or cost.
An important feature of the spiral model is that each phase is completed with a review
. ::he people concerned with the project (designer s and programmers). This review consists of
re.iew of all the products developed up to that point and includes the plans for the n ext cycle.
!!bese plans may include a partition of the product in smaller portions for development or
ci=:.ponents that are implemented by individual groups or persons. If the plan for the develop-
~ : fails, then the spiral is termin ated. Otherwise, it terminates with the initiation of new or
c:o:Ef:.ed software.
28 Software Engineering
Cumulative cost
Progress
through
steps
Evaluate alternatives;
identify, resolve risks
Determine
objectives,
alternatives,
constraints
Benchmarks
Software
product Detailed
design design
Requirements - r--- --
validation 1 : Code
I I
: Unit :
Design validation , test 1
I I
and verification , Integration :
: and test
Plan Acceptance;
next phases Implemen-
tation test
Develop, verify
t next-level product - t
IV Ill
The advantage of this model is the wide range of options to accommodate t he good
features of other life cycle models. It becomes _equivalent to another life cycle model in a ppro-
priate situations. It also incorporates software quality objectives into software development.
The risk analysis and validation steps eliminate errors in the early phases of development .
The spiral model has some difficulties that need to be r esolved before it can be a univer-
sally applied life cycle model. These difficulties include lack of explicit process guida nce in
determinin g objectives, constraints, alternatives; relying on risk assessment experfo;e; and
providing more flexibility than required for many applications.
feedback of the users in terms of additional functionality, failure reports etc. may mon va:e...:
to work for second version. The same process through inception, elaboration, constructior? a=rl
transition phases will repeat to evolve the next generation of the software produ.~- -:::-r.e5e
cycles are known as evolution cycles as shown in figure 2.8. With several evolution cycies. ne
generations of the product are produced. This process will continue upto the retire~ :
software product.
Vers,:;,:',
L Inception
►I Elaboration I ►[construction Transition
_ ~ tia~evelopment eye~
Evolution cycle
, - - - - - , Version 3
• ' • ~ Inception 1 ~ ►I Construction}- -t>j Transitionj : : : ; ►
Evalution cycle ~
Continue till
the product is
retired.
The phases are not of equal lengths. The length may vary depending on the type, speci-
fications and environment of the project. In each phase, we progress iteratively and each phase
may consist .of one or several iterations as shown in Figure 2.9.
...
L Inception :- ....,...- : Elaboration :1--- -..~-: Construction ~
'
Time
Each iteration follows a pattern which is similar to waterfall model. Hence, the work-flow
contains the activities of requirements elicitation and analysis, design, implementation and
testing. However, from one iteration to the next and from one phase to the next, the emphasis
on various activities will change. Figure 2.10 shows the relative emphasis of the various types
of activities over time [KRUC 99]. These l:lCtivities are noLseparated in time. Rather, they are
executed concurrently throughou t the lifetime of the project. As we have seen in figure 2.10,
not much code is written early, in the project life cycle ; but the amount is not zero. Late in the
projected, most of the requirements are knowri, but some new ones are still 1dentified. Thus, as
the project, matures, the emphasis on certain activities increases or decreases, but activities
are allowed to execute at any time throughout the lifetime of the project [BOOC 98].
Software Life Cycle Models
The inception phase is primarily dedicated to the requirements elicitation and analysis.
The scope of the work is defined and some planning work is also carried out. The ·elaboration
phase has the focus on requirements with some emphasis on design and implementation. During
the construcLion phase, focus is mostly on design and implementation. We produce first
operational product after this phase.
The focus of transition phase is on training, installation and customer interaction. The
feedback of customer helps us to improve and enhance the product. We p;oduce and deliver
the final product here.
Phases
Core workflows ~
Inception }
_ __ ~r
I
I
Elaboration
-- ~I
I
L 1
I I
I I
I -- -~ I
Requirements
elicitation and
~ I
!
::i'- I
ti
I
I
analysis I I I
:
I
t
I
:
I
Design
- - - - -~ ,-
I
: ~
I ___..-t - - - .
I
I
=------=
jlJ
I
I
I I I
I I I
I I I
I I I
I I I
I I -..--~- I
Implementation ~l
I
I
I
I
I
I
~ I
I
I
I
I I I I I
l I I I I
I I I I I
I I I I :
I I I l I
I I I I
I I I I •
I 1 I I I I
I I I I I I
Test I I I
~
I I I
: lteration-1 : lteration-2 1 lter<1t- : ltera- : ltera- : ltera- : ltera-
Priliminary ,_ , , ion-n , tion-n , tion-n , tion-m ,: tion-m + 1
iteration
: : : : + 1 : +2 ! :
Fig. 2.10: Iterations and workflow of unified process
Initial risk
assessment
Inception
Business
model
Initial busmess
case
Th~ vision document's emphasis is on requirements and scope of the project. It gives us
an idea about overall objective and expectations from the project. Initial use case model gives
use case diagram alongwith actors etc. It may also consist of use cases that can be identified at
this early stage.
Initial business case may include revenue model, market con ditions, business difficul-
ties and financial forecast etc. Project plan document may include phases and iterations for
the development of the project. Prototypes are very useful for the understanding of the project
(optional item). A business model may be required to provide idea about "time to market".
marketing strategies, cash flows and threats.
The elaboration phase has the focus on the analysis of problem domain, establishes a
sound architectural foundation, develops project plans and eliminat es the risk elements. Some
of the objectives and activities are :
• Establishing architectural foundations
• Design of use case model
• Elaborating the process, infrastructure and development environment
• Selecting component, if possiple, for the project
• Demonstrating that architecture supports the vision at reasonable cost and with speci-
fied time.
The outcomes are given in Fig. 2.12.
An executable
Priliminary Elaboration architectural
user manual prototype
Architecture
Use case description
model Supplementary document
requirements with
nonfunctional
requirements
A use case model (at least 80% complete) is pr epared. All use cases are identified
alongwith associated actors. Supplementary requirements document (with nonfunctional
requirements) and softwar e architecture description document are also prepared. A prototype
is also designed for the customer to give an idea about the final product. A development plan
with iterations, workflows etc. is a lso prepared. A preliminary user manual, although optional,
may also be prepared in this phase and will r efine in the subsequent phases.
The construction phase produces the product for the customer. The objectives and
activities are :
• Implementing the project
• Minimising development cost
• Managing and optimizing resources
• Testing the product
• Assessing the product releases against acceptance criteria.
The outcome of this phase is a product ready to use for the customers and is shown in
Fig. 2.13.
Test outline
Operational manuals
Documentation
--- -+. Test suite
manuals
A description
Software of the current
product User release
manuals
The outcomes are various operational and documentation manuals alongwith software
product. The test suite documents are also preserved carefully because they are required during
the maintenance of the software product.
The transition phase lays focus on successful delivery and installa tion of the software
product. The phase includes the following : ~
• Commencement of beta testing
• Analysis of u ser's views
• Training of users
• Tuning activities including bug fixing and enhancement for performance and usability
• Assessing the customer satisfaction
The outcomes are given in Fig. 2.14.
Software Engineering
Product
release
/ Beta test
User
feedback
reports
The-unified process has many advantages due to its iterative and incremental nature.
Changes can be accomodated, risks can be minimised, reusability can be ensured and learning
alongwith project evolution is possible. Hence, the product that results from unified process
will be of good quality. The system has been tested several times, improving the quality of
testing. The requirements have been refined and are more closely related to the customer's
actual expectations.
When we receive a request for a new software project from the customer, first of all, we would
like to understand the project. The new project may replace the existing system such as
preparation of students semester results electronically rather than manually. Sometimes, the
new project is an enhancement or extension of a current (manual or automated) system. For
example, a web enabled student result declaration system that would enhance the capabilities
of the current result declaration system. No matter, whether its functionality is old or n ew,
each project has a purpose, usually expressed in what the system can do. Hence, goal is to
understand the requirements of the customer and document them properly. A requiremen t is
a feature of the system or a description of something the system is capable of doing in order to
fulfil the system's purpose.
The hardest part of building.a software system is deciding precisely what to build. No
other part of the conceptual work is so difficult as establishing the detailed technical
requirements. No other part of the work so cripples the resulting system if done wrong. No
other part is more difficult to r ectify later [BROO95]. Throughout software industry's history,
we have struggled with this truth. Defining and applying good, complete requiremen~ is hard
to work, and success in this endeavor has eluded many ofus. Yet, we continue to make progress.
40
Software Requirements : Analysis and Specifications 41
Problem
statement
Requirements
elicitation
Requirements
analysis J
h i
Requirements
documentation
Requirements
review
SRS
to users, customers, designers, and testers; and capable of serving as a basis for both design
and test. This SRS document may act as contract between the developer and customer. If
developer fails to implement full set ofrequirements, it may amount to failure in implementing
the contracted system.
It is required to develop a system that will manage information about subjects offered :.::
various semesters, students enrolled in various semesters, elective (s) opted by various studen::.s
in different semesters, marks and credit points obtained by students in different semesters_
The system should also have the ability to generate printable mark-sheets for each studen_:.
Semester-wise detailed mark-lists and student performance reports also need to be generated.
Example 3.2:A university wishes to develop a software system for library management activities.
Design the problem statement for the software company.
Solution: The problem statement prepared by the library staff of the university is given
below. Here activities are explained point wise rather than paragraph wise.
A software has to be developed for automating the manual library system of a Uni,·er-
sity. The system should be standalone in nature. It should be designed to provide functionalities
as explained below:
1. Issue of books
(a) A student of any course should be able to get books issued.
(b) Books from General section are issued to all but Book bank books are issued only
for their respective courses.
(c) A limitation is imposed on the number of books a student can be issued.
(d) A maximum of 4 books from book bank and 3 books from general section per student
is allowed.
(e) The books from book bank are issued for entire semester while books from general
section are issued for 15 days only.
(f) The software takes the current system date as the date of issue and calculates the
corresponding date of return.
(g) A bar code detector is used to save the student information as well as book information.
(h) The due date for return of the book is stamped on the book.
2. Return of books
(a) Any person can return the issued books.
(b) The student information is displayed using the bar code detector.
(c) The system displays the student details on whose name the books were issued as
well as the date of issue and return of the book .
(d) The system operator verifies the duration for the issue and if the book is being returned
after the specified due date, a fine of Re 1 is charged for each day.
(e) The information is saved and the corresponding updations take place in the database.
3. Query processing
(a) The system should be able to provide informat ion like:
(i) Availability of a particular book
(ii) Availability of books of any particular author.
(iii) Number of copies available of the desired book.
(b) The system should be able to reserve a book for a particular student for 24 hrs if that
book is not currently available.
Software Requirements : Analysis and Specifications 45
The system should also be able to generate reports regarding the details of the books
available in the library at any given time.
The corresponding printouts for each entry (issue/return) made in the system should be
generated.
Security provisions like the login authenticity should be provided. Each user should
have a user id and a password. Record of the users of the system should be kept in the log file.
Provision should be made for full backup of the system.
The functional requirements are directly related to customer's expectations and are
essential for the acceptance of product. However, non-functional requirements may make the
customer happy and satisfied. These requirements are important for the success of any product.
Sometimes, distinction between functional and non-functional may not be easy. If we 'Yant to
develop a secure system, security becomes crucial to us. It is a non-functional requirements
apparently, but when design is carried out, it may have serious implications. These implications
may also be reflected in functional requirements and sh ould therefore find a place in the
functional requirements category of SRS document.
The term stakeholder is used to refer to anyone who may have some direct or indirect
influence on the system requirements. "Stakeholder" includes end-users who will interact with
the system and everyone else in an organisation who will be affected by it [SOMM0l].
Some requirements are known requirements wh ich a stakeholder believes to be
implemented. Some are unknown to one stakeholder but may be required by another. Some
requirements may be undreamt requirements for the stakeholder due to limited domain
knowledge. However, a known, unknown, or undreamt requirement may be functional or non-
functional depending upon its nature.
Some formal notations are available in the literature with some strengths and
weaknesses.
It is the activity that helps to understand the problem to be solved. Requirements are
gathered by asking questions, writing down the answers, asking. other questions, etc. Hence,
requirements gathering is the most communications intensive activity of software develop-
ment. Developers and Users have different mind set, exper tise and vocabularies. Due to com-
munication gap, there are chances of conflicts that may lead t o inconsistencies, misunder-
standing and omission of requirements.
Therefore, requirements elicitation requires the collaboration of several groups of par-
ticipants who have different background. On the one hand, customers and users have a solid
background in their domain and have a general idea of what the software should do. However,
they may have little knowledge of solfware development processes. On the other hand, the
developers have experience in developing software but may have little knowledge of everyday
environment of the users. Moreover each group may be using incompatible terminologies.
There are number ofrequirements elicitation methods and few of them are discussed in
the following sections. Some people think that one methodology is applicable to all situations,
however, generally speaking, one methodology cannot possibly be sufficient for all conditions
[MACA96]. We select a particular methodology for the following reason(s):
(i ) It is the only method that we know.
(ii) It is our favorite method for all situations.
(i ii) We understand intuit ively that the method is effective in the present circumstances.
Clearly, third reason demonstrates the most maturity and leads to improved under-
standing of stakeholder's needs and thus resulting system will satisfy those nefds. Unfortu-
nately, most of us do not have the insight necessary to make such an informed decision, and
therefore rely on the first two reasons [HICK03].
3.4.1 Interviews
After receiving the problem statement from the customer, the first step is t o arrange a meeting
with the customer. During the meeting or interview, both the parties would like to understand
each other. Normally specialised developers, often called 'requirement engineers' interact with
the customer. The objective of conducting an interview is to understand the customer's
expectations from the softwa re. Both parties have different feelings, goals, opinions,
vocabularies, understandings, but one thing is common, both want the project to be a success.
With this in mind, requirement engineers normally arrange interviews. Requirement engineers
must be open minded and should not approach the interview with pre-conceived notions about
what is required.
Interview may be open-ended or structured. In open-ended interview, there is no pre-set ag~nda.
Context free questions may be asked to understand the problem and to have an overview of
the situation. For example, for a "result management system", requirement engineer may ask:
• Who is the controller of examination ?
• Who has requested for such a software ?
• How many officers are placed in the examination division ?
• Who will use the software ?
• Who will explain the manual system ?
50 Software Engineering
• Do you need additional functionality for improving the performance of the system ?
• What should be the most important goal of the proposed development ?
These questions will help to start the communication that is essential for understand-
ing the requirements. At the end of this, we may have wide variety of expectations from the
proposed software.
This approach encourages the creation of a joint team of customers and developers who
work together to understand the expectations and propose a set of requirements. The basic
guidelines for FAST are given below:
• Arrange a meeting at a n eutral site for developers and customers.
• Establishment of rules for preparatjon and participation.
• Prepare an informal agenda that encourages free flow of ideas.
• Appoint a facilitator to control the meeting. A facilitator may be a developer, a
customer, or an outside expert.
• Prepare a definition mechan~sm-board, flip charts, worksh eets, wall stickies, etc.
• Participants should not criticize or debate.
FAST session preparations
Each FAST attendee is asked to make a list of objects that ar e:
(i ) part of the environment that surrounds the system
(ii) produced by the system
(iii) used by the system.
In a ddition, each attendee is asked to make another list of services (processes or functions)
that manipulate or interact with the objects. Finally, lists of constraints (e.g., cost, size) and
performance criteria (e.g., speed, accuracy) are a lso developed. The attendees are informed
that the lists are not expected to be exhaustive but are expected to reflect each person's
perception of the system [PRES2K).
Activities of FAST session
The activities during FAST session may have the following steps:
• Each participant presents his or h er lists of object s, services, constraints, and
performance for discussion. Lists may be displayed in the meeting by using board,
large sh eet of paper_or any other mechanism, so th at they are visible to all the
participants.
• The combined lists for each topic are prepared by eliminating redundant enteries and
adding new ideas.
• The combined lists are again discussed and consensus lists are finalised by the
facilitator.
• Once the consensus lists have been completed, the team is divided into smaller
subteams, each works to develop mini-specifications for one or more enteries of the
lists.
• Each subteam then presents mini-specifications to all FAST attendees. After discus-
sion, additions or deletions are made to the lists. We may get new objects, services,
constraints, or performance requirements to be added to original lists.
• During all discussions, the team may raise an issue th at cannot be resolved during
the meeting. An issues list is prepared so that these ideas will be considered later.
• Each attendee prepares a list of validation criteria for the product/system and presents
the list to the team. A consensus list of validation criter ia is then created.
Software Requirements : Analysis and Specifications 57
C)
Actor Use case Relationship between
actors and use case and/or
between the use cases
Use cases should not be used to capture all the details of system. The granularity to
which we define use cases in a diagram should be enough to keep the use case diagram
uncluttered and readable, yet, be complete without missing significant aspects of the required
58 Software Engineering
functionality. Design issues should not be discussed at all. Use cases are meant to capture
"what" the system is, and not ''how" the system will be designed or built. Hence use cases
should be free of any design characteristics. If we end up defining design characteristics in a
use case, we need to go back to the drawing board and start again .
.---<=)
Update train informations
Report generation
Admin
Login
~
Passenger
~
View train schedules
Reserve seat
Cacellations
Develop prototypes
(optional)
Model the
requirements
72 Software Engineering
the actual system or even later into maintenance, should the r equirements change; the prototype
is enhanced and agreed to before the actual changes become confirmed.
(d) Generalizations are used to show an inheritance relationship between two classes.
----1C>
We may design the class diagram of a complete system. Obviously, this may become
very huge, for complex systems. In such a case, one class diagram is made for each use case.
This restricts the size of the class diagram and is useful when delegating/assigning the task to
a software developer ; since he/she would only need to see the related class diagram of the
assigned use case; rather than looking at the complete class diagram and then filtering out the
concepts related to his/her use-case. We may also draw object diagram, which shows a set of
objects and their relationships. They represent static snapshots of instances of the things found
in class diagrams, from the perspective of real cases.
( u) Design of state chart diagrams: A state chart diagram is used to show the state
space of a given class, the event that cause a transition from one state to another, and the
actions that result from a state change. It shows the changing behaviour of an object in re-
sponse to different events. State transition diagrams are made only for the objects that are
either very complicated or have a very dynamic behaviour with respect to various events.
Normally, we would not need to make state diagrams. A state transition diagram for a "book"
in the library system is given in Fig. 5.28.
Book is Book is
returned issued
Book is
Disposed - ~ o=ld~ o
=r~ Issued
damaged
(vi ) Draw component and development diagram: Component diagrams address the
static implementation view of a system they are related to class diagrams in that a component
typically maps to one or more classes, interfaces or collaboration. Deployment diagram captures
relationship between physical components and the hardware.
After the completion of above mentioned steps, we will have many documents and com-
plete understanding of flow of data, control and relationships of classes. These things are the
foundations for implementing an object oriented system.
Problem statement
A software has to be developed for automating the manual library of a University. The system
should be stand alone in nature. It should be designed to provide functionality's as explained
below:
j Software Design
Issue of books
• A student of any course should be able to get books issued.
• Books from general section are issued to all but book bank books are issued only for
their respective cou rses.
• A limitation is imposed on the number of books a student can issue.
• A maximum of 4 books from book bank and 3 books from general section is issued for
15 days only.
• The software takes the current system date as the date of issue and calculates date of
return.
• A bar code detector is used to save the student as well as book information.
• The due date for r eturn of t he book is stamped on the book.
Return of books
• Any person can return the issued books.
• The student information is displayed using the bar code detector.
• The system displays the student details on whose name the books were issued as well
as the date ·of issue and return of the book.
• The system operator verifies the duration for the issue.
• The information is saved and the corresponding updating take place in the database.
Query processing
The system should be able to provide information like:
• Availability of a particular book.
• Availability of book of any particular author.
• Number of copies available of the desired book.
The system should also be able to generate reports regarding the details of the books
available in the library at any given time. The corresponding printouts for each entry (issue/
return) made in the system should be generated. Security provisions like the 'login authentic-
ity should be provided. Each user should have a user id and a password. Record of the users of
the system should be kept in t he log file. Provision should be m a de for full backup of the
system.
Use cases
From the problem description , we can see t hat the system has four actors.
1. Librarian
2. Operator
3. Bar Code Reader
4. User
To define system's functionalities, we can view the. system as a collection of following
use cases:
1. Login 2. Issue Book
3. Return Book _4. Query Book
1236 Software Engineering I
5. Maintain Catalog 6. Generate Report
7. Maintain Login 8. Maintain student Details
1. Login
-----c_)
2. Issue book
Bar code
reader
Librarian
User
203
j 204 Software Engineering
Initial requirements
~ *
ther data on user requirement - - - - - - - - - - ,
r---L--- c
Analyze the requirements data
- -- - - -
- ~i --=---=
Refine and document the desig~r - --- - - -
Completed design
D
conceptual
design
/ :i
g
n
e
r
s \
The two design documents describe the same system, but in differen t ways because of
:he different audiences for the document s. The conceptual design answers the following ques-
::ons [PFLE98].
• Where will the data come from?
• What will happen to the data in the system?
• How will the system look to users?
• What choices will be offered to users?
• What is the timing of events?
• How will the reports and screens look like?
The conceptual design describes the system in language understandable to the cus-
w mer. It does not contain any technical jargons and is independent of implementation.
By contrast , the technical design describes the hardware configuration, the software
needs, the communications interfaces, the input and output of the system, the network archi-
tectur e, and anything else that translates the requirements into a solution to t he customer's
problem.
Sometimes customers are very sophisticated and they can understand the "what" and
""now" together. This can happen when customers are themselves software developers and
may not require conceptual design . In such a cases comprehensive design document may be
produced.
r r -
Informal
I More
design ►I Informal
design
- ► formal ►
Finished
design
outline design
5.2 MODULARITY
There are many definitions of the term "module". They range from "a module is a FORTRAN
subroutine" to "a module is an Ada package" to "procedures and functions of PASCAL and C",
to "C++ / Java Classes", to "Java packages" to "a module is a work assignment for an individual
programmer" [FAIR2K]. All of these definitions are correct. A modular system consist of well
defined, manageable units with well defined interfaces among the units. Desirable properties
of a modular system include:
I Software Design
• Each module is a well defined subsystem that is potentially useful in other applica-
tions
• Each module has a single, well defined purpose
• Modules can be separately compiled and stored in a library
• Modules can use other modules
• Modules should be easier to use than to build
• Modules should be simpler from the outside than from the inside
Modularity is the single attribute of software that allows a program to be intellectually
manageable [MYER78]. It enhances design clarity, which in turn eases implementation, de-
bugging, testing, documenting, and maintenance of the software product.
A system is considered modular if it consists of discreet components so that each compo-
nent can be implemented separately and a change to one component has minimal impact on
other components. Here, one important question arises is to what extent we shall modularize.
As the number ,of modules grows, the effort associated with integrating the module also grows.
Fig. 5.4 establishes the relationship between cost/effort and number of modules in a software.
Total software
cost -.:.___
iii I
0 I
0 I
-- - -
I
I
I
eL- -
Number of modules
_
- -+
It can be observed that a software system cannot be made modular by simply chopping
it into a set of modules. Each module needs to support a well defined abstraction and should
have a clear interface through which it can interact with other modules. Thus, it is felt that
under modularity and over modularity in a software should be avoided.
modules which are r elatively independent. "Highly coupled" systems share a great deal of
dependence between modules. For example, if modules make use of shared global variables.
'Uncoupled' modules have no interconnections at all; they are completely independent as shown
in Fig. 5.5.
() 0
00
Uncoupled: no dependencies
(a)
A good design will have low coupling. Thus, interfaces should be carefully specified in
order to keep low value of coupling.
Coupling is measured by the number of interconnections between modules. For exam-
ple, coupling increases as the number of calls between modules increases, or the amount of
shared data increases. The hypothesis is that design with high coupling will have more error~.
Loose coupling, on the other hand, minimizes the interdependence amongst modules. This can
be achieved in the following ways:
° Controlling the number of parameters passed amongst modules
eAvoid passing undesired data to calling module
• Maintain parent/child relationship between calling and called modules
• Pass data, not the control information
Fig. 5.6 demonstrates two alternative design for editing a student record in a "Student
Information System".
The first design demonstrates tight coupling wherein unnecessary information as stu-
dent name, student address, course is passed to the calling module. Passing superfluous infor-
mation unnecessary increases the overhead, reducing the system performance/efficiency.
[ 214 Software Engineering ]
Ifwe get it wrong, then at a higher level, we will find that it is not as per requirements;
then we have to redesign at a lower level. If a system is to be built from an existing system, this
approach is more suit able, as it starts from some existing modules.
We thus get a fairly natural division of our interpreter into a "read" module, an "evalu-
ate" module and a "print" module. Now we consider the "print" module and is given below:
Print (expression exp)
It is, of course, not necessary to create a program top-down, even though its structure is
function-oriented. However, ifwe want to delay the decision of what the system is supposed to
do as long as possible, a better choice is to structure the program around the data rather than
around the actions taken by the program.
q
o/ 4 ~