Introduction to Software Engineering
Introduction to Software Engineering
Software engineering
Concerned with theories, methods, and tools for professional software development.
Expenditure on software represents a significant fraction of GNP (Gross National Product) in all
developed countries.
An engineering discipline that is concerned with all aspects of software production from the
early stages of system specification through to maintaining the system after it has gone into use.
Engineering discipline
o Using appropriate theories and methods to solve problems bearing in mind organization
and financial constraints.
All aspects of software production
o Technical process of development, project management, and development of
tools/methods… to support software production
Be able to produce reliable and trustworthy systems economically and quickly as more and
more individuals/society rely on advanced software system
Instead of writing the program as if it were a personal programming project, it is typically more
cost-effective in the long run to apply software engineering processes and techniques for
software systems. The majority of system types, come from modifying the software after the
system has been put into service.
Software costs
Software costs often dominate computer system costs. PC software’s costs > PC hardware’s
costs
Software costs more to maintain than it does to develop. For systems with a long life,
maintenance costs may be several times development costs.
Software engineering is concerned with cost-effective software development.
2
Software
o Computer programs and associated documentation. Software products may be
developed for a particular customer or may be developed for a general market.
Attributes of good software
o Should deliver the required functionality and performance to the user and should be
maintainable, dependable, and usable.
Software engineering
o An engineering discipline that is concerned with all aspects of software production.
Fundamental software engineering activities
o Software specification, software development, software validation, software evolution.
Difference between software engineering and computer science
o Computer science: focuses on theory and fundamentals.
o Software engineering: concerned with the practicalities of developing and delivering
useful software.
Difference between software engineering and system engineering
o System engineering: concerned with all aspects of computer-based systems
development including hardware, software, and process engineering.
3
Software products
Generic products
o Stand-alone systems that are marketed and sold to any customer who wishes to buy
them.
o Example: PC software – graphics programs; project management tool; CAD software;
software for specific markets – appointments systems for dentists
Customized products
o Software that is commissioned by a specific customer to meet their own needs.
o Example: Embedded control systems, air traffic control software, traffic monitoring
systems.
Product specification
Generic products
4
o The specification of what the software should do is owned by the software developer
and decisions on software change are made by the developer.
Customized products
o The specification of what the software should do is owned by the customer for the
software and they make decisions on software changes that are required.
Maintainability
o Software SHOULD BE written in such a way so that it can evolve to meet the changing
needs of customers.
o This is a critical attribute because software change is inevitable requirement of a
changing business environment
Dependability and security
o Software dependability includes a range of characteristics including reliability, security,
and safety.
o Dependable software SHOULD NOT cause physical or economic damage in the event of
system failure.
o Malicious users SHOULD NOT be able to access or damage the system
Efficiency
o Software SHOULD NOT make wasteful use of system resources such as memory and
processor cycles.
o Efficiency therefore includes responsiveness, processing time, memory utilization, …
Acceptability
o Software MUST be acceptable to the type of users for which it is designed it MUST be
understandable, usable, and compatible with other systems that they use.
Software specification: the process through which customers and engineers specify the
requirements for the software that will be create.
Software development: where the software is designed and programmed
Software validation: where the software is checked to ensure that it is what the customer
requires
5
Software evolution: where the software is modified to reflect changing customer and market
requirements.
Heterogeneity
o Systems must increasingly function as distributed systems over networks that contain
various computer and mobile device kinds.
Business and social change
o With the growth of emerging economies and the availability of new technology,
business and society are evolving at an incredibly rapid pace. They must be able to
modify their current software and create new software quickly.
There are numerous different kinds of software systems, and no single set of software
techniques can be used for all of them.
The methods and tools used in software engineering depend on the kind of application being
produced, the client's needs, and the team's prior experience.
Application types
Stand-alone applications
o These are local computer-based application platforms, like PCs. They come with all
necessary features and don't require a network connection.
Interactive transaction-based applications
o Applications that users can access from their own PCs or terminals while running on a
remote device. Web applications like e-commerce ones are among them.
6
Some fundamental principles apply to all types of software system, irrespective of the
development techniques used:
o A controlled and clear development process should be used while creating systems. Of
course, several processes are employed for various software kinds.
o For all systems, dependability and performance are essential.
o It's important to understand and manage the software requirements and specifications
(what the software should be able to perform).
o You should reuse previously created software whenever possible rather than creating
new software.
7
More than just the use of technical abilities is involved in software engineering.
If software engineers want to be considered as professionals, they must conduct themselves
honestly and responsibly.
More than only upholding the law, ethical behavior requires following to a set of morally just
ideals.
Confidentiality
o Whether or not a formal confidentiality agreement has been written, engineers should
generally maintain the confidentiality of their employers or clients.
Competence
o Engineers shouldn't exaggerate how skilled they are. They shouldn't intentionally accept
work that is beyond their areas of expertise.
Intellectual property rights
o Engineers need to be knowledgeable with regional laws controlling the use of
intellectual property, including copyright and patents. They should take care to preserve
the intellectual property of their clients and employers.
Computer misuse
o Software developers shouldn't abuse other people's machines by using their technical
knowledge. Computer abuse can range from very minor offences, like playing games on
a work computer, to very serious ones (dissemination of viruses)
8
Activities in processes – specifying a data model, designing a user interface, … and the ordering
of these activities.
Process description may also include:
o Products – the outcomes of a process activity
o Roles – reflect the responsibilities of the people involved in the process.
o Pre- and post-conditions – statements that are true before and after a process activity
has been enacted or a product produced.
Plan-driven processes – processes where all of the process activities are planned in advance and
progress is measured against this plan.
In agile processes, planning is incremental, and it is easier to change the process to reflect
changing customer requirements.
In practice, most practical processes include elements of both plan-driven and agile approaches.
There are NO right or wrong software process.
9
Stand-alone application systems (COTS) that are configured for use in particular environment.
Collections of objects that are developed as a package to be integrated with a component
framework such as .NET or J2EE.
Web services that are developed according to service standards and which are available for
remote invocation.
Process activities
REAL software processes are inter-leaved sequences of technical, collaborative, and managerial
activities with the overall goal of specifying, designing, implementing, and testing a software
system
4 basis process activities of specification, development, validation, and evolution are organized
differently in different development processes
Example: waterfall model
o In waterfall model, they are organized in sequence, whereas in incremental
development they are inter-leaved
Software specification
The process of establishing what services are required and the constraints on the system’s
operation and development
Requirements engineering process
o Requirements elicitation and analysis
o Requirements specification
o Requirements validation
13
Design activities
Architectural design – identify the overall structure of the system, the principal components
(subsystems or modules), their relationships and how they are distributed
Databased design – design the system data structures and how these are to be represented in a
database
Interface design – define the interfaced between system components
Component selection and design – search for reusable components. If unavailable, you design
how it will operate
14
System implementation
Software validation
Verification and validation (V&V) is intended to show that a system conforms to its specification
and meets the requirements of the system customer
Involve checking and review processes and system testing
System testing involves executing the system with test cases that are derived from the
specification of the real data to be processed by the system
Testing is the most commonly used V&V activity
Stage of testing
Component testing
o Individual components are tested independently
o Components may be functions or objects or coherent groupings of these entities
System testing
o Testing of the system as a whole. Testing of emergent properties is particularly
important
Customer testing
o Testing with customer data to check that the system meets the customer’s needs
15
Software evolution
System prototyping – a version of the system or part of the system is developed quickly to check
the customer’s requirements and the feasibility of design decisions. This approach supports
change anticipation.
Incremental delivery – system increments are delivered to the customer for comment and
experimentation. This supports both change avoidance and change tolerance.
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:
17
Benefits of prototyping
Prototype development
Throw-away prototypes
Prototypes SHOULD BE discarded AFTER development as they are not a good basis for a
production system:
o It may be impossible to tune the system to meet non-functional requirements
18
Incremental delivery
Instead of offering the system as a single delivery, development and delivery are divided into
increments, each of which provides a portion of the necessary capability
User requirements are prioritized, and the highest priority requirements are included in early
increments
Once the development of an increment is started, the requirements are frozen though
requirements for later increments can continue to evolve
Incremental development
o Develop the system in increments and evaluate each increment before proceeding to
the development of the next increment
o Normal approach used in agile methods
o Evaluation done by user/customer proxy
Incremental delivery
o Deploy an increment for use by end-users
o More realistic evaluation about practical use of software
o Difficult to implement for replacement systems as increments have less functionality
than the system being replaced
19
o Advantages
Customer value can be delivered with each increment, so system
functionality is available earlier
Early increments act as a prototype to help elicit requirements for later
increments
Lower risk of overall project failure
The highest priority system services tend to receive the most testing
o Problems
Most systems require a set of basis facilities that are used by different
parts of the system
It can be challenging to discover common facilities that are
required by all increments because needs are not established in
full until an increment is to be implemented
The essence of iterative processes is that the specification is developed
in conjunction with the software
However, this conflicts with the procurement model of many
organizations, where the complete system specification is part
of the system development contract
20
Key points
Software processes are the activities involved in producing a software system. Software process
models are abstract representations of these processes.
General process models describe the organization of software processes
Examples of these general models include the ‘waterfall’ model, incremental development,
and reuse-oriented development.
Requirements engineering is the process of developing a software specification.
Design and implementation processes are concerned with transforming a requirements
specification into an executable software system.
Software validation is the process of checking that the system conforms to its specification and that
it meets the real needs of the users of the system.
Software evolution takes place when you change existing software systems to meet new
requirements. The software must evolve to remain useful.
Processes should include activities such as prototyping and incremental delivery to cope with
change.
Processes may be structured for iterative development and delivery so that changes may be made
without disrupting the system as a whole
The principal approaches to process improvement are agile approaches, geared to reducing process
overheads, and maturity-based approaches based on better process management and the use of
good software engineering practice.
The SEI process maturity framework identifies maturity levels that essentially correspond to the use
of good software engineering practice
22
Rapid development and delivery is now often the most important requirement for software
systems
o Businesses operate in a fast – changing requirement and it is practically impossible to
produce a set of stable software requirements
o Software has to evolve quickly to reflect changing business needs
Plan-driven development is essential for some types of system but does not meet these business
needs
Agile development methods emerged in the late 1990s whose aim was to radically reduce the
delivery time for working software systems
Agile development
Plan-driven development
o A plan-driven approach to software engineering is based around separate development
stages with the outputs to be produced at each of these stages planned in advance
o Not necessarily waterfall model – plan-driven, incremental development is possible
o Iteration occurs within activities
Agile development
o Specification, design, implementation, and testing are inter-leaved and the outputs from
the development process are decided through a process of negotiation during the
software development process
Agile methods
Dissatisfaction with the overheads involved in software design methods of the 1980s and 1990s
led to the creation of agile methods. These methods:
o Focus on the code rather than the design
o Are based on an iterative approach to software development
o Are intended to deliver working software quickly and evolve this quickly to meet
changing requirements
The aim of agile methods is to reduce overheads in the software process (by limiting
documentation) and to be able to respond quickly to changing requirements without excessive
rework
24
Agile manifesto
Customer involvement
o Customers SHOULD BE closely involved throughout the development process.
o Their role is provided and prioritize new system requirements and to evaluate the
iterations of the system
Incremental delivery
o The software is developed in increment with the customer specifying the requirements
to be included in each increment.
People do not process
o The skills of the development team SHOULD BE recognized and exploited. Team
members SHOULD BE left to develop their own ways of working without prescriptive
process
Embrace change
o Expect the system requirements to change and so design the system to accommodate
these changes
Maintain simplicity
o Focus on simplicity in both the software being developed and in the development
process. Wherever possible, actively work to eliminate complexity from the system
Scrum
An agile method that focuses on managing iterative development rather than specific agile
practices
There are 3 phases in Scrum:
o The initial phase is an outline planning phase where you establish the general
objectives for the project and design the software architecture
o Followed by a series of sprint cycles, where each cycle develops an increment of the
system
o The project closure phases wraps up the project, completes required documentation
such as system help frames and user manuals and assesses the lessons learned from the
project
Scrum terminology
Development team
o A self-organizing group of software developers, which should be NO MORE THAN 7
people. They are responsible for developing the software and other essential project
documents
Potentially shippable product increment
26
o The software increment that is delivered from a sprint. The idea is that this SHOULD BE
potentially shippable, which means that it is in a finished state and no further work,
such as testing, is needed to incorporate it into the final product, this is not always
achievable
Product backlog
o This is a list of tasks that the Scrum team needs to complete. They could be user stories,
software requirement specifications, feature definitions, or descriptions of additional
tasks like architecture definition or user documentation
Product owner
o A person (or potentially a small group) whose responsibility it is to identify product
requirements or features, rank them for development, and then continually assess the
product backlog to make sure the project is still meeting crucial business needs. The
product owner may be a consumer or another stakeholder representative, such as a
product manager in a software firm
Scrum
o A daily scrum team meeting where tasks for the day are prioritized and progress is
reviewed. This SHOULD ideally be a brief, in-person meeting with the entire team.
Scrum-master
o The scrum-master is in charge of ensuring that the scrum methodology is adhered to
and directing the team in its efficient application. He or she is charge of liaising with the
rest of the business and making sure that outside interference does not distract the
scrum team. The scrum-master should not be viewed as a project manager, insist the
scrum developers. Others, however, might not always find it simple to distinguish
between the two
Sprint
o An improvement cycles. Sprints typically last 2-4 weeks
Velocity
o An estimate of the amount of work on the product backlog that a team can complete in
one sprint. Knowing a team’s velocity enables them to predict how much ground they
can cover in a sprint and offers a foundation for evaluating how well they are
performing.
27
Scrum framework
ROLES
PRODUCT OWNER
SCRUM-MASTER
TEAM
MEETINGS
SPRINT PLANNING
SPRINT REVIEW
SPRINT RETROSPECTIVE
DAILY SCRUM MEETING
COMPONENTS
PRODUCT BACKLOG
SPRINT BACKLOG
BURNDOWN CHARTS
The team
Once these are agreed, the team organize themselves to develop the software
During this stage, the team is isolated from the customer and the organization, with all
communications channeled through the so-called “Scrum-master”
The role of the scrum master is to protect the development team from external distractions
At the end of the sprint, the work done is reviewed and presented to stakeholders. The next
sprint cycle then begins
The starting point for planning is the product backlog, which is the list of work to be done on the
project
The project team as a whole chooses the features and functionality from the product backlog to
be created during the sprint while in the selection phase
Burn down charts are a graphical representation of work left to do versus time
31
Teamwork in Scrum
32
The Scrum master is a facilitator who arranges daily meetings, tracks the backlog of work to be
done, records decisions, measures progress against the backlog and communicates with
customers and management outside of the team
The whole team attends short daily meetings (Scrums) where all team members share
information, describe their progress since the last meeting, problems that have arisen and what
is planned for the following day
o This means that everyone on the team knows what is going on and, if problems arise,
can re-plan short-term work to cope with them.
Scrum benefits
The product is broken down into a set of manageable and understandable chunks.
Unstable requirements do not hold up progress.
The whole team have visibility of everything and consequently team communication is
improved.
Customers see on-time delivery of increments and gain feedback on how the product works.
Trust between customers and developers is established and positive culture is created in which
everyone expects the project to succeed.
Distributed Scrum
The Scrum-master should be located with the development team so that he/she is aware of
everyday problems
The product owner should visit the developers and try to establish a good relationship with
them. It is essential that they trust each other.
Real-time communications between team members for informal communication, particularly
instant messaging and video calls
Continuous integration, so that all team members can be aware of the state of the product at
any time
A common development environment for all teams.
Videoconferencing between the product owner and the development team
Extreme programming
33
A very influential agile method, developed in the late 1990s, that introduced a range of agile
development techniques
Extreme Program (XP) takes an “extreme” approach to iterative development
o New versions may be built several times per day
o Increments are delivered to customers every 2 weeks
o All tests must be run for every build and the build is only accepted IF tests run
successfully
Incremental planning
o Requirements are recorded on story cards and the stories to be included in a release are
determined by the time available and their relative priority. The developers break these
stories into development “Tasks”
Small releases
o The minimal useful set of functionalities that provides business value is developed first.
Releases of the system are frequent and incrementally add functionality to the first
release
System metaphor (Description of the system)
o Guide all development with a simple shared story of how the whole system works
Simple design
o Enough design is carried out meet the current requirements and no more
Test-first development
o An automated unit test framework is used to write tests for a new piece of functionality
before that functionality itself is implemented
Refactoring (code refactoring)
o All developers are expected to refactor the code continuously as soon as possible code
improvements are found. This keeps the code simple and maintainable
Pair programming
o Developers work in pairs, checking each other’s work and providing the support to
always do a good job
Collective ownership
o The pairs of developers work on all areas of the system, so that no islands of expertise
develop and all the developers take responsibility for all of the code. Anyone can change
anything
Continuous integration
o As soon as the 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
o Large amounts of overtime are not considered acceptable as the net effect is often to
reduce code quality and medium-term productivity
On-site customer
35
Communication
o Building software systems requires:
Communicating system requirements to the developers of the system.
Communicating the software interfaces (APIs) to fellow developers.
o In formal software development methodologies, this task is accomplished through
documentation.
o Extreme programming techniques can be viewed as methods for efficiently building and
disseminating institutional knowledge among members of a development team.
o The goal is to give all developers a shared view of the system which matches the view
held by the users of the system.
o To this end, extreme programming favors simply designs, common metaphors,
collaboration of users and programmers, frequent verbal communication, and
feedback
o During coding, automated code documentation generation tools (e.g., Doxygen,
Javadoc) can be used to facilitate communication between developers.
Simplicity
o Extreme programming encourages starting with the simplest solution. Extra
functionality can then be added later
o The difference between this approach and more conventional system development
methods is the focus on designing and coding for the needs of today instead of those of
tomorrow, next week, or next month.
o Often summed up as the “You aren’t gonna need it” approach.
36
o Coding and designing for uncertain future requirements implies the risk of spending
resources on something that might not be needed, while perhaps delaying crucial
features that are needed now.
o A simple design with very simple and neat code could be easily understood by most
programmers in the team.
o When many little steps are made, the customer and the developers have more control
and feedback over the development process and the system that is being developed.
Feedback
o Feedback from the system – by writing unit tests, or running periodic integration tests,
the programmers have direct feedback from the state of the system after implementing
changes
o Feedback from the customer – the functional tests are provided by the customer and
the testers. They will get concrete feedback about the current state of their system. This
review is planned once in every 2 or 3 weeks during the delivery of each build so the
customer can easily steer the development.
o Feedback from the team – when customers come up with new requirements in the
planning game the team directly gives an estimate of the time that it will take to
implement.
o Feedback is closely related to communication and simplicity.
o Flaws in the system are easily communicated by writing a unit test that proves a certain
piece of code will break.
o The direct feedback from the systems tells programmers to recode this part.
o A customer is able to test the system periodically according to the functional
requirements, simplified as user stories
Courage
o Several XP practices required courage. One is to always design and code for today and
not for tomorrow. This is an effort to avoid getting bogged down in overly complicated
design and concentrate on what is required now.
o Courage enables developers to feel comfortable with refactoring their code when
necessary. This means reviewing the existing system and modifying it so that future
changes can be implemented more easily.
37
o Continuous is integration forces all individuals to confront their own code with the
main body of code, which might uncover design flaws or omissions.
o Pair programming forces individuals to uncover their lack of knowledge or erroneous
code to tier peers as they are working in pairs.
o Courage is required when code needs to be thrown away: courage to remove source
code that is obsolete, no matter how much effort was used to write it.
Respect
o The respect value includes respect for others as well as self-respect.
o Programmers should never commit changes that break compilation that make existing
unit-tests fail, or that otherwise delay the work of their peers.
o Members respect their own work by always striving for high quality and seeking for the
best design for the solution at hand through refactoring, and to follow coding
standards.
o Adopting good values leads to respect gained from others in the team. Nobody on the
team should feel unappreciated or ignored if they embrace the values common to the
team.
o This ensures a high level of motivation and encourages loyalty toward the team and
toward the goal of the project.
o This value is very dependent upon the other values, and is very much oriented toward
people in a team.
Embracing change
o The principle of embracing change is about not working against changes but embracing
them.
o For instance, if at one of the iterative meetings it appears that the customer’s
requirements have changed dramatically, programmers are to embrace this and plan
the new requirements for the next iteration.
o If the design of the system shows significant flaws that are hampering further
development, its change should be embraced through redesign and refactoring.
o When encountering unit testing failures or integration problems, one should see this as
an opportunity to improve the system.
38
Influential XP practices
Extreme programming has a technical focus and is not easy to integrate with management
practice in most organizations.
Consequently, while agile development uses practices for XP, the method as originally defined is
not widely used.
Key practices
o User stories for specification
o Refactoring
o Test-first development
o Pair programming
In XP, a customer or user is part of the XP team and is responsible for making decisions on
requirements.
User requirements are expressed as user stories or scenarios.
These are written on cards and the development team break 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.
39
Refactoring
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.
Programming team look for possible software improvements and make these improvements
even where there is no immediate need for them.
This improves the understandability of the software and so reduces the need for
documentation.
Changes are easier to make because the code is well-structured and clear.
However, some changes requires architecture refactoring and this is much more expensive.
40
Test-first development
Testing is central to XP and XP has developed an approach where the program is tested after
every change has been made
XP testing features
o Test-first development
o Incremental test development from scenarios
o User involvement in test development and validation
o Automated test harnesses are used to run all component test each time that a new
release is built.
Problems
o Programmers prefer programming to testing and sometimes they take short cuts when
writing tests. For example, they may write incomplete tests that do not check for all
possible exceptions that may occur.
o Some tests can be very difficult to write incrementally.
o It difficult to judge the completeness of a set of tests. Although you may have a lot of
system tests, your test set may not provide complete coverage.
Test-driven development
Customer involvement
The role of the customer in the testing process is to help development acceptance tests for the
stories that are to be implemented in the next release of the system.
The customer who is part of the team writes tests as development proceeds. All new code is
therefore validated to ensure that it is what the customer needs.
41
However, people adopting the customer role have limited time available and so cannot work
full-time with the development team. They may feel that providing the requirements was
enough of a contribution and so may be reluctant to get involved in the testing process.
Test automation
Test automation means that tests are written as executable components before the task is
implemented.
o These testing components should be stand-alone, should simulate the submission of
input to be tested and should check that the result meets the output specification. An
automated test framework is a system that makes it easy to write executable tests and
submit a set of tests for execution.
As testing is automated, there is always a set of tests that can be quickly and easily executed.
o Whenever any functionality is added to the system, the tests can be run and problems
that the new code has introduced can be caught immediately.
Pair programming
The principal responsibility of software project managers is to manage the project so that
software is delivered on time and within the planned budget for the project.
The standard approach to project management is plan-driven. Managers draw up a plan for the
project showing what should be delivered, when it should be delivered and who will work on
the development of the project deliverables.
Agile project management requires a different approach, which is adapted to incremental
development and the practices used in agile methods.
Agile methods have proved to be successful for small and medium sized projects that can be
developed by a small co-located team.
It is sometimes argued that the success of these methods comes because of improved
communications which is possible when everyone is working together.
Scaling up agile methods involves changing these to cope with larger, longer projects where
there are multiple development teams, perhaps working in different locations.
Scaling up – is concerned with using agile methods for developing large software systems that
cannot be developed by a small team.
Scaling out – is concerned with how agile methods can be introduced across a large organization
with many years of software development experience.
When scaling agile methods, it is important to maintain agile fundamentals:
o Flexible planning, frequent system releases, continuous integration, test-driven
development and good team communications.
The informality of agile development is incompatible with the legal approach to contract
definition that is commonly used in large companies.
Agile methods are most appropriate for new software development rather than software
maintenance. Yet the majority of software costs in large companies come from maintaining their
existing software systems.
43
Agile methods are designed for small co-located teams yet much software development now
involves worldwide distributed teams.
Contractual issues
Most software contracts for custom systems are based around a specification, which sets out
what has to be implemented by the system developer for the system customer.
However, this precludes interleaving specification and development as is the norm in agile
development.
A contract that pays for developer time rather than functionality is required.
o However, this is seen as a high risk my many legal departments because what has to be
delivered cannot be guaranteed.
Most organizations spend more on maintaining existing software than they do on new software
development. So, if agile methods are to be successful, they have to support maintenance as
well as original development.
Two key issues:
o Are systems that are developed using an agile approach maintainable, given the
emphasis in the development process of minimizing formal documentation?
o Can agile methods be used effectively for evolving a system in response to customer
change requests?
Problems may arise if original development team cannot be maintained.
Agile maintenance
Most projects include elements of plan-driven and agile processes. Deciding on the balance
depends on:
o Is it important to have a very detailed specification and design before moving to
implementation? If so, you probably need to use a plan-driven approach.
o Is an incremental delivery strategy, where you deliver the software to customers and get
rapid feedback from them, realistic? If so, consider using agile methods.
o How large is the system that is being developed? Agile methods are most effective when
the system can be developed with a small co-located team who can communicate
informally. This may not be possible for large systems that require larger development
teams so a plan-driven approach may have to be used.
Principle Practice
Customer This depends on having a customer who is willing and able to spend
involvement time with the development team and who can represent all system
stakeholders. Often, customer representatives have other demands
on their time and cannot play a full part in the software
development.
Maintain Under pressure from delivery schedules, team members may not
simplicity have time to carry out desirable system simplifications.
People not Individual team members may not have suitable personalities for the
process intense involvement that is typical of agile methods, and therefore
may not interact well with other team members.
System issues
How good are the designers and programmers in the development team?
o It is sometimes argued that agile methods require higher skill levels than plan-based
approaches in which programmers simply translate a detailed design into code.
How is the development team organized?
o Design documents may be required if the team is distributed.
What support technologies are available?
o IDE support for visualization and program analysis is essential if design documentation is
not available.
Organizational issues
Large systems are usually collections of separate, communicating systems, where separate
teams develop each system. Frequently, these teams are working in different places, sometimes
in different time zones.
Large systems are ‘brownfield systems’, that is they include and interact with a number of
existing systems. Many of the system requirements are concerned with this interaction and so
don’t really lend themselves to flexibility and incremental development.
Where several systems are integrated to create a system, a significant fraction of the
development is concerned with system configuration rather than original code development.
47
Large systems and their development processes are often constrained by external rules and
regulations limiting the way that they can be developed.
Large systems have a long procurement and development time. It is difficult to maintain
coherent teams who know about the system over that period as, inevitably, people move on to
other jobs and projects.
Large systems usually have a diverse set of stakeholders. It is practically impossible to involve all
of these different stakeholders in the development process.
Multi-team Scrum
Role replication
o Each team has a Product Owner for their work component and ScrumMaster.
Product architects
o Each team chooses a product architect, and these architects collaborate to design and
evolve the overall system architecture.
Release alignment
o The dates of product releases from each team are aligned so that a demonstrable and
complete system is produced.
Scrum of Scrums
o There is a daily Scrum of Scrums where representatives from each team meet to discuss
progress and plan work to be done.
Project managers who do not have experience of agile methods may be reluctant to accept the
risk of a new approach.
Large organizations often have quality procedures and standards that all projects are expected
to follow and, because of their bureaucratic nature, these are likely to be incompatible with
agile methods.
Agile methods seem to work best when team members have a relatively high skill level.
However, within large organizations, there are likely to be a wide range of skills and abilities.
There may be cultural resistance to agile methods, especially in those organizations that have a
long history of using conventional systems engineering processes.
49
It can be difficult to keep the interest of customers / users who are involved in the process.
Team members may be unsuited to the intense involvement that characterizes agile methods.
Prioritizing changes can be difficult where there are multiple stakeholders.
Maintaining simplicity requires extra work.
Contracts may be a problem as with other approaches to iterative development.
Because of their focus on small, tightly integrated teams, there are problems in scaling agile
methods to large systems.
Less emphasis on documentation - harder to maintain when you get a new team for
maintenance.
Key points
Agile methods are incremental development methods that focus on rapid software development,
frequent releases of the software, reducing process overheads by minimizing documentation and
producing high-quality code.
Agile development practices include:
User stories for system specification
Frequent releases of the software
Continuous software improvement
Test-first development
Customer participation in the development team
Scrum is an agile method that provides a project management framework.
It is centered round a set of sprints, which are fixed time periods when a system increment
is developed.
Many practical development methods are a mixture of plan-based and agile development.
Scaling agile methods for large systems is difficult
Large systems need up-front design, and some documentation and organizational practice
may conflict with the informality of agile approaches.
50
Requirement engineering
The process of establishing the services that a customer requires from a system and the
constraints under which it operates and is developed.
The system requirements are the descriptions of the system services and constraints generated
during the requirements engineering process.
What is a requirement?
If a company wishes to let a contract for a large software development project, it MUST defined
its needs in a sufficiently abstract way that a solution is not pre-defined.
The requirements must be written so that several contractors can bid for the contract,
offering, perhaps, different ways of meeting the client organization’s needs.
Once a contract has been awarded, the contractor must write a system definition for the client
in more detail so that the client understands and can validate what the software will do
Both of these documents may be called the requirements document for the
system.
51
Type of requirement
User requirements
o Statements in natural languages diagrams of the services the system provides and its
operational constraints. Written for customers.
o Example:
The Mentcare (mental health care) system shall generate monthly management
reports showing the cost of drugs prescribed by each clinic during that month.
o Readers:
Client managers
System end-users
Client engineers
Contractor managers
System architects
System requirements
o A structured document setting out detailed descriptions of the system’s functions,
services, and operational constraints. Defines what should be implemented so may be
part of a contract between client and contractor.
o Example:
On the last working day of each month, a summary of the drugs prescribed,
their cost and the prescribing clinics shall be generated.
The system shall generate the report for printing after 17:30 on the last working
day of the month.
A report shall be created for each clinic and shall list the individual drug names,
the total number of prescriptions, the number of doses prescribed and the total
cost of the prescribed drugs.
If drugs are available in different dose units separate reports shall be created for
each dose unit
Access to drug cost reports shall be restricted to authorized users as listed on a
management access control list.
o Readers:
52
System end-users
Client engineers
Software architects
Software developers
System stakeholders
Any person or organization who is affected by the system in some way and so who has a
legitimate interest.
Stakeholder types
o End-users
o System managers
o System owners
o External stakeholders
Many agile methods argue that producing detailed system requirements is a waste of time as
requirements change so quickly.
The requirements document is therefore always out of date.
53
Agile methods usually use incremental requirements engineering and may express requirements
as “user stories”.
This is practical for business systems but problematic for systems that require pre-delivery
analysis (e.g., critical systems) or systems developed by several teams.
Functional requirements
o Statements of services the system should provide, how the system should react to
particular inputs and how the system should behave in particular situations.
o May state what the system should not do.
Non-functional requirements
o Constraints on the services or functions offered by the system such as timing
constraints, constraints on the development process, standards, …
o Often apply to the system as a whole rather than individual features or services.
Domain requirements
o Constraints on the system from the domain of operation.
Functional requirements
A user shall be able to search the appointments lists for all clinics.
The system shall generate each day, for each clinic, a list of patients who are expected to attend
appointments that day.
Each staff member using the system shall be uniquely identified by his or her 8-digit employee
number.
54
Requirements imprecision
Non-functional requirements
These define system properties and constraints e.g. reliability, response time and storage
requirements. Constraints are I/O device capability, system representations, …
Process requirements may also be specified mandating a particular IDE, programming language
or development method.
Non-functional requirements may be more critical than functional requirements. If these are not
met, the system may be useless.
55
Non-functional requirements may affect the overall architecture of a system rather than the
individual components.
o Example:
To ensure that performance requirements are met, you may have to organize
the system to minimize communications between components.
A single non-functional requirement, such as a security requirement, may generate a number of
related functional requirements that define system services that are required.
o It may also generate requirements that restrict existing requirements.
56
Non-functional classifications
Product requirements
o Requirements which specify that the delivered product must behave in a particular way
(e.g., execution speed, reliability, …)
Organizational requirements
o Requirements which are a consequence of organizational policies and procedures (e.g.
process standards used, implementation requirements, …)
External requirements
o Requirements which arise from factors which are external to the system and its
development process (e.g. interoperability requirements, legislative requirements, …)
Usability requirements
The system should be easy to use by medical staff and should be organized in such a way that
user errors are minimized. (Goal)
Medical staff shall be able to use all the system functions after four hours of training. After this
training, the average number of errors made by experienced users shall not exceed two per
hour of system use. (Testable non-functional requirement)
57
Property Measure
Speed Processed transactions/second
User/event response time
Screen refresh time
Size Mbytes
Number of ROM chips
Ease of use Training time
Number of help frames
Reliability Mean time to failure
Probability of unavailability
Rate of failure occurrence
Availability
Robustness Time to restart after failure
Percentage of events causing failure
Probability of data corruption on failure
Portability Percentage of target dependent statements
Number of target system
The processes used for RE vary widely depending on the application domain, the people
involved and the organization developing the requirements.
There are number of generic activities common to all processes.
o Requirements elicitation.
o Requirements analysis.
o Requirements validation.
58
o Requirements management.
In practice, RE is an iterative activity in which these processes are interleaved.
Requirement elicitation
Software engineers work with a range of system stakeholders to find out about the application
domain, the services that the system should provide, the required system performance,
hardware constraints, other system…
Stages include:
o Requirements discovery
Interacting with stakeholders to discover their requirements. Domain
requirements are also discovered at this stage.
o Requirements classification and organization
Groups related requirements and organized them into coherent clusters.
o Requirements prioritization and negotiation
Prioritizing requirements and resolving requirements conflicts.
o Requirements specification
Requirements are documented and input into the next round of the spiral.
Problems:
o Stakeholders don’t know what they really want.
o Stakeholders express requirements in their own terms.
o Different stakeholders may have conflicting requirements.
o Organizational and political factors may influence the system requirements.
o The requirements change during the analysis process. New stakeholders may emerge,
and the business environment may change.
60
Interviewing
Interviews in practice
Application specialists may use language to describe their work that isn’t easy for the
requirements engineer to understand.
Interviews are not good for understanding domain requirements.
o Requirements engineers cannot understand specific domain terminology.
o Some domain knowledge is so familiar that people find it hard to articulate or think that
it isn’t worth articulating.
A social scientist spends a considerable time observing and analyzing how people actually
work.
People do not have to explain or articulate their work.
Social and organizational factors of importance may be observed.
Ethnography studies have shown that work is usually richer and more complex than suggested
by simple system models.
Scope of ethnography
62
Requirements that are derived from the way that people actually work rather than the way I
which process definitions suggest that they ought to work.
Requirements that are derived from co-operation and awareness of other people’s activities.
Focused ethnography
Scenarios and user stories are real-life examples of how a system can be used.
Stories and scenarios are a description of how a system may be used for a particular task.
Because they are based on a practical situation, stakeholders can relate to them and can
comment on their situation with respect to the story.
Scenarios
Requirements specification
The process of writing down the user and system requirements in a requirements document
User requirements have to be understandable by end-users and customers who do not have a
technical background.
System requirements are more detailed requirements and may include more technical
information.
The requirements may be part of a contract for the system development.
o It is therefore important that these are as complete as possible.
Notation Description
Natural language The requirements are written using numbered sentences in
natural language. Each sentence should express one
requirement.
Structured natural The requirements are written in natural language on a standard
language form or template. Each field provides information about an
aspect of the requirement.
Design description This approach uses a language like a programming language, but
languages with more abstract features to specify the requirements by
defining an operational model of the system. This approach is
now rarely used although it can be useful for interface
specifications.
Graphical notations Graphical models, supplemented by text annotations, are used
to define the functional requirements for the system; UML use
case and sequence diagrams are commonly used.
Mathematical These notations are based on mathematical concepts such as
64
In principle, requirements should state what the system should do and the design should
describe how it does this.
In practice, requirements and design are inseparable:
o A system architecture may be designed to structure the requirements.
o The system may inter-operate with other systems that generate design requirements.
o The use of a specific architecture to satisfy non-functional requirements may be a
domain requirement.
o This may be the consequence of a regulatory requirement.
Requirements are written as natural language sentences supplemented by diagrams and tables.
Used for writing requirements because it is expressive, intuitive and universal. This means that
the requirements can be understood by users and customers.
Lack of clarity
o Precision is difficult without making the document difficult to read.
65
Requirements confusion
o Functional and non-functional requirements tend to be mixed-up.
Requirements amalgamation
o Several different requirements may be expressed together.
Structure specifications
An approach to writing requirements where the freedom of the requirements writer is limited
and requirements are written in a standard way.
This works well for some types of requirements (e.g., requirements for embedded control
system but is sometimes too rigid for writing business system requirements.)
Form-based specifications
Tabular specification
Use-cases
The software requirements document is the official statement of what is required of the system
developers.
SHOULD include both a definition of user requirements and a specification of the system
requirements.
It is NOT a design document. As far as possible, it should set of WHAT the system should do
rather than HOW it should do it.
67
Chapter Description
Preface This should define the expected readership of the document and describe
its version history, including a rationale for the creation of a new version
and a summary of the changes made in each version.
Introduction This should describe the need for the system. It should briefly describe
the system’s functions and explain how it will work with other systems. It
should also describe how the system fits into the overall business or
strategic objectives of the organization commissioning the software
Glossary This should define the technical terms used in the document. You should
not make assumptions about the experience or expertise of the reader
User Describe the services provided for the user. The nonfunctional system
requirement requirements should also be described in this section. This description
s definition may use natural language, diagrams, or other notations that are
understandable to customers. Product and process standards that must
be followed should be specified.
System This chapter should present a high-level overview of the anticipated
architecture system architecture, showing the distribution of functions across system
modules. Architectural components that are reused should be
highlighted.
System This should describe the functional and nonfunctional requirements in
requirement more detail. If necessary, further detail may also be added to the
s nonfunctional requirements. Interfaces to other systems may be defined.
specification
System This might include graphical system models showing the relationships
models between the system components and the system and its environment.
69
System This should describe the fundamental assumptions on which the system
evolution is based, and any anticipated changes due to hardware evolution,
changing user needs, and so on. This section is useful for system
designers as it may help them avoid design decisions that would constrain
likely future changes to the system.
Appendices These should provide detailed, specific information that is related to the
application being developed; for example, hardware and database
descriptions. Hardware requirements define the minimal and optimal
configurations for the system. Database requirements define the logical
organization of the data used by the system and the relationships
between data
Index Several indexes to the document may be included. As well as a normal
alphabetic index, there may be an index of diagrams, an index of
functions, and so on.
70
Table of Contents
1. Introduction
1. Purpose
2. Scope
3. Definitions, Acronyms, and Abbreviations
4. References
5. Overview
2. Overall Description
1. Product Perspective
2. Product Functions
3. User Characteristics
4. Constraints
5. Assumptions and Dependencies
3. Specific Requirements
1. External Interfaces
2. Functional requirements
1. Function 1
1. Introduction
2. Input
3. Process
4. Output
2. Function 2
3. …
4. Function n
71
3. Performance requirements
4. Design constraints
5. Quality attributes
Requirements validation
Concerned with demonstrating that the requirements define the system that the customer
really wants.
Requirements error costs are high, so validation is very important.
o Fixing a requirements error after delivery may cost up to 100 times the cost of fixing an
implementation error.
Requirements checking
Validity – does the system provide the functions which best support the customer’s needs?
Consistency – are there any requirements conflicts?
Completeness – are all functions required by the customer included?
Realism – can the requirements be implemented given available budget and technology?
Verifiability – can the requirements be checked?
Requirements reviews
o Systematic manual analysis of the requirements.
Prototyping
o Using an executable model of the system to check requirements.
Test-case generation
o Developing tests for requirements to check testability.
Requirements reviews
Regular reviews should be held while the requirements definition is being formulated.
Both client and contractor staff should be involved in reviews.
Reviews may be formal (with completed documents) or informal. Good communications
between developers, customers and users can resolve problems at an early stage.
72
Review checks
Changing requirements
The business and technical environment of the system always changes after installation.
o New hardware may be introduced, it may be necessary to interface the system with
other systems, business priorities may change (with consequent changes in the system
support required), and new legislation and regulations may be introduced that the
system must necessarily abide by.
The people who pay for a system and the users of that system are rarely the same people,
o System customers impose requirements because of organizational and budgetary
constraints. These may conflict with end-user requirements, and, after delivery, new
features may have to be added for user support if the system is to meet its goals.
Large systems usually have a diverse user community, with many users having different
requirements and priorities that may be conflicting or contradictory.
o The final system requirements are inevitably a compromise between them and, with
experience, it is often discovered that the balance of support given to different users has
to be changed.
Requirements evolution
73
Requirements management
Key points
Requirements for a software system set out what the system should do and define constraints on
its operation and implementation.
Functional requirements are statements of the services that the system must provide or are
descriptions of how some computations must be carried out.
Non-functional requirements often constrain the system being developed and the development
process being used.
They often relate to the emergent properties of the system and therefore apply to the system as a
whole.
The requirement’s engineering process is an iterative process that includes requirements elicitation,
specification and validation.
Requirements elicitation is an iterative process that can be represented as a spiral of activities –
requirements discovery, requirements classification and organization, requirements negotiation
and requirements documentation.
You can use a range of techniques for requirements elicitation including interviews and
ethnography. User stories and scenarios may be used to facilitate discussions.
Requirements specification is the process of formally documenting the user and system
requirements and creating a software requirements document.
The software requirements document is an agreed statement of the system requirements. It should
be organized so that both system customers and software developers can use it
Requirements validation is the process of checking the requirements for validity, consistency,
76
System modeling
System modeling is the process of developing abstract models of a system, with each model
presenting a different view or perspective of that system.
System modeling has now come to mean representing a system using some kind of graphical
notation, which is now almost always based on notations in the Unified Modeling Language
(UML)
System modeling helps the analyst to understand the functionality of the system and models
are used to communicate with customers.
Models of the existing system are used during requirements engineering. They help clarify
what the existing system does and can be used as a basis for discussing its strengths and
weaknesses. These then lead to the requirements for the new system.
Models of the new system are used during requirements engineering to help explain the
proposed requirements to other system stakeholders. Engineers use these models to discuss
design proposals and to document the system for implementation.
In a model-driven engineering process, it is possible to generate a complete or partial system
implementation from the system model.
UML origin
77
UML lineology
UML as a standard
UML Diagrams
User’s view.
Structural view
Behavioral view
Implementation view
Environmental view
All views are not required for developing a typical system.
o Use case diagram, class diagram and one of the interaction diagrams for a simple
system.
o State chart diagram required to be developed when a class state changes.
o However, when states are only one or two, state chart model becomes trivial.
o Deployment diagram in case of large number of hardware components used to develop
the system.
Includes
82
Extends
Class Diagram
Object Diagram
Interaction Diagram
o Models how groups of objects collaborate to realize some behavior.
o Typically, each interaction diagram realizes behavior of a single use case.
o Two kinds:
Sequence diagrams
Show interaction among objects as a two-dimensional chart.
Objects are shown as boxes at top.
If object created during execution, then shown at appropriate place.
Object existences are shown as dashed line (lifeline)
Objects activeness shown as a rectangle on lifeline.
Sequence diagrams are part of the UML and are used to model the
interactions between the actors and the objects within a system.
A sequence diagram shows the sequence of interactions that take place
during a particular use case or use case instance.
The objects and actors involved are listed along the top of the diagram,
with a dotted line drawn vertically from these.
Interactions between objects are indicated by annotated arrows.
Sequence Diagram Cont…
o Messages are shown as arrows.
o Each message labelled with corresponding message name.
o Each message can be labelled with some control information.
85
o Example:
Collaboration diagrams
86
Component diagram
o Captures the physical structure of the implementation (code components)
o Components:
Executables
Library
Table
File
Document
o Built as part of architectural specification.
o Purpose:
Organized source code.
Construct an executable release.
Specify a physical database.
o Developed by architects and programmers.
90
Deployment Diagram
o Captures the topology of a system’s hardware.
91
Context models
Context models are used to illustrate the operational context of a system – they show that lies
outside the system boundaries.
Social and organizational concerns may affect the decision on where to position system
boundaries.
Architectural models show the system and its relationship with other systems.
Context of the mentcare system
System boundaries
System boundaries are established to define what is inside and what is outside the system.
o Show other systems that are used or depend on the system being developed.
The position of the system boundary has a profound effect on the system requirements.
Defining a system boundary is a political judgment.
o There may be pressures to develop system boundaries that increase/decrease the
influence or workload of different parts of an organization.
92
Process perspective
Context models simply show the other systems in the environment, not how the system being
developed is used in that environment.
Process models reveal how the system being developed is used in broader business processes.
UML activity diagrams may be used to define business process models.
Interaction models
Generalization
Behavioral models
Behavioral models are models of the dynamic behavior of a system as it is executing. They
show what happens or what is supposed to happen when a system responds to a stimulus
from its environment.
You can think of these stimuli as being of two types:
o Data:
Some data arrives that has to be processed by the system.
o Events:
Some event happens that triggers system processing. Events may have
associated data, although this is not always the case.
Data-driven modeling
Many business systems are data-processing systems that are primarily driven by data. They
are controlled by the data input to the system, with relatively little external event processing.
Data-driven models show the sequence of actions involved in processing input data and
generating an associated output.
They are particularly useful during the analysis of requirements as they can be used to show
end-to-end processing in a system.
Event-driven modeling
Real-time systems are often event-driven, with minimal data processing. For example, a
landline phone switching system responds to events such as ‘receiver off hook’ by generating a
dial tone.
Event-driven modeling shows how a system responds to external and internal events.
It is based on the assumption that a system has a finite number of states and that events
(stimuli) may cause a transition from one state to another.
These model the behavior of the system in response to external and internal events.
They show the system’s responses to stimuli so are often used for modelling real-time
systems.
State machine models show system states as nodes and events as arcs between these nodes.
When an event occurs, the system moves from one state to another.
State charts are an integral part of the UML and are used to represent state machine models.
Model-driven engineering
o Cons:
Models for abstraction and not necessarily right for implementation.
Savings from generating code may be outweighed by the costs of developing
translators for new platforms.
Adoption of MDA
o A range of factors has limited the adoption of MDE/MDA.
o Specialized tool support is required to convert models from one level to another.
o There is limited tool availability and organizations may require tool adaptation and
customization to their environment.
o For the long-lifetime systems developed using MDA, companies are reluctant to develop
their own tools or rely on small companies that may go out of business.
o Models are a good way of facilitating discussions about a software design. However, the
abstractions that are useful for discussions may not be the right abstractions for
implementation.
97
o For most complex systems, implementation is not the major problem – requirements
engineering, security and dependability, integration with legacy systems and testing are
all more significant.
o The arguments for platform-independence are only valid for large, long-lifetime
systems. For software products and information systems, the savings from the use of
MDA are likely to be outweighed by the costs of its introduction and tooling.
o The widespread adoption of agile methods over the same period that MDA was evolving
has diverted attention away from model-driven approaches.
Types of models
Key points
A model is an abstract view of a system that ignores system details. Complementary system models
can be developed to show the system’s context, interactions, structure and behavior.
Context models show how a system that is being modeled is positioned in an environment with
other systems and processes.
Use case diagrams and sequence diagrams are used to describe the interactions between users and
systems in the system being designed. Use cases describe interactions between a system and
external actors; sequence diagrams add more information to these by showing interactions
between system objects.
Structural models show the organization and architecture of a system. Class diagrams are used to
define the static structure of classes in a system and their associations.
Behavioral models are used to describe the dynamic behavior of an executing system. This behavior
can be modeled from the perspective of the data processed by the system, or by the events that
stimulate responses from a system.
Activity diagrams may be used to model the processing of data, where each activity represents one
process step.
State diagrams are used to model a system’s behavior in response to internal or external events.
Model-driven engineering is an approach to software development in which a system is
represented as a set of models that can be automatically transformed to executable code.
99
Introduction
Module structure.
o Algorithms
Outcome of detailed design:
o Module specification.
Control relationship among the modules.
o Call relationship or invocation relationship.
Interface among different modules.
o Data items exchanged among different modules.
Data structures of individual modules.
Algorithms for individual modules.
Modularity
Classification of cohesiveness
Coincidental cohesion.
o The module performs a set of tasks:
Which relate to each other very loosely, if at all.
The module contains a random collection of functions.
Functions have been put in the module out of pure coincidence
without any thought or design.
Logical cohesion
o All elements of the module perform similar operations:
Ex: error handling, data input, data output, …
o An example of logical cohesion:
A set of print functions to generate an output report arranged into a single
module.
Temporal cohesion
o The module contains tasks that are related by the fact:
All the tasks must be executed in the same time span.
o Example:
The set of functions responsible for:
Initialization
Start-up, shutdown of some process, …
Procedural cohesion
o The set of functions of the module:
All part of a procedure (algorithm)
Certain sequence of steps has to be carried out in a certain order for achieving
an objective.
Ex: the algorithm for decoding a message.
102
Communication cohesion
o All functions of the module:
Reference or update the same data structure.
o Example:
The set of functions defined on an array or a stack.
Sequential cohesion
o Elements of a module form different parts of a sequence.
Output from one element of the sequence is input to the next.
Functional cohesion
o Different elements of a module cooperate:
To achieve a single function
Ex: managing an employee's payroll.
o When a module displays functional cohesion.
Describe the function using a single sentence.
Coupling
Coupling indicates:
o How closely two modules interact or how interdependent they are.
o The degree of coupling between two modules depends on their interface complexity.
Data coupling
o Two modules are data coupled:
If they communicate via a parameter:
An elementary data item.
Ex: an integer, a float, a character, …
The data item should be problem related:
Not used for control purpose.
Stamp coupling
o Two modules are stamp coupled:
If they communicate via a composite data item:
A record in PASCAL
A structure in C
103
Control coupling
o Data from one module is used to direct:
Order of instruction execution in another.
o Example of control coupling:
A flag set in one module and tested in another module.
Common coupling
o Two modules are common coupled:
If they share some global data
Content coupling
o Content coupling exists between two modules:
If they share code.
Ex: branching from one module into another module.
o The degree of coupling increases from data coupling to content coupling.
Fire-alarm system
We need to develop a computerized fire alarm system for a large multi-storied building:
o There are 80 floors and 1000 rooms in the building.
Different rooms of the building:
o Fitted with smoke detectors and fire alarms.
The fire alarm system would monitor:
o Status of the smoke detectors.
Whenever a fire condition is reported by any smoke detector, the fire alarm system should:
o Determine the location from which the fire condition was reported.
o Sound the alarms in the neighboring locations.
The fire alarm system should flash an alarm message on the computer console:
o Firefighting personnel man the console round the clock.
106
Architectural design
Architectural abstraction
Architecture in the small is concerned with the architecture of individual programs. At this level,
we are concerned with the way that an individual program is decomposed into components.
Architecture in the large is concerned with the architecture of complex enterprises systems that
include other systems, programs, and program components. These enterprise systems are
distributed over different computers, which may be owned and managed by different
companies.
As Bosch explains, individual components implement the functional system requirements, but
the dominant influence on the non-functional system characteristics is the system’s
architecture.
Stakeholder communication
o Architecture may be used as a focus of discussion by system stakeholders.
System analysis
o Means that analysis of whether the system can meet its non-functional requirements is
possible.
Large-scale reuse
o The architecture may be reusable across a range of systems.
o Product-line architectures may be developed.
Architectural representations
Simple, informal block diagrams showing entities and relationships are the most frequently used
method for documenting software architectures.
But these have been criticized because they lack semantics, do not show the types of
relationships between entities not the visible properties of entities in the architecture.
Depends on the use of architectural models. The requirements for model semantics depends on
how the models are used.
Very abstract – they do not show the nature of component relationships nor the externally
visible properties of the sub-systems.
However, useful for communication with stakeholders and for project planning.
Architectural design is a creative process, so the process differs depending on the type of system
being developed, the background and experience of the system architect, and the specific
requirements for the system.
However, a number of common decisions span all design processes, and these decisions affect
the non-functional characteristics of the system.
Architecture reuse
Systems in the same domain often have similar architectures that reflect domain concepts.
Application product line are built around a core architecture with variants that satisfy particular
customer requirements.
The architecture of a system may be designed around one of more architectural patterns or
“styles”.
o These capture the essence of an architecture and can be instantiated in different ways.
Performance
o Localize critical operations and minimize communications. Use large rather than fine
grain components.
Security
o Use a layered architecture with critical assets in the inner layers.
Safety
110
Architectural views
Each architectural model only shows one view or perspective of the system.
o It might show how a system is decomposed into modules, how the run-time processes
interact or the different ways in which system components are distributed across a
network. For both design and documentation, you usually need to present multiple
views of the software architecture.
A logical view
o Shows the abstractions in the system as objects or object classes.
A process views.
o Shows how, at run-time, the system is composed of interacting processes.
A development views.
o Shows how the software is decomposed for development.
A physical view
111
o Shows the system hardware and how software components are distributed across the
processors in the system.
Related using use cases or scenarios.
Some people argue that the Unified Modeling Language (UML) is an appropriate notation for
describing and documenting system architectures.
In contrast, some think that the UML do not includes abstractions appropriate for high-level
system descriptions.
Architectural description languages (ADLs) have been developed but are not widely used.
Architectural patterns
Name MVC
Description Separates presentation and interaction from the system data. The system is
112
Layered architecture.
114
Repository architecture
116
Name Repository
Description All data in a system is managed in a central repository that is accessible to all
system components. Components do not interact directly, only through the
repository.
When used Use this pattern when you have a system in which large volumes of information
are generated that has to be stored for a long time. You may also use it in data-
driven systems where the inclusion of data in the repository triggers an action
or tool
Advantages Components can be independent—they do not need to know of the existence
of other components. Changes made by one component can be propagated to
all components. All data can be managed consistently as it is all in one place.
Disadvantag The repository is a single point of failure so problems in the repository affect
e the whole system. May be inefficiencies in organizing all communication
through the repository. Distributing the repository across several computers
may be difficult.
Client-server architecture
Distributed system model which show how a data and processing is distributed across a range of
components.
o Can be implemented on a single computer.
Set of stand-alone servers which provide specific services such as printing, data management, …
Set of clients which call on these services.
Network which allows clients to access servers.
Client-server pattern
Name Client-server
Description In a client–server architecture, the functionality of the system is
organized into services, with each service delivered from a separate
server. Clients are users of these services and access servers to make use
of them.
When used Used when data in a shared database has to be accessed from a range of
locations. Because servers can be replicated, may also be used when the
load on a system is variable.
Advantages The principal advantage of this model is that servers can be distributed
across a network. General functionality can be available to all clients and
does not need to be implemented by all services.
Disadvantag Each service is a single point of failure so susceptible to denial-of-service
e attacks or server failure. Performance may be unpredictable because it
depends on the network as well as the system. May be management
118
Application architectures
Two very widely used generic application architectures are transaction processing systems and
language processing systems.
Transaction processing systems
o E-commerce systems.
o Reservation systems.
o Process user requests for information from a database or requests to update the
database.
o From a user perspective a transaction is:
Any coherent sequence of operations that satisfies a goal.
o Users make asynchronous requests for service which are then processed by a
transaction manager.
Information and resource management systems are now usually web-based systems where
the user interfaces are implemented using a web browser.
o Example: e-commerce systems are Internet-based resource management systems that
accept electronic orders for goods or services and then arrange delivery of these goods
or services to the customer.
In an e-commerce system, the application-specific layer includes additional functionality
supporting a ‘shopping cart’ in which users can place a number of items in separate
transactions, then pay for them all together in a single transaction.
Sever implementation.
Accept a natural or artificial language as input and generate some other representation of that
language.
May include an interpreter to act on the instructions in the language that is being processed.
Used in situations where the easiest way to solve a problem is to describe an algorithm or
describe the system data.
o Meta-case tools process tool descriptions, method rules, … and generate tools.
Compiler components
125
A lexical analyzer, which takes input language tokens and converts them to an internal form.
A symbol table, which holds information about the names of entities (variables, class names,
object names, etc.) used in the text that is being translated.
A syntax analyzer, which checks the syntax of the language being translated.
A syntax tree, which is an internal structure representing the program being compiled.
A semantic analyzer that uses information from the syntax tree and the symbol table to check
the semantic correctness of the input language text.
A code generator that ‘walks’ the syntax tree and generates abstract machine code.
Key points
A software architecture is a description of how a software system is organized.
Architectural design decisions include decisions on the type of application, the distribution of the
system, the architectural styles to be used.
Architectures may be documented from several different perspectives or views such as a
conceptual view, a logical view, a process view, and a development view.
Architectural patterns are a means of reusing knowledge about generic system architectures. They
describe the architecture, explain when it may be used and describe its advantages and
disadvantages.
Models of application systems architectures help us understand and compare applications, validate
application system designs, and assess large-scale components for reuse.
Transaction processing systems are interactive systems that allow information in a database to be
remotely accessed and modified by a number of users.
Language processing systems are used to translate texts from one language into another and to
carry out the instructions specified in the input language. They include a translator and an abstract
machine that executes the generated language.
Software design and implementation is the stage in the software engineering process at which
an executable software system is developed.
Software design and implementation activities are invariably inter-leaved.
o Software design is a creative activity in which you identify software components and
their relationships, based on a customer’s requirements.
o Implementation is the process of realizing the design as a program.
A design process.
OOAD
Domain Modelling
Class stereotypes
128
Hold information:
o Such as data tables & files
Normally are dumb serves.
Responsible for storing data, fetching data…
Elementary operations on data such as searching, sorting,…
Entity objects are identified by examining nouns in problem description.
Patterns vs Idioms
Patterns
o The essential idea
If you can master a few important patterns, you can easily spot them in
application development and use the pattern solutions.
o Describes a recurring problem.
o Describes the core of a solution.
o Is capable of generating many distinct designs.
Idioms
130
o More restricted:
Still describes a recurring problem.
Provide a more specific solution with fewer variations.
Applies only to a narrow context.
o In English
A group a words that has meaning different from a simple juxtaposition of the
meanings of the individual words.
o A C idiom:
for (i=0;i<1000;i++){
}
Anti-pattern
Design patterns
Solution descriptions.
Not a concrete design but a template for a design solution that can be
instantiated in different ways.
Consequences
The results and trade-offs of applying the pattern.
It should be sufficiently abstract to be reused in different settings.
Pattern descriptions usually make use of object-oriented characteristics such as inheritance and
polymorphism.
Design problems
o To use patterns in your design, you need to recognize that any design problem you are
facing may have an associated pattern that can be applied.
Tell several objects that the state of some object has changed (observer
pattern).
Tidy up the interfaces to a number of related objects that have been developed
incrementally (Façade pattern).
Provide a standard way of accessing the elements in a collection, irrespective of
how that collection is implemented (Iterator pattern).
Allow for the possibility of extending the functionality of an existing class at run-
time (Decorator pattern).
Process stages
There are a variety of different object-oriented design processes that depend on the
organization using the process.
Common activities in these processes include:
o Define the context and modes of use of the system.
o Design the system architecture.
o Identify the principal system objects.
o Develop design models.
o Specify object interfaces.
Process illustrates here using a design for a wilderness weather station.
Understanding the relationship between the software that is being designed and its external
environment is essential for deciding how to provide the required system functionality and how
to structure the system to communicate with its environment.
Understanding of the context also lets you establish the boundaries of the system. Setting the
system boundaries helps you decide what features are implemented in the system being
designed and what features are in other associated systems.
Architectural design
134
Once interactions between the system and its environment have been understood, you use this
information for designing the system architecture.
You identify the major components that make up the system and their interactions, and then
may organize the components using an architectural pattern such as a layered or client-server
model.
The weather station is composed of independent sub-systems that communicate by
broadcasting messages on a common infrastructure.
Approaches to identification.
Object class identification in the weather station system may be based on the tangible hardware
and data in the system.
o Ground thermometer, Anemometer, Barometer.
Application domain objects that are “hardware” objects related to the
instruments in the system.
o Weather station
The basic interface of the weather station to its environment. It therefore
reflects the interactions identified in the use-case model.
o Weather data.
Encapsulates the summarized data from the instruments.
Design models
Design models show the objects and object classes and relationships between these entities.
2 kinds of design models.
o Structural models describe the static structure of the system in terms of object classes
and relationships.
o Dynamic models describe the dynamic interactions between objects.
o Sub-system models that show logical groupings of objects into coherent sub-systems.
o Sequence models that show the sequence of object interactions.
o State machine models that show how individual objects change their state in response
to events.
o Other models include use-case models, aggregation models, generalization models,…
Sub-system models
Shows how the design is organized into logically related groups of objects.
In UML, these are shown using packages – an encapsulation construct. This is a logical model.
The actual organization of objects in the system may be different.
Sequence models
State diagrams
State diagrams are used to show how objects respond to different service requests and the
state transitions triggered by these requests.
State diagrams are useful high-level models of a system or an object’s run-time behavior.
State diagram don’t usually need for all of the objects in the system. Many of the objects in a
system are relatively simple and a state model adds unnecessary detail to the design.
Weather station state diagram
Interface specification
Object interfaces have to be specified so that the objects and other components can be
designed in parallel.
Designers should avoid designing the interface representation but should hide this in the object
itself.
Objects may have several interfaces which are viewpoints on the methods provided.
The UML uses class diagrams for interface specification but Java may also be used.
138
Implementation issues
Reuse
o Most modern software is constructed by reusing existing components or system.
o When you are developing software, you should make as much use as possible of
existing code.
o From the 1960s to the 1990s, most new software was developed from the scratch by
writing all code in a high-level programming language.
The only significant reuse or software was the reuse of functions and objects in
programming languages libraries.
o Costs and schedule pressure mean that this approach became increasingly unviable,
especially for commercial and internet-based systems.
o An approach to development based around the reuse of existing software emerged and
is now generally used for business and scientific software.
o Reuse level:
Abstraction level
Don’t reuse the software directly but use knowledge of successful
abstractions in the design of your software.
Object level
Directly reuse objects from a library rather than writing the code
yourself.
Component level
Collections of objects and object classes that you reuse in application
systems.
System level
Reuse entire application system.
o Reuse costs
The costs of the time spent in looking for software to reuse and assessing
whether or not it meets your needs.
Where applicable, the costs of buying the reusable software. For large off-the-
shelf systems, these costs can be very high.
139
Configuration management.
o During the development process, you have to keep track of the many different versions
of each software component in a configuration management system.
o Configuration management is the name given to the general process of managing
software system.
o Aim:
Support the system integration process so that all developers can access the
project code and documents in a controlled way, find out what changes have
been made, and compile and link components to create a system.
140
Host-target development.
o Production software does not usually execute on the same computer as the software
development environment.
o Rather, you develop it on one computer (the host system) and execute it on a separate
computer (the target system).
o Most software is developed on one computer (the host) but runs on a separate machine
(the target).
o Development platform and execution platform
A platform is more than just hardware.
Includes the installed operation system plus other supporting software such as a
database management system or, for development platforms, an interaction
development environment.
Development platform tools
An integrated compiler and syntax-directed editing system that allows
you to create, edit and compile code.
A language debugging system.
Graphical editing tools.
Testing tools
Project support tools that help you organize the code for different
development projects.
142
o Development platform usually has different installed software than execution platform;
these platforms may have different architectures.
Open-source development
Open source development is an approach to software development in which the source code of
a software system is published and volunteers are invited to participate in the development
process.
Its roots are in the Free Software Foundation, which advocates that source code should not be
proprietary but rather should always be available for users to examine and modify as they wish.
Open source software extended this idea by using the Internet to recruit a much larger
population of volunteer developers. Many of them are also users of the code.
143
Open-source systems
o The best-known open-source product is the Linux operating system which is widely used
as a server system and as a desktop environment.
o Other important open-source products are Java, the Apache web server and the MySQL
database management system.
Open-source issues
o Should the product that is being developed make use of open source components?
o Should an open-source approach be used for the software’s development?
Open-source business
o More and more product companies are using an open-source approach to development.
o Their business model is not reliant on selling a software product but on selling support
for that product.
o Involving the open-source community will allow software to be developed more
cheaply, more quickly and will create a community of users for the software.
Open-source licensing
o A fundamental principal of open-source development is that source code should be
freely available, this does not mean that anyone can do as they wish with that code.
Legally, the developer of the code (either a company or an individual) still owns
the code. They can place restrictions on how it is used by including legally
binding conditions in an open source software license.
Some open source developers believe that if an open source component is used
to develop a new system, then that system should also be open source.
Others are willing to allow their code to be used without this restriction. The
developed systems may be proprietary and sold as closed source systems.
License models
The GNU General Public License (GPL) is a so-called “reciprocal” listen that means that if you
use open-source software that is licensed under the GPL license, then you must make that
software open source.
The GNU Lesser General Public License (LGPL) is a variant of the GPL license where you can
write components that link to open-source code without having to publish the source of these
components.
144
The Berkley Standard Distribution (BSD) License is a non-reciprocal license, which means you
are not obliged to re-publish any changes or modifications made to open-source code. You can
include the code in proprietary system that are sold.
License management
o Established a system for maintaining information about open-source components that
are downloaded and used.
o Be aware of the different types of licenses and understand how a component is licensed
before it is used.
o Be aware of evolution pathways for components.
o Educate people about open source.
o Have auditing system in place.
o Participate in the open-source community.
Key points
Software design and implementation are inter-leaved activities. The level of detail in the design
depends on the type of system and whether you are using a plan-driven or agile approach.
The process of object-oriented design includes activities to design the system architecture, identify
objects in the system, describe the design using different object models and document the
component interfaces.
A range of different models may be produced during an objectoriented design process. These
include static models (class models, generalization models, association models) and dynamic
models (sequence models, state machine models).
Component interfaces must be defined precisely so that other objects can use them. A UML
interface stereotype may be used to define interfaces.
When developing software, you should always consider the possibility of reusing existing software,
either as components, services or complete systems.
Configuration management is the process of managing changes to an evolving software system. It is
essential when a team of people are cooperating to develop software.
Most software development is host-target development. You use an IDE on a host machine to
develop the software, which is transferred to a target machine for execution.
Open-source development involves making the source code of a system publicly available. This
means that many people can propose changes and improvements to the software.
145
Program testing
Testing is intended to show that a program does what it is intended to do and to discover
program defects before it is put into use.
When you test software, you execute a program using artificial data.
You check the result of the test run for errors, anomalies or information about the program’s
non-functional attributes.
Can reveal the presence of errors NOT their absence.
Testing is a part of a more general verification and validation process, which also includes
static validation techniques.
To demonstrate to the developer and the customer that software meets its requirements.
To discover situations in which the behavior of the software is incorrect, undesirable or does not
conform to its specification.
Validation testing
o To demonstrate to the developer and the system customer that the software meets its
requirements.
o A successful test shows that the system operates as intended.
Defect testing
o To discover faults or defects in the software where its behavior is incorrect or not in
conformance with its specification.
146
o A successful test is a test that makes the system perform incorrectly and so exposes a
defect in the system.
Verification vs validation (V vs V)
Verification
o The software should conform to its specification.
o “Are we building the product right?”
Validation
o The software should do what the user really requires.
o “Are we building the right product?”
147
V & V confidence
Aim of V&V is to establish confidence that the system is “fit for purpose”.
Depends on system’s purpose, user expectations and marketing environment.
o Software purpose
The level of confidence depends on how critical the software is to an
organization.
o User expectations
Users may have low expectations of certain kinds of software.
o Marketing environment
Getting a product to market early may be more important than finding defects
in the program.
Software inspections
o Concerned with analysis of the static system representation to discover problems (static
verification)
May be supplemented by tool-based document and code analysis.
Software testing
o Concerned with exercising and observing product behavior (dynamic verification)
The system is executed with test data and its operational behavior is observed.
148
Inspections and testing are complementary and not opposing verification techniques.
Both should be used during the V & V process.
Inspection can check conformance with a specification but not conformance with the customer’s
real requirements.
Inspections cannot check non-functional characteristics such as performance, usability,…
Software inspections.
Involve people examining the source representation with the aim of discovering anomalies and
defects.
Inspections not required execution of a system so may be used before implementation.
May applied to any representation of the system (requirements, design, configuration data, test
data, etc.…)
Shown to be an effective technique for discovering program errors.
Advantages of inspections.
Stages of testing
Development testing
o The system is tested during development to discover bugs and defects.
Release testing
o A separate testing team test a complete version of the system before it is released to
users.
User testing
o Users or potential users of a system test the system in their own environment.
Development testing
Includes all testing activities that are carried out by the team developing the system.
o Unit testing
Where individual program units or object classes are tested.
Focus on testing the functionality of object or methods.
o Component testing
Where several units are integrated to create composite components.
Focus on testing component interfaces.
o System testing
Where some or all of the components in a system are integrated and the system
is tested as a whole.
Focus on testing component interactions.
Unit testing
Need to define test cases for report-Weather, calibrate, test, startup and shutdown.
Using state model, identify sequences of state transitions to be tested and the event sequences
to cause these transitions.
Automated testing
Whenever possible, unit testing should be automated so that tests are run and checked without
manual intervention.
In automated unit testing, you make use of a test automation framework (Junit) to write and run
program tests.
Unit testing frameworks provide generic test classes that you extend to create specific test case.
They can then run all of the tests that you have implemented and report, often through some
GUI, on the success of otherwise of the tests.
Automated test components:
o Setup part
Where you initialize the system with the test case, namely the inputs and
expected outputs.
o Call part
Where you call the object or method to be tested.
o Assertion part
Where you compare the result of the call with expected result. If the assertion
evaluates to true, the test has been successful if false, then it has failed.
151
The test cases should show that, when used as expected, the component that you are testing
does what it is supposed to do.
If there are defects in the component, these should be revealed by test cases.
2 types of unit test case:
o First test case
Should reflect normal operation of a program and should show that the
component works as expected.
o Second test case:
Should be based on testing experience of where common problems arise. It
should use abnormal inputs to check that these are properly processed and do
not crash the component.
Testing strategies
Partition testing
o Where you identify groups of inputs that have common characteristics and should be
processed in the same way.
You should choose tests from within each of these groups.
o Input data and output results often fall into different classes where all members of a
class are related.
o Each of these classes is an EQUIVALENCE PARTITION or domain where the program
behaves in an equivalent way for each class members.
o EQUIVALENCE PARTITION
152
Derive tests so that the first, middle and last elements of the sequence are
accessed.
Test with sequences of zero length.
o General testing guidelines
Choose inputs that force the system to generate all error messages.
Design inputs that cause input buffers to overflow.
Repeat the same input or series of inputs numerous times.
Force invalid outputs to be generated.
Force computation results to be too large or too small.
Component testing
Software components are often composite components that are made up of several interacting
objects.
You access the functionality of these objects through the defined component interface.
Testing composite components should therefore focus on showing that the component
interface behaves according to its specification.
Interface testing
Objectives are to detect faults due to interface errors or invalid assumptions about interfaces.
Interface types
o Parameter interfaces
o Shared memory interfaces
154
o Procedural interfaces
o Message passing interfaces.
Interface errors
o Interface misuse
A calling component calls another component and makes an error in its use of
its interface.
o Interface misunderstanding
A calling component embeds assumptions about the behavior of the called
component which are incorrect.
o Timing errors
The called and the calling component operate at different speeds and out-of-
date information is accessed.
Interface testing guidelines
o Design tests so that parameters to a called procedure are at the extreme ends of their
ranges.
o Always test pointer parameters with null pointers.
o Design tests which cause the component to fail.
o Use stress testing in message passing systems.
o In shared memory systems, vary the order in which components are activated.
System testing
System testing during development involves integrating components to create a version of the
system and then testing the integrated system.
The focus in system testing in testing the interactions between components.
System testing checks that components are compatible interact correctly and transfer the right
data at the right time across their interfaces.
System testing tests the emergent behavior of a system.
During system testing
o Functional requirements are validated through functional tests.
o Non-functional requirements validated through performance tests.
155
The process of testing a particular release of a system that is intended for use outside of the
development team.
The primary goal of the release testing process is to convince the supplier of the system that it is
good enough for use
o Release testing, therefore, has to show that the system delivers its specified
functionality, performance and dependability, and that it does not fail during normal
use.
Release testing is usually a black-box testing process where tests are only derived from the
system specification.
Involves examining each requirement and developing a test or tests for it.
Performance testing
Part of release testing may involve testing the emergent properties of a system, such as
performance and reliability.
Tests should reflect the profile of use of the system.
Performance tests usually involve planning a series of tests where the load is steadily increased
until the system performance becomes inacceptable.
Stress testing is a form of performance testing where the system is deliberately overloaded to
test its failure behavior.
156
User testing
A stage in the testing process in which users or customer provide input and advice on system
testing.
User testing is essential, even when comprehensive system and release testing have been
carried out.
o The reason for this is that influences from the user’s working environment have a major
effect on the reliability, performance, usability and robustness of a system. These
cannot be replicated in a testing environment.
User testing types
o Alpha testing
Users of the software work with the development team to test the software at
the developer’s site.
o Beta testing
A release of the software is made available to users to allow them to
experiment and to raise problems that they discover with the system
developers.
o Acceptance testing
Customers test a system to decide whether or not it is ready to be accepted
from the system developers and deployed in the customer environment.
Primarily for custom systems.
Mutation testing
Stress testing
Volume testing
Configuration testing
Recovery testing
Maintenance testing
Environmental testing
These tests check the system’s ability to perform at the installation site.
Requirements might include tolerance for:
o Heat
o Humidity
o Chemical presence
o Portability
o Electrical or magnetic fields
o Disruption of power…
Regression testing
Does not belong to either unit test, integration test, or system test.
o Instead, it is a separate dimension to these three forms of testing.
Regression testing is the running of test suite:
o After each change to the system after each bug fix.
o Ensures that no new bug has been introduced due to the change or the bug fix.
Regression testing assure:
o The new system’s performance is at least as good as the old system.
o Always used during incremental system development.
161
Key points
Testing can only show the presence of errors in a program. It cannot demonstrate that there are no
remaining faults.
Development testing is the responsibility of the software development team. A separate team
should be responsible for testing a system before it is released to customers.
Development testing includes unit testing, in which you test individual objects and methods
component testing in which you test related groups of objects and system testing, in which you test
partial or complete systems.
When testing software, you should try to ‘break’ the software by using experience and guidelines to
choose types of test case that have been effective in discovering defects in other systems.
Wherever possible, you should write automated tests. The tests are embedded in a program that
can be run every time a change is made to a system.
Test-first development is an approach to development where tests are written before the code to
be tested.
Scenario testing involves inventing a typical usage scenario and using this to derive test cases.
Acceptance testing is a user testing process that determines if the software is good enough to be
deployed and used in its operational environment.
Mutation testing:
make arbitrary small changes.
see if the existing test suite detect these.
if not, augment test suite.
Functional test
Performance test
stress
volume
configuration
Maintenance
Regression Testing
Is a separate dimension to these three forms of testing.
162
Ensures the new system’s performance is at least as good as the old system
Concerned with activities involved in ensuring that software is delivered on time and on
schedule and in accordance with the requirements of the organizations developing and
procuring the software.
Project management is needed because software development is always subject to budget and
schedule constraints that are set by the organization developing the software.
Success criteria
Company size.
Software customers.
163
Software size.
Software type.
Organizational culture.
Software development processes.
These factors mean that project managers in different organizations may work in quite different
ways.
Project planning
o Project managers are responsible for planning, estimating, and scheduling project
development and assigning people to tasks.
Risk management
o Project managers assess the risks that may affect a project, monitor these risks and take
action when problems arise.
People management.
o Project managers have to choose people for their team and establish ways of working
that leads to effective team performance.
Management activities
Reporting
o Project managers are usually responsible for reporting on the progress of a project to
customers and to the managers of the company developing the software.
Proposal writing.
o The first stage in a software project may involve writing a proposal to win a contract to
carry out an item of work. The proposal describes the objectives of the project and how
it will be carried out.
Risk management
Risk management is concerned with identifying risks and drawing up plans to minimize their
effect on a project.
Software risk management is important because of the inherent uncertainties in software
development.
164
o These uncertainties stem from loosely defined requirements, requirements change due
to changes in customer needs, difficulties in estimating the time and resources required
for software development, and differences in individual skills.
You have to anticipate risks, understand the impact of these risks on the project, the product
and the business, and take steps to avoid these risks.
The risk management process
o Risk identification
Identify project, product, and business risks.
May be a team activities or based on the individual project manager’s
experience.
A checklist of common risks may be used to identify risks in a project
Technology risks
o Late delivery of hardware or support software may report
technology problems.
Organizational risks.
o Organizational gossip, lack of action by senior management.
People risks.
o Poor staff morale, poor relationships amongst team members,
high staff turnover.
Requirement risks.
o Many requirements change requests, customer complaints.
Estimation risks.
o Failure to meet agreed schedule, failure to clear reported
defects.
Tools risks
o Reluctance by team members to use tools, complaints about
CASE tools, demands for higher-powered workstations.
o Risk analysis.
Assess the likelihood and consequence of these risks.
Assess probability and seriousness of each risk.
Probability may be very low, low, moderate, high or very high.
Risk consequences might be catastrophic, serious, tolerate or insignificant.
165
o Risk planning.
Draw up plans to avoid or minimize the effects of the risk.
Consider each risk and develop a strategy to manage that risk.
Avoidance strategies
The probability that the risk will arise is reduced.
Minimization strategies
The impact of the risk on the project or product will be reduced.
Contingency plans.
If the risk arises, contingency plans are plans to deal with those risks.
o Risk monitoring
Monitor the risks throughout the project.
Assess each identified risks regularly to decide whether or not it is becoming
less or more probable.
Also assess whether the effects of the risk have changed.
Each key risk should be discussed at management progress meetings.
Risk management process
Risk classification
Business risks
o Affect the organization developing or procuring the software.
Managing people
Consistency
o Team members should all be treated in a comparable way without favorites or
discrimination.
Respect
o Different team members have different skills, and these differences should be
respected.
Inclusion
o Involve all team members and make sure that people’s views are considered.
Honesty
o Should always be honest about what is going well and what is going badly in a project.
Motivating people
o Personal needs
o Social needs.
Need satisfaction.
In software development groups, basic physiological and safety needs are not an issue.
Social
o Provide communal facilities.
o Allow informal communications e.g. via social networking
Esteem
o Recognition of achievements.
o Appropriate rewards.
Self-realization
o Training
o Responsibility
Personality types
Motivation balance
Teamwork
Group cohesiveness
In a cohesive group, members consider the group to be more important than any individual in it.
Advantages of a cohesive group are:
o Group quality standards can be developed by the group members.
o Team members learn from each other and get to know each other’s work. Inhibitions
caused by ignorance are reduced.
o Knowledge is shared. Continuity can be maintained if a group member leaves.
o Refactoring and continual improvement is encouraged. Group members work
collectively to deliver high quality results and fix problems, irrespective of the
individuals who originally created the design or program.
A manager or team leader’s job is to create a cohesive group and organize their group so that
they can work together effectively.
This involves creating a group with the right balance of technical skills and personalities and
organizing that group so that the members work together effectively.
Assembling a team
Group composed of members who share the same motivation can be problematic.
o Task-oriented
Everyone wants to do their own thing
o Self-oriented
Everyone wants to be the boss.
o Interaction-oriented
Too much chatting, not enough work.
An effective group has a balance of all types.
This can be difficult to achieve software engineers are often task-oriented.
Interaction-oriented people are very important as they can detect and defuse tensions that
arise.
Group organization
The way that a group is organized affects the decisions that are made by that group, the ways
that information is exchanged and the interactions between the development group and
external project stakeholders.
Small software engineering groups are usually organized informally without a rigid structure.
For large projects, there may be a hierarchy structure where different groups are responsible for
different sub-projects.
Agile development is always based around an informal group on the principle that formal
structure inhibits information exchange.
Informal groups:
o The group acts as a whole and comes to a consensus on decisions affecting the system.
o The group leader serves as the external interface of the group but does not allocate
specific work items.
170
o Rather, work is discussed by the group as a whole and tasks are allocated according to
ability and experience.
o This approach is successful for group where all members are experienced and
competent.
Group communications
Key points
Good project management is essential if software engineering projects are to be developed on
schedule and within budget.
Software management is distinct from other engineering management.
Software is intangible.
Projects may be novel or innovative with no body of experience to guide their management.
Software processes are not as mature as traditional engineering processes.
Risk management involves identifying and assessing project risks to establish the probability that
they will occur and the consequences for the project if that risk does arise. You should make plans
to avoid, manage or deal with likely risks if or when they arise.
People management involves choosing the right people to work on a project and organizing the
team and its working environment.
People are motivated by interaction with other people, the recognition of management and their
peers, and by being given opportunities for personal development.
Software development groups should be fairly small and cohesive. The key factors that influence
the effectiveness of a group are the people in that group, the way that it is organized and the
communication between group members.
Communications within a group are influenced by factors such as the status of group members, the
size of the group, the gender composition of the group, personalities and available communication
channels.
172
Project planning
Breaking down the work into parts and assigning these project team members, anticipating
problems that might arise, and preparing tentative solutions to those problems.
The project plan – created at the start of a project – is used to communicate how the work will
be done to the project team and customers and to help assess progress on the project.
The most time-consuming project management activity.
Continuous activity from initial concept through to system delivery. Plans must be regularly
revised as new information becomes available.
Various different types of plans may be developed to support the main software project plan
that is concerned with schedule and budget.
Planning stages
o Create a plan with enough detail to make decisions about the project budget and
staffing.
The basis for project resource allocation.
o The startup plan also defines project monitoring mechanisms.
o A startup plan is needed for agile development to allow resources to be allocated to the
project.
Periodically throughout the project, when you modify your plan in the light of experience gained
and information from monitoring the progress of the work.
Development planning
o The project plan should be regularly amended as the project progresses and you know
more about the software and its development.
o The project schedule, cost-estimate and risks have to be regularly revised.
Software pricing
Estimates are made to discover the cost, to the developer, of producing a software system.
o Take into account, hardware, software, travel, training, and effort costs.
There is not a simple relationship between the development cost and the price charged to the
customer.
Factor effecting software pricing:
o Contractual terms
A customer may be willing to allow the developer to retain ownership of the
source code and reuse it in other projects.
The price charged may then be less than if the software source code is handed
over to the customer.
o Cost estimate uncertainty
If an organization is unsure of its cost estimate, it may increase its price by a
contingency over and above its normal profit.
o Financial health
Developers in financial difficulty may lower their price to gain a contract. It is
better to make a smaller than normal profit or break even than to go out of
business. Cash flow is more important than profit in difficult economic times.
o Market opportunity
174
Plan-driven development
Managers use the plan to support project decision making and as a way of measuring progress.
Project plans
In a plan-driven development project, a project plan sets out the resources available to the
project, the work breakdown and a schedule for carrying out the work.
Plan sections
o Introduction
o Project organization
o Risk analysis
o Hardware and software resources requirements.
o Work breakdown
o Project schedule
o Monitoring and reporting mechanisms.
Project plan supplements
o Configuration management plan
Describes the configuration management procedures and structures to be used.
o Deployment plan
Describes how the software and associated hardware will be deployed in the
customer’s environment. This should include a plan for migrating data from
existing systems.
o Maintenance plan
Predicts the maintenance requirements, costs, and effort.
176
o Quality plan
Describes the quality procedures and standards that will be used in a project.
o Validation plan
Describes the approach, resources, and schedule used for system validation.
Project planning – is an iterative process that starts when you create an initial project plan
during the project startup phase.
Plan changes are inevitable.
o As more information about the system and the project team becomes available during
the project, you should regularly revise the plan to reflect requirements, schedule and
risk changes.
o Changing business goals also leads to changes in project plans. As business goals change,
this could affect all projects, which may then have to be re-planned.
Project planning process
Planning assumptions
o Should make realistic rather than optimistic assumptions when you are defining a
project plan.
o Problems of some description always arise during a project, and these lead to project
delays.
177
o Your initial assumptions and scheduling should therefore take unexpected problems
into account.
o You should include contingency in your plan so that if things go wrong, then your
delivery schedule is not seriously disrupted.
Risk mitigation
If there are serious problems with the development work that are likely to lead to significant
delays, you need to initiate risk mitigation actions to reduce the risks of project failures.
In conjunction with these actions, you also have to re-plan the project.
This may involve renegotiating the project constraints and deliverables with the customer. A
new schedule of when work should be completed also has to be established and agreed with the
customer.
Project scheduling
The process of deciding how the work in a project will be organized as separate tasks, and
when and how these tasks will be executed.
You estimate the calendar time needed to complete each task, the effort required and who will
work on the tasks that have been identified.
You also have to estimate the resources needed to complete each task, such as the disk space
required on a server, the time required on specialized hardware such as a simulator, and what
the travel budget will be.
Project scheduling activities
o Split project into tasks and estimate time and resources required to complete each task.
o Organize tasks concurrently to make optimal use of workforce.
o Minimize task dependencies to avoid delays caused by one task waiting for another to
complete.
o Dependent on project managers intuition and experience.
Project scheduling process
178
Project activities.
Gantt Chart
PERT charts
Experience-based approaches
Experience-based techniques rely on judgements based on experience of past projects and the
effort expended in these projects on software development activities.
Typically, you identify the deliverables to be produced in a project and the different software
components or systems that are to be developed.
You document these in a spreadsheet, estimate them individually and compute the total effort
required.
It usually helps to get a group of people involved in the effort estimation and to ask each
member of the group to explain their estimate.
Problem with experience-based approach.
o The difficulty with experience-based techniques is that a new software project may not
have much in common with previous projects.
o Software development changes very quickly and a project will often use unfamiliar
techniques such as web services, application system configuration or HTML5.
180
o If you have not worked with these techniques, your previous experience may not help
you to estimate the effort required, making it more difficult to produce accurate costs
and schedule estimates.
Takes into account black-box code that is reused without change and code that has to be
adapted to integrate it with new code.
There are 2 versions:
o Black-box.
Reuse where code is NOT modified. An effort estimate (PM) is computed.
o White-box
Reuse where code is modified. A size estimate equivalent to the number of lines
of new source code is computed. This then adjusts the size estimate for new
code.
Multiplier
Product attributes
o Concerned with required characteristics of the software product being developed.
182
Computer attributes
o Constraints imposed on the software by the hardware platform.
Personnel attributes.
o Multipliers that take the experience and capabilities of the people working on the
project into account.
Project attributes.
o Concerned with the particular characteristics of the software development project.
Key points
The price charged for a system does not just depend on its estimated development costs and the
profit required by the development company. Organizational factors may mean that the price is
increased to compensate for increased risk or decreased to gain competitive advantage.
Software is often priced to gain a contract and the functionality of the system is then adjusted to
meet the estimated price.
Plan-driven development is organized around a complete project plan that defines the project
activities, the planned effort, the activity schedule and who is responsible for each activity.
Project scheduling involves the creation of various graphical representations of part of the project
plan. Bar charts, which show the activity duration and staffing timelines, are the most commonly
used schedule representations.
A project milestone is a predictable outcome of an activity or set of activities. At each milestone, a
formal report of progress should be presented to management. A deliverable is a work product that
183
Configuration management
o System building
The process of assembling program components, data and libraries, then
compiling these to create an executable system.
o Change management.
Keeping track of requests for changes to the software from customers and
developers, working out the costs and impact of changes, and deciding the
changes should be implemented.
o Release management.
Preparing software for external release and keeping track of the system versions
that have been released for customer use.
Agile development, where components and systems are changed several times per day, is
impossible without using CM tools.
The definition versions of components are held in a shared project repository and developers
copy these into their own workspace.
They make changes to the code then use system building tools to create a new system on their
own computer for testing. Once they are happy with the changes made, they return the
modified components to the project repository.
Development phases
185
A development phase where the development team is responsible for managing the software
configuration and new functionality is being added to the software.
A system testing phase where a version of the system is released internally for testing.
o No new system functionality is added. Changes made are bug fixes, performance
improvements and security vulnerability repairs.
A release phase where the software is released to customers for use.
o New versions of the released system are developed to repair bugs and vulnerabilities
and to include new features.
Multi-version systems
For large systems, there is never just one “working” version of system.
There are always several versions of the system at different stages of development.
There may be several teams involved in the development of different system versions.
CM terminology
Term Explanation
Baseline A baseline is a collection of component versions that make up a system.
Baselines are controlled, which means that the versions of the
components making up the system cannot be changed. This means that it
186
Version management.
187
Version management (VM) is the process of keeping track of different versions of software
components or configuration items and the systems in which these components are used.
It also involves ensuring that changes made by different developers to these versions do not
interfere with each other.
Therefore, VM can be thought of as the process of managing code-lines and baselines.
Baselines are important because you often have to recreate a specific version
of a complete system.
Version control (VC) system identify, store, and control access to the different versions of
components.
There are 2 types of modern version control system.
o Centralized systems
Where there is a single master repository that maintains all versions of the
software components that are being developed. Subversion is a widely used
example of a centralized VC system.
o Distributed systems.
Where multiple versions of the component repository exist at the same time.
Git is a widely used example of a distributed VC system.
Key features
o Version and release identification
o Change history recording.
o Support for independent development.
o Project support
o Storage management.
The project repository maintains the “master” version of all components. It is used to create
baselines for system building.
When modifying components, developers copy (check-out) these from the repository into their
workspace and work on these copies.
When they have finished their changes, the changed components are returned (checked-in) to
the repository.
Developers check out components or directories of components from the project repository into
their private workspace and work on these copies in their private workspace.
When their changes are complete, they check-in the components back to the repository.
If several people are working on a component at the same time, each check it out from the
repository. If a component has been checked out, the VC component warns other users wanting
to check out that component that it has been checked out by someone else.
Repository check-in/check-out
190
A “master” repository is created on a server that maintains the code produced by the
development team.
Instead of checking out the files that they need, a developer creates a clone of the project
repository that is downloaded and installed on their computer.
Developers work on the files required and maintain the new version on their private repository
on their own computer.
191
When changes are done, they “commit” these changes and update their private server
repository. They may then “push” these changes to the project repository.
Benefits
o Provides a backup mechanism for the repository.
If the repository is corrupted, work can continue, and the project repository can
be restored from local copies.
o Allows for off-line working so that developers can commit changes if they do not have a
network connection.
o Project support is the default way of working.
Developers can compile and test the entire system on their local machines and
test the changes that they have made.
Open-source development
Rather than a linear sequence of versions that reflect changes to the component over time,
there may be several independent sequences.
o This is normal in system development, where different developers work independently
on different versions of the source code and so change it in different ways.
At some stage, it may be necessary to merge codeline branches to create a new version of a
component that includes all changes that have been made.
192
o If the changes made involve different parts of the code, the component versions may be
merged automatically by combining the deltas that apply to the code.
Storage management
When version control systems were first developed, storage management was one of their most
important functions.
Disk space was expensive, and it was important to minimize the disk space used by the different
copies of components.
193
Instead of keeping a complete copy of each version, the system stores a list of differences
(deltas) between one version and another.
o Applying these to a master version (usually the most recent version), a target version
can be recreated.
Storage management using deltas.
System building
System building is the process of creating a complete, executable system by compiling and
linking the system components, external libraries, configuration files, …
194
System building tools and version management tools must communicate as the build process
involves checking out component versions from the repository managed by the version
management system.
The configuration description used to identify a baseline is also used by the system building tool.
Build platforms.
The development system, which includes development tools such as compilers, source code
editors, …
o Developers check out code from the version management system into a private
workspace before making changes to the system.
The build server, which is used to build definitive, executable versions of the system.
o Developers check-in code to the version management system before it is built. The
system build may rely on external libraries that are not included in the version
management system.
The target environment, which is the platform on which the system executes.
Minimal re-compilation
Executable system creation.
Test automation.
Reporting
Documentation generation.
System platforms
The development system, which includes development tools such as compilers, source code
editors, …
The build server, which is used to build definitive, executable versions of the system. This server
maintains the definitive versions of a system.
The target environment, which is the platform on which the system executes.
o For real-time and embedded systems, the target environment is often smaller and
simpler than the development environment.
Agile building
Check out the mainline system from the version management system into the developer’s
private workspace.
196
Build the system and run automated tests to ensure that the built system passes all tests. If not,
the build is broken, and you should inform whoever checked in the last baseline system. They
are responsible for repairing the problem.
Make the changes to the system components.
Build the system in the private workspace and rerun system tests. If the tests fail, continue
editing.
Once the system has passed its tests, check into the build system but do not commit it as a new
system baseline.
Build the system on the build server and run the tests. You need to do this in case others have
modified component since you checked out the system. If this is the case, check out the
components that have failed and edit these so that tests pass on your private workspace.
Continuous integration
Pros
o The advantage of continuous integration is that it allows problems caused by the
interactions between different developers to be discovered and repaired as soon as
possible.
197
o The most recent system in the mainline is the definitive working system.
Cons
o If the system is very large, it may take a long time to build and test, especially if
integration with other application systems is involved.
o If the development platform is different from the target platform, it may not be possible
to run system tests in the developer’s private workspace.
Change management.
Organizational needs and requirements change during the lifetime of a system, bugs have to be
repaired and systems have to adapt to changes in their environment.
198
Change management is intended to ensure that system evolution is a managed process and that
priority is given to the most urgent and cost-effective changes
The change management process is concerned with analyzing the costs and benefits of
proposed changes, approving those changes that are worthwhile and tracking which
components in the system have been changed.
Release management
Release components
As well as the executable code of the system, a release may also include:
200
o Configuration files:
Defining how the release should be configured for particular installations.
o Data files (such as files of error messages)
Needed for successful system operation.
o Installation program
Used to help install the system on target hardware.
o Electronic and paper document
Describing the system.
o Packaging and associated publicity
Designed for that release.
Competition
o For mass-market software, a new system release may be necessary because a
competing product has introduced new features and market share may be lost if these
are not provided to existing customers.
Marketing requirements.
o The marketing department of an organization may have made a commitment for
releases to be available at a particular date.
Platform changes.
o You may have to create a new release of a software application when a new version of
the operating system platform is released.
Technical quality of the system.
o If serious system faults are reported which affect the way in which many customers use
the system, it may be necessary to issue a fault repair release. Minor system faults may
be repaired by issuing patches (usually distributed over the Internet) that can be applied
to the current release of the system.
Release creation
201
The executable code of the programs and all associated data files must be identified in the
version control system.
Configuration descriptions may have to be written for different hardware and operating
systems.
Update instructions may have to be written for customers who need to configure their own
systems.
Scripts for the installation program may have to be written.
Web pages have to be created describing the release, with links to system documentation.
When all information is available, an executable master image of the software must be prepared
and handed over for distribution to customers or sales outlets.
Release tracking
In the event of a problem, it may be necessary to reproduce exactly the software that has been
delivered to a particular customer.
When a system release is produced, it must be documented to ensure that it can be re-created
exactly in the future.
This is particularly important for customized, long-lifetime embedded systems, such as those
that control complex machines.
o Customers may use a single release of these systems for many years and may require
specific changes to a particular software system long after its original release date.
Release reproduction
To document a release, you have to record the specific versions of the source code components
that were used to create the executable code.
You must keep copies of the source code files, corresponding executables and all data and
configuration files.
You should also record the versions of the operating system, libraries, compilers and other tools
used to build the software.
Release planning
202
As well as the technical work involved in creating a release distribution, advertising and publicity
material have to be prepared and marketing strategies put in place to convince customers to
buy the new release of the system.
Release timing
o If releases are too frequent or require hardware upgrades, customers may not move to
the new release, especially if they have to pay for it.
o If system releases are too infrequent, market share may be lost as customers move to
alternative systems.
Software as a service
Key points
203
Formal methods use mathematical notations to eliminate ambiguity, making them appropriate for critical systems where precision is paramount. However, they are often inaccessible to customers who cannot verify that these specifications meet their needs. Natural language, while understandable and intuitive, tends to lack precision and can lead to confusion or amalgamation of requirements .
While requirements should state what a system should do, and design should outline how it achieves that, in practice, the two often merge, particularly to meet regulatory demands or interoperability needs. A specific system architecture may guide the structuring of requirements, becoming an intrinsic part of satisfying non-functional demands or adhering to domain-specific requirements .
Automated testing aims to improve efficiency and consistency in unit testing by running tests without manual intervention. It involves using frameworks like JUnit to write, execute, and report on tests. Essential components include setup for initializing tests, call parts for executing code under test, and assertions for verifying outcomes against expected results .
Scaling up agile methods involves maintaining agile principles such as flexible planning, frequent releases, and good team communication while accommodating larger, longer projects with multiple development teams. This requires adapting agile techniques to include coordination across teams and possibly incorporating more structured processes to manage complexity .
Configuration Management supports dynamic software environments by implementing policies and tools that manage version control, system building, change requests, and release management. It helps track changes in a collaborative development setting, preventing conflicts and ensuring that all versions are correctly maintained and integrated .
The informality of agile methods conflicts with the detailed specifications typical in contracts used by large organizations. This makes it difficult to define deliverables strictly upfront, as agile development interleaves specification and development. A shift to contracts based on developer time rather than specific functionalities is seen as high-risk by legal departments because it lacks definite guarantees of deliverables .
Pair programming can be more efficient in terms of problem-solving and code quality due to the collaborative nature, which allows for continuous feedback and error-checking. This collaborative approach helps in grasping complex issues more efficiently than when programmers work separately, thus reducing risks when team members leave .
Agile methods focus on flexibility and quick adaptation by emphasizing working software over extensive documentation and customer collaboration over contract negotiation. They allow for iterative development where customer feedback is continually integrated, reducing overhead and enabling a rapid response to changing requirements without excessive rework .
User testing is crucial as it accounts for environmental factors and real-world use conditions that cannot be replicated in testing environments. Users' direct interactions help to identify issues related to usability, performance, and reliability that structured tests by developers might miss .
Tabular specifications provide clarity and are well-suited for defining multiple scenarios like alternative actions, reducing ambiguity compared to natural language. However, they might not be as intuitive for end-users unfamiliar with such formats, potentially requiring supplementary natural language descriptions for broader understanding .