Module 4
Module 4
UNIT –6
Development
Requirements
Because of the changing environment, it is often impossible to arrive at a
stable, consistent set of system requirements. Therefore a waterfall model of
development is impractical and an approach to development based on iterative
specification and delivery is the only way to deliver software quickly.
Prototyping
For some large systems, incremental iterative development and delivery may
be impractical; this is especially true when multiple teams are working on
different sites.
Prototyping, where an experimental system is developed as a basis for
formulating the requirements may be used. This system is thrown away when
the system specification has been agreed .
Conflicting objectives
The objective of incremental development is to deliver a working system to
end-users. The development starts with those requirements which are best
understood.
The objective of throw-away prototyping is to validate or derive the system
requirements. The prototyping process starts with those requirements which
are poorly understood.
Agile methods
• Dissatisfaction with the overheads involved in design methods led to the
creation of agile methods. These methods:
• Focus on the code rather than the design;
• Are based on an iterative approach to software development;
• Are intended to deliver working software quickly and evolve this quickly
to meet changing requirements.
• Agile methods are probably best suited to small/medium-sized business
systems or PC products.
C u s to m e r in v o l v e m e n t T h e c u s t o m e r s h o u ld b e c l o s e l y i n v o l v e d t h r o u g h o u t t h e
d e v e l o p m e n t p r o c e s s . T h e i r r o l e i s p r o v i d e a n d p r i o r it i s e n e w
s y s t e m r e q u ir e m e n t s a n d t o e v a l u a t e t h e i t e r a t i o n s o f t h e s y s t e m .
Incrementaldelivery T h e s o f t w a r e i s d e v e l o p e d i n i n c r e m e n t s w i th t h e c u s t o m e r
s p e c i f y i n g t h e r e q u i r e m e n t s t o b e in c l u d e d i n e a c h i n c r e m e n t .
E m brace change E x p e c t t h e s y s t e m r e q u i r e m e n t s t o c h a n g e a n d d e s i g n th e s y s t e m
s o th a t i t c a n a c c o m m o d a t e t h e s e c h a n g e s .
Maintainsimplicity F o c u s o n s i m p l i c i ty i n b o t h t h e s o f t w a r e b e i n g d e v e l o p e d a n d i n
t h e d e v e l o p m e n t p r o c e s s u s e d . W h e r e v e r p o s s i b le , a c t i v e l y w o r k
to e l i m i n a t e c o m p le x i t y f r o m th e s y s t e m .
Extreme programming
• Perhaps the best-known and most widely used agile method.
• Extreme Programming (XP) takes an ‘extreme’ approach to iterative
development.
• New versions may be built several times per day;
• Increments are delivered to customers every 2 weeks;
• All tests must be run for every build and the build is only accepted if
tests run successfully.
I ncr em en tal p lan n in g R equire m en ts are re cord ed on Sto ry C ar ds and the Stories to be
included in a re le ase are determ ined b y th e tim e availab le a n d
their relative prior ity. T he deve lope rs br eak the se S tor ies into
deve lop m en t ŌT as ksÕ.
S m all R elease s T he m in im al u seful s et o f func tiona lity tha t prov ides b u siness
va lue is de ve lo ped fir st. R eleas es of the system are frequen t and
increm en tally a dd func tiona lity to the first relea se.
S im ple D esign E nough de sign is car ried ou t to m eet the cu r ren t requ irem en ts
an d no m o r e.
T est first deve lop m en t A n au to m ated un it tes t fr am ew o rk is u sed to wr ite tes ts for a ne w
p iece of func tiona lity be for e tha t fun ction ality itse lf is
im plem en ted .
R efactorin g A ll d e velope rs are ex pe c ted to refacto r the code con tinuo us ly as
so on as p o s sib le code im pr ove m en ts are fou nd. T h is keep s the
co de sim ple an d m ain tainab le.
Pair Programming Developers work in pairs, checking each otherÕs work and
providing the support to always do a good job.
Collective Ownership The pairs of developers work on all areas of the system, so that
no islands of expertise develop and all the developers own all the
code. Anyone can change anything.
Continuous Integration As soon as work on a task is complete it is integrated into the
whole system. After any such integration, all the unit tests in the
system must pass.
Sustainable pace Large amounts of over-time are not considered acceptable as the
net effect is often to reduce code qua lity and medium term
productivity
On-site Customer A representative of the end-user of the system (the Customer)
should be available full time for the use of the XP team. In an
extreme programming process, the customer is a member of the
development team and is responsible for bringing system
requirements to the team for implementation.
Requirements scenarios
• In XP, user requirements are expressed as scenarios or user stories.
• These are written on cards and the development team breaks them down
into implementation tasks. These tasks are the basis of schedule and cost
estimates.
• The customer chooses the stories for inclusion in the next release based
on their priorities and the schedule estimates.
XP and change
• Conventional wisdom in software engineering is to design for change. It
is worth spending time and effort anticipating changes as this reduces
costs later in the life cycle.
• XP, however, maintains that this is not worthwhile as changes cannot be
reliably anticipated.
• Rather, it proposes constant code improvement (refactoring) to make
changes easier when they have to be implemented
Testing in XP
• Test-first development. Incremental test development from scenarios.
• User involvement in test development and validation.
• Automated test harnesses are used to run all component tests each time
that a new release is built.
Test case description
Test-first development
• Writing tests before code clarifies the requirements to be implemented.
• Tests are written as programs rather than data so that they can be
executed automatically. The test includes a check that it has executed
correctly.
• All previous and new tests are automatically run when new functionality
is added. Thus checking that the new functionality has not introduced
errors.
Pair programming
In XP, programmers work in pairs, sitting together to develop code. This helps
develop common ownership of code and spreads knowledge across the team.
It serves as an informal review process as each line of code is looked at by
more than 1 person. It encourages refactoring as the whole team can benefit
from this. Measurements suggest that development productivity with pair
programming is similar to that of two people working independently.
A RAD environment
Interface generation
• Many applications are based around complex forms and developing
these forms manually is a time-consuming activity.
• RAD environments include support for screen generation including:
• Interactive form definition using drag and drop techniques;
• Form linking where the sequence of forms to be presented is specified;
• Form verification where allowed ranges in form fields are defined.
Visual programming
• Scripting languages such as Visual Basic support visual programming
where the prototype is developed by creating a user interface from
standard items and associating components with these items
• A large library of components exists to support this type of development
• These may be tailored to suit the specific application requirements.
COTS reuse
• An effective approach to rapid development is to configure and link
existing off the shelf systems. For example, a requirements management
system could be built by using:
• A database to store requirements;
• A word processor to capture requirements and format reports;
• A spreadsheet for traceability management;
Compound documents
For some applications, a prototype can be created by developing a compound
document. This is a document with active elements (such as a spreadsheet)
that allow user computations. Each active element has an associated
application which is invoked when that element is selected. The document
itself is the integrator for the different applications.
Application linking
Software prototyping
• A prototype is an initial version of a system used to demonstrate
concepts and try out design options.
A prototype can be used in:
• The requirements engineering process to help with requirements
elicitation and validation;
• In design processes to explore options and develop a UI design;
• In the testing process to run back-to-back tests.
Benefits of prototyping
• Improved system usability.
• A closer match to users’ real needs.
• Improved design quality.
• Improved maintainability.
• Reduced development effort.
Throw-away prototypes
• Prototypes should be discarded after development as they are not a good
basis for a production system:
• It may be impossible to tune the system to meet non-functional
requirements;
• Prototypes are normally undocumented;
• The prototype structure is usually degraded through rapid change;
• The prototype probably will not meet normal organizational quality
standards.
Software evolution
Software change
• Software change is inevitable
• New requirements emerge when the software is used;
• The business environment changes;
• Errors must be repaired;
• New computers and equipment is added to the system;
• The performance or reliability of the system may have to be improved.
• A key problem for organisations is implementing and managing
change to their existing software systems
MODULE 4
CHAPTER 2: SOFTWARE EVOLUTION
Once a system has been deployed, it inevitably has to change if it is to remain useful. There are
many reasons why software change is inevitable
As business changes and changes to user expectations generate new requirements for
the existing software
Parts of the software may have to be modified to correct errors that are found in
operation,
To adapt changes to its hardware and software platform
To improve its performance or other non-functional characteristics
A key problem for all organizations is implementing and managing change to their existing
software systems.
Organizations have huge investments in their software systems - they are critical
business assets. To maintain the value of these assets to the business, they must be
changed and updated. The majority of the software budget in large companies is devoted
to changing and evolving existing software rather than developing new software.
A spiral model of development and evolution represents how a software system evolves
through a sequence of multiple releases. (Figure 1)
Figure 2 shows the alternative view of the software evolution life cycle. In this model, they
distinguish between evolution and servicing.
Evolution: The stage in a software system’s life cycle where it is in operational use and
is evolving as new requirements are proposed and implemented in the system.
Servicing: At this stage, the software remains useful but the only changes made are
those required to keep it operational i.e. bug fixes and changes to reflect changes in the
software’s environment. No new functionality is added.
Phase-out: The software may still be used but no further changes are made to it.
Software evolution processes vary depending on the type of software being maintained,
the development processes used in an organization and the skills of the people involved.
System change proposals are the driver for system evolution in all organizations.
Change proposals may come from existing requirements that have not been
implemented in the released system, requests for new requirements, bug reports from
system stakeholders, and new ideas for software improvement from the system
development team.
The processes of change identification and system evolution are cyclic and continue
throughout the lifetime of a system as shows in Figure 3.
Figure 4 shows an overview of the evolution process. The process includes the
fundamental activities of change analysis, release planning, system implementation, and
releasing a system to customers.
If the proposed changes are accepted, a new release of the system is planned.
During release planning, all proposed changes such as fault repair, adaptation, and new
functionality are considered.
A decision is then made on which changes to implement in the next version of the
system. The changes are implemented and validated, and a new version of the system is
released.
The process then iterates with a new set of changes proposed for the next release.
The Change implementation stage should modify the system specification, design, and
implementation to reflect the changes to the system which is shown in Figure 5.
New requirements that reflect the system changes are proposed, analyzed, and validated.
System components are redesigned and implemented and the system is retested.
To make the change quickly means that you may not be able to follow the formal
change analysis process. Rather than modify the requirements and design, make an
emergency fix to the program to solve the immediate problem (Figure 6).
Software maintenance focuses on modifying a program after it has been put into use.
The term is mostly used for changing custom software. Generic software products are
said to evolve to create new versions.
Maintenance does not normally involve major changes to the system's architecture.
Changes are implemented by modifying existing components and adding new
components to the system.
1. Fault repairs: Coding errors are usually relatively cheap to correct. Design errors are
more expensive as they may involve rewriting several program components.
Requirements errors are the most expensive to repair because of the extensive system
redesign which may be necessary.
2. Environmental adaptation: When the system’s environment such as the hardware, the
platform operating system, or other support software changes, this types of maintenance
is required. The application system must be modified to adapt it to cope with these
environmental changes.
3. Functionality addition: This type of maintenance is necessary when the system
requirements change in response to organizational or business change.
Figure 9 shows how overall lifetime costs may decrease as more effort is expended during
system development to produce a maintainable system. Because of the potential reduction in
costs of understanding, analysis, and testing, there is a significant multiplier effect when the
system is developed for maintainability.
For System 1, extra development costs of $25,000 are invested in making the system more
maintainable. This results in a savings of $100,000 in maintenance costs over the lifetime of
the system. This assumes that a percentage increase in development costs results in a
comparable percentage decrease in overall system costs.
The reasons for more expensive Maintenance cost include factors such as:
1. Team stability: After a system has been delivered, the development team to be broken
up and for people to work on new projects. The new team or the individuals responsible
for system maintenance do not understand the system or the background to system
design decisions. They need to spend time understanding the existing system before
implementing changes to it.
2. Poor development practice: The contract to maintain a system is usually separate from
the system development contract. Lack of team stability, if there is no incentive for a
development team to write maintainable software and if a development team cut corners
to save effort during development then software is more difficult to change in the future.
3. Staff skills: Maintenance staff are relatively inexperienced and unfamiliar with the
application domain.
4. Program age and structure: as programs age, their structure is degraded and they
become harder to understand and change.
Maintenance prediction is concerned with what system changes might be proposed and what
parts of the system are likely to be the most difficult to maintain and to estimate the overall
maintenance costs for a system in a given time period.
To evaluate the relationships between a system and its environment, assess the following:
1. The number and complexity of system interfaces:
2. The number of inherently volatile system requirements:
3. The business processes in which the system is used
There are two important benefits from reengineering rather than replacement.
1. Reduced risk: there is a high risk in new software development. There may be
development problems, staffing problems and specification problems.
2. Reduced cost: the cost of reengineering is significantly less than the costs of developing
new software.
Figure11 is a general model of the reengineering process. The input to the process is a legacy
program and the output is an improved and restructured version of the same program.
The costs of reengineering depend on the extent of the work that is carried out. There is a
spectrum of possible approaches to reengineering, as shown in Figure 12.
'Bad smells' of code are stereotypical situations in which the code of a program can be improved
through refactoring:
1. Duplicate code: The same of very similar code may be included at different places in a
program. This can be removed and implemented as a single method or function that is
called as required.
2. Long methods: If a method is too long, it should be redesigned as a number of shorter
methods.
3. Switch (case) statements: These often involve duplication, where the switch depends
on the type of some value. The switch statements may be scattered around a program.
In object-oriented languages, polymorphism can be used to achieve the same thing.
4. Data clumping: Data clumps occur when the same group of data items reoccur in
several places in a program. These can be replaced with an object encapsulating all of
the data.
5. Speculative generality: This occurs when developers include generality in a program
in case it is required in future. This can often simply be removed.