Instructional Materials in Software Engineering 1
Instructional Materials in Software Engineering 1
MATERIALS IN SOFTWARE
ENGINEERING-1
Abstract
A compilation of instructional materials on the different topics in software engineering. It is
divided into units that contain reading materials and assessment questions or activities to meet
the specified learning objectives per unit.
LEARNING OBJECTIVES:
At the end of this chapter you should be able to:
➢ Explain the nature of software
➢ Classify software according to its category, sub category, and application
➢ Describe the desirable software capabilities
OVERVIEW:
The concept of software as a computer program was established by Allan Turing in the 1930s while the
word ‘software’ was coined by John Tukey in 1958. A computer program is defined as a set of written
instructions that perform certain tasks on computer hardware. However, software lacks usability without
accompanying documentation such as user manuals, installation procedures, and operating manuals.
These documents are written mainly for the target users of the software and are therefore written in a
user-friendly language. Thesesoftware are developed, reviewed and maintained by software
professionals who also need accompanying documentation such as specification, design and testing
documents. Therefore, software consists of computer program and its related documentation.
READING MATERIALS:
Software is a computer program and all documentation necessary to develop, install, use and maintain
a complete software system. Therefore, software includes computer programs, procedures, rules and
possibly associated documentation and data pertaining to operation of a computer system such as:
➢ Requirements Documents
➢ Design Specifications
➢ Source Code
➢ Test Plans
➢ Operating Manuals
➢ Quality Assurance Procedures
➢ Software Problem Reports
➢ Maintenance Procedures
➢ User's Manuals
➢ Installation Instructions/Procedures
➢ Training Aids
Types of Software Products Developed
➢ Generic Products. These are stand-alone systems, which are produced by development
organization and sold in the open market to any customer who is able to buy them. Examples are:
• Databases
• word processors
• drawing packages
• project management tools.
➢ Customized Products. These are software projects, which are commissioned by a particular
customer and developed specially by a software contractor. Examples are:
• systems for electronic devices
• air traffic control systems
• systems written to support a particular business process like Payroll, Accounting, etc.
Categories of Software
➢ System Software. These are software that deal with interfacing with hardware; and provide
services to other programs; It is characterized by heavy interaction with computer hardware,
resource sharing, multiple users, complex data structures and multiple external interfaces.
Examples are:
• operating systems
• language compilers
• editors
• assemblers
• device drivers
• debuggers
• OS components
• file management utilities
• IDE's
• networking tools
➢ Application Software. These are also referred to as end user software. These are further
categorized into the following applications:
These desirable software capabilities are included in the metrics for evaluating software quality based on
international standard such as the ISO 9126.
See ISO9126 software quality characteristics http://www.sqa.net/iso9126.html.
SUMMARY:
To sum it up, software includes not just the source code but all items and documents associated to its
creation and implementation. Regardless of its use and application, quality software is written in a way
that it should be efficient, usable, maintainable, effective and dependable. Developing quality software is
therefore a great challenge to any software developer.
ASSESSMENT:
1. List down the software you use in your daily tasks at home and school and specify its category
and sub category.
2. For each software in your list, describe its desirable characteristics.
2. UNDERSTANDING SOFTWARE ENGINEERING
LEARNING OBJECTIVES:
At the end of this chapter you should be able to:
➢ Describe what is software engineering
➢ Explain the need for software engineering
➢ Describe software engineering as a discipline
OVERVIEW:
Software Engineering is a term introduced by Friedrich Bauer during the 1968 NATO Software
Engineering Conference in Germany and was defined as the application of a disciplined approach for the
development and maintenance of computer software. This implies that the term ”engineering” is
synonymous to “a disciplined approach”. However, there are many definition of software engineering.
According to the Institute of Electrical and Electronic Engineers (IEEE), software engineering deals with
the establishment and use of sound engineering principles to economically obtain software that is reliable
and works efficiently on real machines. Software engineering is therefore defined as a technological and
managerial discipline which uses engineering principles in the development, creation and maintenance
of software. Engineering in general, applies scientific, mathematical, economic, social and practical
knowledge in the design and construction process. It encompasses the use of tools, techniques, and
methods that are useful during the execution of the steps needed for the development and maintenance
of the product being engineered. Software engineers use methods and theory from computer science
and apply this cost effectively to solve difficult problems in the development and maintenance of software
systems. There are several tools available to software developers that aid in facilitating the development
and maintenance of software systems.
Image created by Subedi extracted from IPTC Photo Metadata
READING MATERIALS:
There is a need to study and practice software engineering for the following reasons: (1) to be able to
meet the different capabilities that define software quality, (2) to address the problems which afflict
software development, (3) and to address the painful truths behind the prevailing software development
myths.
It was mentioned previously that software engineering is a managerial and technological discipline. As a
discipline, it deals with complexity in a staged manner; it ensures that errors are detected and dealt with
early in the process; and it involves gaining a better understanding of the software being developed thru
modeling. These disciplined approaches are discussed below:
Stage 2: Implementation
➢ This stage focuses on the question “how?”. The following questions are asked:
➢ How data structure and software architecture are to be designed?
➢ How procedural details are to be implemented?
➢ How the design will be translated into programming language?
➢ How testing will be performed?
Stage 3: Maintenance
This stage deals with software change requests to correct software errors, adapt to evolving environment,
or expand the software.
Phases in Maintenance Stage
1. Corrective. Changes the software to correct defects.
2. Adaptative. Modifies the software to accommodate changes to its external environment.
3. Enhancement. Extends the software beyond its original function requirements. Changes here are
termed as “perfective maintenance”
The phases involved in software engineering are analogous to those phases used in building engineering.
These phases include requirements specifications, design, construction, testing (pre-delivery approval),
and maintenance. The only difference lies in the fact that software does not change over time. Software
maintenance is warranted due to changes in technology or environment. In contrast, buildings wear out
or degrade over time due to environmental maladies.
SUMMARY:
Software engineering is a disciplined approach for the development of high-quality software products
given both time and budget constraints. This disciplined approach consists of techniques, methods,
standards, guidelines, and practices that can be used during the software development process. The
challenge of achieving high-quality software is one of the reasons for studying software engineering.
Software development myths and problems that afflict software development can be addressed by the
study and application of software engineering principles.
ASSESSMENT:
1. Are there software that are not engineered? Give an example.
2. Explain why is there a need to engineer software.
3. Cite tools that are used to facilitate the software engineering process.
4. Explain what is a disciplined approach in software engineering.
3. SOFTWARE DEVELOPMENT PROCESS MODELS
LEARNING OBJECTIVES:
➢ Describe software development life cycle models and their importance
➢ Explain the difference and similarities between the linear, iterative and evolutionary models
➢ Describe the phases, activities and deliverables of each process model
➢ Identify pre-development and ongoing life cycle activities
➢ Explain the role of software process maturity in the adaptation of process model (life cycle
strategy)
OVERVIEW:
The three cornerstones needed to produce a successful software product are people, projects, and
processes. Processes are part of a software life cycle model or methodology. Project tasks and processes
that are defined in a project schedule are developed based on the adopted process paradigm/model
or the methodology. These processes guarantee that the software product developed possess good
qualities. Failure in the selection and adoption of the most relevant or best-fit process model and software
development methodology affects the quality of the delivered project. Therefore, to manage software
activities and increase the quality of software developed, industry-proven models for software
development and maintenance must be selected, adopted and followed. These software engineering life
cycle models provide systematic and well-structured approaches and are often supported by tools that
facilitate their effective use. Depending on the size of the adopting organization, its maturity level, and
the complexity of the software to be developed, a life cycle model can be tailored to suit the particular
needs of the organization and its development team.
READING MATERIALS:
Characteristics:
• Project development phases are sequential and generally one- way
• Deadlines are determined very early in the project
• Required project results are completely and unambiguously determined
• A milestone document suite concludes each project phase that when approved, signals the start
of subsequent phase
• May be applied to large and small projects
• Ideal when resources are available
• Applicable when standard procedures are fully documented
Advantages:
• Divides a large and/or complex task into smaller, manageable tasks
• Every project can be carefully planned
• Authorities and responsibilities can be clearly delineated
• Clear and distinctive phases, each phase with well specified inputs, deliverables, and
milestones allow management to assess project progress and take corrective action if
necessary
• Easy to apply and understand
• Large amount of detailed documents reduce future maintenance cost
Disadvantages:
• Real projects rarely follow the sequential flow that the model uses since it does not reflect the
problem-solving nature of software development that leads to rework and iterations
• It is often difficult for the customer to state all requirements explicitly.
• A working version of the system will be available late in the project life cycle; it takes too long to
see results
• Inherently linear sequential nature discourages late changes
• It depends on stable and correct requirements; a major product blunder can be disastrous
• Amount of documentation can be excessive
• Linear sequential nature may lead to "blocking state"
The main drawback of the waterfall model is the difficulty of accommodating change after the process is
underway. One phase has to be complete before moving onto the next phase. For example, if during the
design phase, an ambiguity in the software requirements is discovered, the designer has to report this
error to the manager, and the analysis team has to deal with this ambiguity. Ignoring this error during the
design might have severe consequences, including higher repair cost to deal with the same error in the
future.
Fountain Model. It is a variant of the waterfall model where "water can flow upwards". The model
recognizes that iteration to previous phases may be necessary. This is the more realistic software
development model which is more iterative in nature, allowing the revisiting of preceding phases if
necessary. For example, while in the coding phase, the programmer might discover a flaw in the
detailed design. This flaw is reported to the designers who will take appropriate actions to address
the error. It is a more realistic model than waterfall but is more difficult to control, hence the need for
change control procedures.
Other linear life-cycle strategies customized for specific organizations include (1) Model Systems Ltd
used by NCC-UK, (2) Foundation used by Andersen Consulting, and (3) Structured Project Life-cycle
used by Yourdon group.
2. Iterative or Prototyping
It is a process that enables the developer to create a model of the software prototype that must be built
to be able to understand customer requirements before delivering the final system. The process proceeds
in the form of iterations. In every iteration, a prototype is created based on initial customer requirements.
A prototype is an executable program that mainly implements the functional aspects of the software being
developed that are related to the graphical user interface. For every iteration from the prototype onwards,
the customer gives feedbacks about the model, and this continues until the customer is satisfied with the
model developed. This model can be:
• A PC-model that depicts human-machine interactions
• A working software that implements a subset of the functions required of the system, or
• An existing program that performs all or parts of the functions desired but will be improved
in the development effort.
Characteristics:
• Development starts with incomplete requirements
• Full requirements are derived from user interaction on a prototype
• There are three types, depending on the amount of code retained in the final system:
1. Prototyping with disposable system – tests the adequacy of
proposed solution; requirements are formalized after they are
sufficiently determined through reactions on prototypes; prototypes
are disposed after formalizing requirements then further
development is done according to linear sequential model
2. Prototyping with working system – A prototype of most critical
functions is built; after acceptance, the prototype is extended to a
working system
3. Evolutionary – prototype adapts to changing requirements;
subsequent prototypes of the systems evolve to the eventual
operational system; prototype is used for deployment
• Ideal for systems where requirements may be defined but human- computer interface
suitability( user's response) is not yet known
• Useful when developing a system the developer has not known/seen before
Advantages:
• System requirements do not have to be uniquely determined
• System requirements can be changed during the project
• Delivers clear and understandable system definition and specifications to the end user;
more effective to gather requirements
• Enhances communication regarding suitability of human- computer interfaces; Increases
end user involvement and satisfaction
• Development environment can be tested quickly
• Can be used to demonstrate technical, economic, and political feasibility
Disadvantages:
• Rising expectations of the end user. The user sees what appears to be the working version
of the software unaware that overall software quality and maintainability has not been
considered, so that customer demands just a few fixes for the product to be completed
into a full working system.
• Danger of never-ending development because of user-developer interactions during
development
• Danger of neglecting planning, verification, validation, backup procedures and
documentation
• Danger of modeling before sufficient analysis of the current and desired results
• Danger of making design and implementation compromises in order to get a prototype
working quickly
• Building on top of the prototype frequently leads to software project failure and therefore
should be avoided unless it is an accurate reflection of customer’s desires
Prototyping could be used as a tool to see how users respond by clarifying requirements and desirable
features to explore alternative design possibilities, or by testing the adequacy of the proposed solution.
This can address one of the weaknesses of the Waterfall Model wherein reliance on written
documentation for the description of requirements might be inappropriate for user-centered systems, and
wherein approved written requirements are volatile and subject to numerous revisions and changes later
in the development process. Prototyping the requirements by building a visual and executable model is
considered to be an effective way to review and approve requirements, and therefore reduces the risks
of requiring changes after approving the requirements, leading to fewer revisions and iterations during
software development.
3. Evolutionary Model
This iterative approach enables software engineers to develop increasingly more complete versions of
the software. The starting point of the evolutionary software process model is the problem domain that
needs to be solved by means of a software system or a manual system that needs to be automated.
The evolutionary software process has the following steps: (1) A clear delineation of the functional
boundaries of the desired system is first set; (2) Then the desired system is split up into Microsystems;
(3) The microsystem is developed and put into production in 6 months or less; (4) Long term goals and
planning are reassessed and subsequent microsystems are adjusted if necessary. Steps (3) and (4)
are repeated until planned system is realized.
Characteristics:
• Product-oriented instead of project-oriented
• Iterative approach – every system goes through all the phases(from analysis to integration)
• Continuous testing and re-planning based on long term goals
Advantages:
• Developers see the results faster
• End users and management get fast response and see the product evolve
• Fast reaction to changed goals
• Better manageability of the development process through: (1) incremental construction (2)
continuous control of the system
Disadvantages:
• No recursion to previous microsystem is scheduled
• Changing environments might obliterate long-term goals
• Could be costly
Disadvantages:
• Lack of process visibility; cannot determine how far the product is from the final
version
• Systems are often poorly structured
• Special skills(e.g. in languages for rapid prototyping) may be required
Recommendation:
• Applicable for small company in growing stage
• Good only for small company in a growing stage
• Useful when budget is limited / critical
• Requirements should be clearly defined
• Releases should be carefully scheduled
• Produce specifications document before coding
This incremental approach is useful when technical requirements or staffing is unavailable for a complete
implementation by the business deadline that has been established for the project.
Spiral Model. This model couples the iterative nature of prototyping with the controlled and systematic
aspects of the linear sequential model. Software is developed in a series of incremental releases. The
model is divided into typically three or six framework activities, also called task regions: (1) Customer
communication – tasks required to establish effective communication between customer and developer
(2) Planning – tasks required to define resources, timeliness, and other project related information (3)
Risk Analysis – tasks required to assess both technical and managerial risks (4) Engineering – tasks
required to build representations of the application (5) construction and release – tasks required to
construct, test, install and provide user support (6) Customer Evaluation – tasks required to obtain
customer feedback based on evaluation of software representations created and implemented. Each
pass through the planning region results in adjustments to the project plan while cost and schedules are
adjusted based on feedback derived from customer evaluation. The customer and developer better
understand and react to risks at each evolutionary level where prototyping could be applied at any stage
of the evolution. This model demands and relies on risk assessment expertise for success. It is
characterized with many throw-away prototypes as a risk reduction mechanism. These prototypes may
or may not be required in each phase.
Advantages:
• Splits a potentially large development effort into small chunks in which critical, high-risk
functions can be done first
• Takes advantage of incremental release, cumulative costs may be assessed
• Rapid application development can be used (through 4th Generation tools)
Disadvantages:
• Model is complex, and may be too complicated and costly to use (many intermediate stages)
• No clear, distinct phase – can prove to be difficult to manage (because of high integration
of phases)
• Additional internal and external documentation are needed to follow up the large number of
intermediate stages
Recommendation:
• Ideal for large scale systems and never for small projects (because its is too costly)
• Applicable in the following situations:
- There is too much risks involved
- Procedures and technology are dynamic (due to environmental
factors)
- There is lack of expertise/knowledge
- The system could be broken down into sub-systems
The Spiral Model addresses the weakness of the Waterfall Model because phases of the Waterfall Model
do not include any reference to risk management. Formal and continuous consideration of risks
embedded within the software development process contributes to enhancing the quality of software, and
contributes to successful completion of the software project leading to complete and correct product
functionalities developed within the given budget and time constraints. This model is relatively new and
has not been widely used.
Concurrent Development Model. This model, sometimes called Concurrent Engineering allows
tracking of status of extremely complex sets of activities especially those that occur at the same time
during any one phase. It can be represented schematically as a series of major technical activities, tasks,
and their associated states. It defines a series of events that will trigger transitions from one state to state
for each of the software engineering activities. Rather than confining software engineering activities to a
sequence of events, it defines a network of activities that exist simultaneously with other activities. This
model is often used as a paradigm for the development of client/server applications although it is
applicable to all types of software development and provides an accurate picture of the current state of
the project.
4. Other Models
Other models for software engineering exists, some of which may be integrated into the other mainstream
models:
Fourth Generation Techniques. It encompasses a broad array of software tools that enables the
software engineer to specify some characteristics of software at a high level. These tools include some
or all of the following: non-procedural languages for database query, report generation, data
manipulation, screen interaction and definition, code generation; high-level graphics capability;
spreadsheet capability. It focuses on the ability to specify software using specialized language forms or
a graphic notation that describes the problem to be solved in terms that the customer can understand.
For small applications, it may be possible to move directly from requirements gathering step to
implementation using a nonprocedural fourth generation language (4GL). Advantages of this paradigm
include dramatic reduction in software development time and greatly improved productivity for people
who build the software. When coupled with component assembly approaches, the 4GT paradigm may
become the dominant approach to software development. However opponents claim that the resultant
source code produced by such tools are "inefficient" and that the maintainability of large software systems
developed using 4GT is open to question and demands as much or more analysis, design, and testing
to obtain the substantial time saving that can be achieved through the elimination of coding.
Object-oriented Model. This model is centered on the object concept in software systems. It consists of
four phases: (1) Analysis; (2) design; (3) implementation; (4) testing. Analysis starts by identifying the
types of objects needed in the software system to cover all the requirements. Objects used to build the
analysis model can be physical or logical real-life objects. Objects are then identified, together with their
respective attributes and visibilities. For each object, methods that are needed to create, define, modify,
and destroy an object are identified. Then, object relationships are defined. The three main types of
relationships among objects are communication, inheritance, and aggregation or composition. The
communication relationship indicates that one object is sending a message to the other object, normally
to change or enquire about the state of the object. The inheritance relationship indicates that one object
expands the attributes and methods of the other object. The aggregation relationship states that one
object is made of one or more objects in the analysis model. After defining relationships among objects,
methods for object communications are then identified. Also, the sequencing of interactions between the
external users and systems and the software system to be developed is specified. Design starts with
identifying classes and their interrelationships from the given analysis model. A class is a template from
which an object is created. Classes can either be (1) entity – real-life physical and logical objects that
need to remain in persistent store, (2) interface – used to define and manipulate graphical user artifacts
and components needed to interface between the software and its external users and interacting
systems, (3) behavior or control - methods that are needed to encode the business logic that manipulates
entity objects through interface objects. Once completed, the design is mapped to an implementation
using an object-oriented programming language. Object-oriented testing and integration techniques are
then used to test the implementation and integrate it with other components and systems.
Characteristics of this model are the following:
• Reduced maintenance since most of the processes within the system are encapsulated, the
behaviors may be reused and incorporated into new behaviors
• Real-world modeling is more understandable because the model is based on objects (where
objects are organized into classes of objects, and objects are associated with behaviors),
rather than on data or processing.
• Improved reliability and flexibility because new behaviors can be built from existing objects
(through instantiation and inheritance) without affecting existing system functions
• High code reusability since a new object created will automatically inherit the data attributes
and characteristics of the class from which it was spawned and from all super classes
from which it participates
• Best suited for dynamic, interactive environments such as engineering design systems and
CAD/CAM
Component Based Development Model. This object-oriented paradigm incorporates many of the
characteristics of the spiral model but composes applications from prepackaged re-usable software
components sometimes called "classes". These components (classes) created in past software
engineering projects are stored in a class library or repository and later extracted. Candidate class not in
the library is engineered using object-oriented method. This model leads to software reuse that provides
software engineers with a number of measurable benefits such as reduction in development cycle time,
project cost and increase in productivity index. The unified software development process is
representative of a number of component-based development models that have been proposed in the
industry. Using the Unified Modeling Language(UML) , the unified process defines the components that
will be used to build the system and the interfaces that will connect the components. Using a combination
of iterative and incremental development, the unified process defines the function of the system by
applying a scenario-based approach (from the user point of view). It then couples function with an
architectural framework that identifies the form that the software will take. This is an iterative model with
static framework or architecture.
Characteristics of the model are:
• A project plan is a plan of contingencies rather than a plan of actions
• It has four(4) phases:
Inception – shared understanding between developers and users
Elaboration – a framework architecture is produced
Construction – UML is used to construct the system
Transition – system implementation
• It has two forms of modeling:
1. Architectural - a static model or architecture which is developed during elaboration
2. Structural – dynamic model where the requirements in each iteration will be used
for construction
• It is well-matched to Object-oriented Programming(OOP)
Recommendation:
• Useful when present system is not tied to the new system
• More applicable when replacing a system rather than converting to a higher version
• Applicable when users are open to object-oriented language / representation and the
development team is object-oriented trained
Extreme Programming (XP). This is an early implementation of the agile software development method
which is based on incremental and iterative development, where requirements and solutions evolve
through collaboration between self-organizing, cross-functional teams. It is intended to improve software
quality and responsiveness to changing customer requirements. As a type of agile software development,
it advocates frequent releases in short development cycles (timeboxing) to improve productivity and
introduce checkpoints where new customer requirements can be adopted. Other elements of extreme
programming include: programming in pairs or doing extensive code review, automated unit testing of all
code, regular (i.e. end-of-week)integration testing, avoiding programming of features until they are
actually needed, a flat management structure, simplicity and clarity in code, expecting changes in
customer requirements as time passes by, and frequent communication with the customer and among
programmers. The four basic activities performed in XP are: (1) coding – the only truly important product
is code; (2) testing – every piece of code is tested before moving on to the next feature; (3) listening- to
what the customers need the system to do; (4) designing.
Advantages:
• Addresses problems of project risk by not investing in possible future
requirements that might change before they become relevant
• Manager, developers, users work together very closely with frequent verbal
communications for fast feedback
• Reduce cost of changes in requirements by having multiple short development
cycles
• Frequent unit, integration and acceptance tests ensure high-quality software
components
Disadvantages:
• For small group of programmers only (between 2-12)
• Unstable requirements
• No documented compromises of user conflicts
• Lack of an overall design specification or document
• Must be able create automated tests (unit and functional)
Recommendation:
• Applicable to small projects only because developers are so empowered(from
analysis to deployment)
• Useful for conversion of projects
• Most applicable for web-based applications
• Well-matched to component-based programming
• Problems should be definable into smaller functions (details are known;
framework defined already) because of bottom-up approach
Some organizations utilize the mainstream models and apply modifications or variations to eliminate
identified weaknesses and adopt the best practices in software engineering.
Level 1: Initial. The processes used are ad hoc, informal and not documented. The knowledge and
experiences are not archived and documented. Project success relies heavily on the efforts of quality
team members. Due to lack of documented development methodologies and experiences, it might be
impossible to repeat success in new projects even of similar types and complexities. Completed projects
in this level are characterized by low quality, numerous errors, and running over time and budget.
Level 2: Repeatable. The development methodology and all its phases are partially documented. The
processes involved in the documented phases are repeatable, but the successful application of the
processes is not guaranteed every time they are followed because application of documented phases
varies from project to project. Software quality assurance is considered for the documented processes.
Project management techniques and tools are used to track project progress in terms of cost, schedule,
and project deliverables.
Level 3: Defined. The development processes are documented and well defined. Internal standards and
documented methodology are used uniformly across the organization and in all development projects
undertaken. Documented processes have also been updated over time using past experiences to
improve performance. However, past experiences are assessed and documented qualitatively, not
quantitatively. In this level, risk management is in place and all aspects of project management are
thoroughly considered.
Level 4: Managed. Developmental metrics are collected during the execution of the project to provide a
quantitative basis for software quality management. These metrics allow the project manager to predict
the future performance of the remaining phases of the project, thus, allowing the manager to closely track
and control the project based on quantitative assessment. This allows the manager to manage the risks
more effectively and take the necessary and timely actions should any risk occur.
Level 5: Optimized. Using metrics collected during the execution of the project phases, and using the
documented standards and processes, modifications or improvements to both standards and processes
are implemented continuously. These changes are triggered by new technology adoption that leads to
improved performance. Collected metrics are used to optimize the processes and the organization
workflow leading to increased productivity while maintaining product quality. Performance indicators are
developed and monitored. Changes to processes and standards show improvements in performance
from project to project. Process and technology change management systems are in place.
Specifically, the Software Engineering CMMI Model is illustrated and discussed at
https://www.geeksforgeeks.org/software-engineering-capability-maturity-model-cmm/.
An organization placed at a particular level is an indication that it meets all the requirements for that level
and is showing clear indication that it is progressing toward the next higher level. The Software
Engineering Institute (SEI) is maintaining a database of appraised organizations. The SEI Appraisal
System (SAS) contains the appraisal results of hundreds of IT organizations at levels 2 to 5.
SUMMARY:
To develop high-quality software product and to deal with the management of software activities,
structured and well-documented processes must be clearly defined and used by the development team.
Industry-proven software engineering life cycle models have been introduced, and the project manager
must select the most appropriate model to be adopted by the organization. Depending on the size of the
adopting organization, its maturity level, and the complexity of the software to be developed, a life cycle
model can be tailored to suit the particular needs of the organization and its development team. The
Capability Maturity Model (CMM) is used to assess the maturity of the processes in a software
development organization. A typical software engineering lifecycle model consists of sequential phases,
including analysis, design, implementation, testing, and integration. In addition, important continuous
activities must be performed, including project management, validation and verification, configuration
management, quality assurance, and documentation.
BOOK REFERENCE/S:
Software Engineering: A Practitioner’s Approach 7/e by Roger S. Pressman
ASSESSMENT:
1. Secure a copy of a real-life software project schedule and identify the software process model
(lifecycle strategy) that may have been employed by the project development team
2. In the schedule, identify the umbrella or ongoing life cycle activities.
3. Identify the factors to consider in adapting the best fit process model for a software project.
4. Explain the difference and similarities between the linear, iterative and evolutionary models.
4.1 UNDERSTANDING SOFTWARE PROJECT MANAGEMENT
LEARNING OBJECTIVES:
At the end of this chapter you should be able to:
➢ Describe what is software project management
➢ Explain the need for software project management
➢ Discuss the phases in project management
➢ Describe the role of a project manager
OVERVIEW:
Project Management is the first layer of the Software engineering process, meaning, it overlays the entire
development process from beginning to end. It is one of the continuous or ’umbrella’ activities in software
engineering. The focus of project management is to assure that software development projects meet
customer expectations and are delivered within budget and time constraints. It is an important aspect of
the development of software systems and a critical skill for a software engineer, specifically the team
leaders and/or systems analysts.
The Project Manager is an individual with a diverse set of skills – management, leadership, technical,
conflict management, and customer relationship – who is responsible for initiating, planning, executing,
and closing down a project.
Because of the difficulty in managing a software project, the following are factors to consider in
software project management::
➢ Scope of the work to be done
➢ Risks to be incurred
➢ Resources to be required
➢ Tasks to be accomplished
➢ Milestones to be tracked
➢ Efforts (cost) to be expended
➢ Schedules to be followed
Project management has four phases:
1. Initiating the project. Activities are performed to assess the size, scope, and complexity of the project
and to establish the procedures to support later project activities. It involves activating the project and
building the project plan. The project plan provides the basis against which to control the project. Its key
elements are work plan, schedule, staff effort estimates, budget, and milestones.
2. Planning the project. It focuses on defining clear, discrete activities and the work needed to complete
each activity within a single project. These activities are incorporated into different management plan
documents in the form of quality plan, risk management plan, validation plan, configuration management
plan, maintenance plan, and staff development plan. There may be other plans needed as part of the
project management planning process based on the ten (10) areas or body of knowledge in project
management. For details on these project plans, see PMBOK knowledge areas
https://www.projectmanager.com/blog/10-project-management-knowledge-areas.
3. Executing the project. It focuses on putting the plans developed in project initiation phase and planning
phase into action. It involves the following: (1) executing the baseline project plan, (2) monitoring project
progress against the baseline plan, (3) managing changes to the baseline plan, (4) maintaining the project
workbook, and (5) communicating the project status. An important aspect in this phase is progress
reporting which enables the project manager to understand the current state of the project, and to report
the status of the project to the project team, senior management, and the client. Project progress is often
measured and reported in two ways (1) quantitatively in terms of man-hours, costs, tasks
started/completed, milestones achieved, and elapsed time; (2) qualitatively in terms of client/user
satisfaction, staff morale, staff turnover, quality, objectives achieved, and change requests from
user/client. See project status report template at
https://www.projectmanagementdocs.com/template/project-monitoring-and-controlling/project-status-report/#axzz6R9dloerw.
Another important aspect is progress monitoring, which is the process of collating progress reports and
assessing the results against the project plan.
3. Closing down the project. It focuses on bringing the project to an end. Activities involved are formal
project closure, closing customer contract, and conducting post-implementation reviews.
For a thorough understanding and discussion of the four (4) phases, and the documents and deliverables
involved for each phase, see https://www.projectmanagementdocs.com/#axzz6R9dloerw.
SUMMARY:
To sum it up, project management is needed from the inception of the software project down to its
completion and delivery. It involves writing project proposal, costing, developing plans and schedules,
selecting and evaluating project staff; monitoring and controlling the process; and writing and presenting
reports. Software project management is difficult as the product is intangible and there is no standard
process to be followed to ensure the successful completion of the software product.
BOOK REFERENCE/S:
Software Engineering: A Practitioner’s Approach 7/e by Roger S. Pressman
ASSESSMENT:
4. Interview a software project manager and list down the top most challenges in managing a software
project and how these challenges are best dealt with.
5. *Download all the templates for the documents needed in all four (4) phases of project management
from https://www.projectmanagementdocs.com/#axzz6R9dloerw, and explain which of these
documents (templates) are the most difficult to prepare and why.
LEARNING OBJECTIVES:
At the end of this chapter you should be able to:
➢ Create a work breakdown structure
➢ Develop an initial project schedule for an actual software project
➢ Describe the impact of lag and lead time for each task dependency type
➢ Describe the impact of dependency type on the project duration
OVERVIEW:
During the project initiation phase, the project manager has to produce an initial project schedule or
timetable indicating the different tasks/activities/works to be accomplished; the deliverables, period to
accomplish, in-charge, and resources required for each task. Normally, the project schedule is presented
in the form of a time table which can be converted into a graphical form, the Gantt chart. Although this
baseline plan provides a framework that guides the project team in accomplishing the tasks to complete
the project within the specified duration, there are factors in a project that need to be monitored and
analyzed such as the dependencies of the tasks with each other, the critical tasks that cannot be delayed,
the estimated project duration, and the impact of constraining the dates on each task in the project. These
factors require that the timetable be converted not just into a Gantt chart that visually shows the timeline,
but into a project network diagram which can be analyzed. The Program Evaluation Review Technique
(PERT) Chart is one of the tools that allows for critical path method/analysis.
The initial step is to produce an initial project task list, refine the task list, and transform it into a work
breakdown structure (WBS), before developing the detailed plan. First, we normally set either the whole
project start-date or the whole project end-date. Then we define the tasks/activities involved in the
project(task list), decompose and structure the tasks(WBS), and we set the start and finish dates for each
task/activity. Then we have to perform project network analysis, to determine the critical activities and
the dependencies of each task to other tasks, and to accurately determine the minimum time to complete
the project. Finally, we may now refine and complete the plan. Here are the detailed steps:
Another way to present the project schedule is through a PERT chart. PERT stands for Program
Evaluation Review Technique. It is a diagram that depicts tasks/activities (in the project) and their
interrelationships. The PERT chart is similar to the project network diagram generated using a standard
project management tool like MS Project and Visual Paradigm. PERT Chart supplements the Gantt Chart
by addressing its weaknesses cited above. Figure 3.0 illustrates a PERT chart while Fsigure 4.0 illustrate
a Project Network Diagram generated by a project management software.
The PERT chart and Project Network Diagram readily show the predecessor activities/tasks a particular
task/activity is dependent on. However, there are different types of dependencies that exist between and
among tasks/activities, which will be discussed below. These dependency types have an impact on the
start and finish of each activity and on the total project duration as a whole.
Scheduling Activities
When we schedule our project tasks/activities the following are the things that we have to do:
1.Create Calendar. Specify duration (start-date and end-date) of each activity / task
• Project Calendar – all tasks/activities and resources
• Task Calendar – specify duration for specific task
• Resource Calendar – specify duration for specific resource needed to accomplish tasks
* Project, Task and Resource Calendars are features of Project Management Software.
2. Establish task dependencies. Define predecessors of each task according to chronological sequence
3. Refine task dependencies. Review and modify task dependencies to reduce task or activity duration.
First-pass dependency may be changed into Finish-Finish or Start-Start (if applicable) to reduce project
duration.
4. Analyze lag and lead time. The amount of wait time between start or finish of predecessor and start or
finish of successor is the Lag Time while Lead time is the amount of overlapping time between start or
finish of predecessor and start or finish of successor
Types of Task Dependencies
1. Finish-Start – most common and default dependency; successor activity cannot start until
predecessor is finished; start of successor can be delayed Ex. Site installation should be finished
first before user test can start
2. Finish-Finish – successor can start anytime; predecessor must finish before successor can finish;
finish of successor can be delayed Ex. Programming must be finished first before documentation
is finished (but documentation can start even Programming not yet finished)
3. Start-Start – successor can start only after predecessor starts; does not matter which one finishes
first; can apply in tandem with F-F; start of successor can be delayed. Example: Designing
navigational structure of website can start only after starting the gathering of information.
However, gathering of information may continue after the design of navigational structure is
finished.
4. Start-Finish - successor can finish only after predecessor has started; successor usually starts
before the predecessor; rare and can be very confusing; finish of successor can be delayed
The diagram below illustrates the different task dependencies and how predecessor and successor
activities are started and finished for each type, and the action that can be done in terms of delay.
Pr S--------F
FINISH-START
Su S--------F
Pr S--------F
FINISH-FINISH
Su S------F
Pr S--------F
START-START
Su S------F
Pr S--------F
START-FINISH
Su S--------F
FINISH-START La -----S-----F
Pr S--------F
FINISH-FINISH
La S------------F
Pr S--------F
START-START
La ----S------F
Pr S--------F
START-FINISH La S-----------F
To appreciate the importance of project networks, we have to perform project network and critical path
analysis. Constructing a project network diagram or PERT chart and performing network and critical path
analysis will be discussed in the succeeding lesson. Alternatively, your project management software like
MS Project can automatically generate the chart/diagram and display the result of analysis.
SUMMARY:
Developing a baseline project plan is important to serve as a framework for the software development
process. It starts with a task list that is transformed into a work breakdown structure and into a project
calendar. This calendar can be presented thru a Gantt chart which is limited in terms of showing the
dependence of one activity to other activities and the critical activities in the project. Hence, there is a
need to define the predecessor activities/tasks for each activity/task and convert the table or Gantt chart
into a project network diagram, i.e. the PERT chart.
BOOK REFERENCE/S:
Software Engineering: A Practitioner’s Approach 7/e by Roger S. Pressman
ASSESSMENT:
1. Using the MS Project, create a project calendar for a simple software development project where
for each task, specify the duration, and the tasks it is dependent on (predecessor tasks).
2. Generate the Gantt chart and PERT chart (project network diagram). Take note of the length of
the critical path (red line) in the project network.
3. For each task/activity, analyze the dependency type and change the default dependency type
(finish-start) to other types if needed. Then take note of the length of the critical path (red line) in
the network.
4. Describe the impact of the dependency type on the project duration.
4.3 ANALYZING THE PROJECT NETWORK DIAGRAM
LEARNING OBJECTIVES:
At the end of this chapter you should be able to:
➢ Explain the need for analyzing the project network diagram
➢ Describe the critical path in a project network
➢ Analyze the earliest time to start and earliest time to finish each activity in the calendar
➢ Analyze the latest time to start and latest time to finish each activity in the calendar
OVERVIEW:
There are factors in a project that need to be monitored and analyzed such as the dependencies of the
tasks with each other, the critical tasks that cannot be delayed, the slack time for each task and for the
entire project, and the impact of constraining the dates on each task in the project. These factors require
that the project schedule in the form of either time table or Gantt chart be converted into a project network
diagram which can be analyzed. The Program Evaluation Review Technique (PERT) Chart is one of the
tools that allows for project network analysis or critical path analysis.
See…
https://www.apm.org.uk/resources/what-is-project-management/what-is-scheduling-in-project-management/.
READING MATERIALS:
The Critical Path Method/Analysis Explained
See https://www.wrike.com/blog/critical-path-is-easy-as-123/
Below is the summary guidelines and discussion of the topics presented in the URL provided above.
Drawing the Project Network Diagram
1. Draw the project network diagram following the rules and convention: Use dummy activities to
correct error in convention and error in logic. Dummy activities are used for drawing the project
network diagram only, and are actually activities with 0 (without) duration.
2. Apply critical path analysis/method to determine the longest path, which represents the minimum
time that the project can be completed, and to determine the critical activities that lie along the
critical path.
3. Use forward pass computation and backward pass computation to analyze each activity in the
project calendar
➢ For each activity, there is:
• Duration symbolized as “t” for time
• Early Start(ES) date - earliest time an activity can begin if all previous activities are begun
at the earliest time.
• Early Finish(EF) date – earliest time an activity can be completed if it is started at the
earliest time
• Late Start(LS) date – latest time an activity can begin without delaying the completion of
the project
• Late Finish(LF) date – latest time an activity can be completed if it is started at the latest
time.
• Total Slack(TS) – the amount of time an activity can be delayed without delaying the
completion of the project.
➢ Forward Pass Computation
• Computes ES & EF of successor activities, hence for all activities
• Determines total project duration which is the length of the critical path
➢ Backward Pass Computation
• Computes LS & LF of predecessor activities, hence for all activities
• Computes slack time for all activities
• Identifies critical activities – with 0 slack time
Critical Path Analysis/Method is used to determine the start and finish dates (duration) of individual
activities in a project. In performing the Forward Pass Computation, it is important to remember the
following:
• For initial activity, ES = 0
• ES = highest EF among multiple predecessor activities
• For each activity, EF = ES + duration of current activity (t)
• EF of terminal activity is project duration
In performing the Backward Pass Computation, it is important to remember the following:
• Start with terminal activity; Set LF = EF, LS = ES
• Walk backward across activities
• LF = lowest LS among multiple successor activities
• LS = LF – duration of current activity (t)
• Slack(TS) = LF – EF
• If slack = 0, activity is critical
In the example network diagram below, forward and backward pass computations are performed on the
example activities, to determine the earliest and latest time an activity can begin and can be completed.
1 2
0 3 4
10
2 1
Activity 1
2 days
Activity 3
Start End
10 days
Activity 2
1 day
Figure 1.0 Example project network diagram for forward pass & backward pass computation:
Forward Pass
ES=EF predecessor EF = ES + t
LS = LF – t LF = LS successor
Slack(TS) = LF – EF
Node 1 to Node 3 : 2
Node 2 to Node 3 : 1
The larger value is taken for the earliest activity time which is 2.
Node 4 has the earliest activity time (EF) of 2 + 10 = 12.
Backward Pass
Usually, the earliest completion time is taken for the latest completion time for the backward pass. A
value may also be given.
If for example, the latest completion time (LF) is given as 15…
Node 3 has the latest completion time (LS) of 15-10 = 5
Using the LS of Node 3 which is equal to 5…
Node 1 has the latest completion time (LS) of 5(Node 3) – 2 = 3
Node 2 has the latest completion time (LS) of 5(node 3) – 1 = 4
Slack refers to the time when activities can take longer without affecting the completion date of the project.
Total slack = latest time of finished activity – earliest time of start activity – duration.
There could be several paths leading from the start to the end of the project. By observation, the longest
path is the critical path.
During the project planning or scheduling phase, the project network should be analyzed by focusing on
the critical path. The critical path is the one with the minimum slack. It represents activities in the project
with minimum slack, and, are considered critical. If there are too many critical activities in the critical path,
then the project schedule is too tight and we might need to review the duration and/or dependency type
defined for each task/activity. To compensate, we can allocate additional time from the slack time of non-
critical activities. We may also transform sequential into parallel activities (if possible), by using Start-
Start or Finish-Finish dependency types instead of the default Finish-Start. It is also important to conserve
slack times for contingencies.
See
https://www.inloox.com/company/blog/articles/back-to-basics-part-10-how-to-create-a-project-network-diagram/.
During project implementation or execution, you should analyze the project network by closely monitoring
activities along the critical path. These critical activities should not be delayed, otherwise, the entire
project would be delayed. Slippage of schedules can be compensated by slack time and by reallocating
resources. The project network could also serve as a tool for analysis of impact of mandated or derived
constraints such as pre-defined deadlines, adjusted deadlines, constraints triggered by unavailability of
resources, and external dependencies. Attention should be given to activities transformed from non-
critical into critical, and activities with negative slack. You may apply compression strategies such as fast
tracking and crashing, to remove or minimize negative slack. See https://pmstudycircle.com/2012/09/fast-
tracking-crashing-schedule-compression-techniques-in-time-management/.
After refining the time schedule, the next step is to complete the baseline project plan with the following
activities (which will be discussed in the succeeding lessons):
1. Estimate cost and resource requirements such as people, equipment, facilities, other resources
2. Assign resources to tasks
3. Summarize resource requirements (Resource Sheet can automatically be done by Project
Management Software)
4. Level resource requirements by updating resource calendars to specify percentage availability of
people, leaves, travels, etc. (leveling of over-allocated and under allocated resources can be
automatically done by Project Management software)
5. Fine-tune the plan (according to client priorities and mandated constraints)
6. Prepare the project budget based on the following cost components:
• Manpower Cost
• Equipment and Facilities Cost
• Material cost
• Licenses and royalties for IPRs
• Direct expenses
• Overhead expenses
• Capital expenses – especial equipment only used by the project
SUMMARY:
Analyzing the project network diagram during scheduling is important so we can accurately determine
the minimum time to complete the project, and identify the critical and non-critical activities in the project.
Critical activities have no slack time and cannot be delayed. If there are too many critical activities in the
critical path, then the project schedule is too tight and we might need to review the activity duration and/or
dependency type defined for each task/activity. To compensate, we can allocate additional time from the
slack time of non-critical activities. After the time schedule has been refined, we may now schedule other
project components like manpower, materials and equipment, facilities, and cost. The project network
diagram should also be analyzed during the project execution/implementation phase where we may apply
compression techniques like fast tracking and/or crashing.
ASSESSMENT:
1. Using the previously created PERT chart in the previous lesson, compare the length of the critical
path to your original timetable’s defined project end date. Are they aligned? Discuss.
2. By observing the critical path, list down the critical activities in you project. For each activity (critical
and non-critical, identify the earliest start time, earliest finish time, latest start time, and latest
finish time.
3. Describe the project schedule if it is too tight or acceptable. Apply the necessary adjustments so
that the project schedule would not be too tight.
4.4 SOFTWARE METRICS
LEARNING OBJECTIVES:
At the end of this chapter you should be able to:
➢ Explain how metrics are used during the project scheduling and resource estimation stage
➢ Explain how metrics are used during the project execution stage
➢ Compute for size-oriented metrics and function-oriented metrics
➢ Derive the project cost in terms of software size and software function
OVERVIEW:
Software metrics refers to a broad range of measures for computer software. It is defined by the IEEE
Standard Glossary of Engineering Terms as “a quantitative measure of the degree to which a system,
component, or process possesses a given attribute”. Measurement can be used throughout the software
project to assist in estimation, quality control, productivity assessment and project control. Productivity
and quality metrics are primarily used for project monitoring and control. These metrics can be stored as
historical data that can be used for planning and estimating purposes. Metrics collected from past projects
are used as a basis from which effort and time duration estimates are made for the current software
project.
Categories of Metrics
➢ Quality metrics – provide an indication of how closely software conforms to explicit customer
requirements.
➢ Productivity metrics – focus on the output of the software engineering process.
Metrics derived after delivery focus on the number of defects uncovered in the field and the maintainability
of the system. These after-delivery measures of software quality present managers and technical staff
with a post mortem (implementation) indication of the effectiveness of the software engineering process
followed by the project team.
Quality metrics can also be indirect measures of the software product. An example is Mc Call’s software
quality factors in terms of correctness, reliability, efficiency, integrity, usability, maintainability, flexibility,
testability, portability, reusability, and interoperability. which are illustrated in the diagram below. It should
be noted that these software quality factors are also discussed as software quality attributes or
characteristics included in the ISO 9126-1 software evaluation instrument.
-Maintainability (Can I fix it?) -Portability (will I be able to use it
in another machine?)
-Flexibility (can I change it?) -Reusability (will I be able to reuse
some of the software?)
-Testability (Can I test it?)
-Interoperability (will I be able to
interface it with another system?)
Here, we chose lines of codes as our normalization value. From the table, a set of size-oriented metrics
can be developed for each project such as the:
• Errors/person-month
• LOC per person-month
• PhP/page of documentation
• Productivity = KLOC/person-month
• Quality = defects/KLOC
• Cost = PhP/LOC
• Documentation = pages of documentation/KLOC
Size-oriented metrics are not universally accepted as the best way to measure the process of software
development[JON86], but most of its proponents claim that LOC can be easily counted and many existing
software estimation models use LOC as a key input. Opponents give the following weaknesses of size-
oriented metrics:
➢ LOC measures are programming language dependent
➢ LOC measures penalize well-designed but shorter programs
➢ LOC measures cannot easily accommodate nonprocedural languages
➢ Their use in estimation requires a level of detail that may be difficult to achieve (the planner must
estimate the LOC to be produced before analysis and design have been completed)
Function-oriented Metrics – another productivity metrics that provide indirect measures and human-
oriented measures to collect information about the manner in which people develop computer software
and human perceptions about the effectiveness of tools and methods. They use a measure of the
functionality delivered by the application as a normalization value. It is an algorithmic approach for project
size estimation.
➢ Rather than counting LOC; function-oriented metrics focus on
program “functionality” or “utility.”
➢ It is based on Function points (FPs), which are derived using an empirical relationship based
on countable measures of software’s information domain and assessment of software
complexity.
➢ The system is classified into Simple, Average and Complex
➢ Function points are computed by completing the table shown below.
Five (5) information domain characteristics are determined and counts are provided in the appropriate
table location. Information domain values are defined in the following manner:
1. Number of user/external inputs. Each user input that provides distinct application oriented data
to the software is counted. These inputs affect the control flow and internal logic of the application
leading to the creation and maintenance of data.
2. Number of user/external outputs. Each user output that provides application-oriented information
to the user is counted. Output refers to reports, screens, error messages, etc. Individual data
items within report are not counted separately.
3. Number of user/external inquiries. An inquiry is defined as an on-line input that results in the
generation of some immediate software response in the form of an on-line output. Each distinct
inquiry or simple user query is counted.
4. Number of files(internal). Database files that are created and maintained in the application is
counted.
5. Number of external interfaces/files. All machine-readable interfaces (e.g., data files on tape or
disk) that are used to transmit information to another system is counted. These are files that are
owned and maintained by other applications but used by the system.
The complexity of software and the effort needed to develop it are a function of the number and type of
these five kinds of functional components that can be obtained and assessed at the requirements
specifications phase.
Measurement parameter Count Simple Average Complex
Number of user inputs [ ] x 3 4 6 = [ ]
Number of user outputs [ ] x 4 5 7 = [ ]
Number of user inquiries [ ] x 3 4 6 = [ ]
Number of lines [ ] x 7 10 15 = [ ]
Number of external interfaces [ ] x 5 7 10 = [ ]
Count-total ----------------------------------------------------------------------------→ [ ]
Once the above data has been collected, a complexity value is associated with each count. See table
below.
Table 2.0 Five functional components and fp count
PARAMETERS COUNT S = (* 3) A = (* 4) C = (* 6)
Count Total 97
Here, FP = Count Total * [.65 + .01 * Sum(Fi)] where Count Total is the sum of all entries
The constant values in the equation and the weighting factors applied to information domains are
determined empirically.
The Fi(i = 1 to 14) are “complexity adjustment values “ based on responses to questions [ART 85]
noted in the table below.
Table 3.0 Complexity adjustment values
Based on the above example where Count Total = 97, we can compute the function points with the
formula: FP = Count Total * [.65 + .01 * Sum(Fi)]
Once function points have been computed, they are used in a manner analogous to LOC to normalize
measures of software productivity, quality, and other attributes:
• Errors per FP
• Defects per FP
• PhP per FP
• Page of documentation per FP
• FP per person-month
LOC and FP measures are often used to derive productivity metrics. However, software project managers
should not compare the LOC/person-month(or fp/person-month) of one group to similar data from other
groups, and should not appraise the performance of individuals by using these metrics. The reason for
this is that many factors influence productivity such as size and expertise of organization; complexity of
problem to be solved and number of changes in design constraints; analysis and design techniques,
review techniques, CASE tools and programming languages used; reliability and performance of
computer-based system; and availability of hardware and software resources.
SUMMARY:
Software are measured in terms of quality and productivity. The measurement data termed as “metrics”
can be used throughout the software project to assist in estimation, quality control, productivity
assessment and project control. During project execution, productivity and quality metrics are used for
monitoring and control. Quality metrics can be direct or indirect measures of the product. Productivity
metrics can be size-oriented (LOC) or function-oriented (FP) and its variants. As project proceeds,
measures of effort and calendar time expended are compared to original estimates and the project
schedule. The project manager uses these data to monitor and control progress. These metrics can be
stored as historical data that can be used for planning and estimating purposes. Metrics collected from
past projects are used as a basis from which effort and time duration estimates are made for the current
software project.
BOOK REFERENCE/S:
Software Engineering: A Practitioner’s Approach 7/e by Roger S. Pressman
ASSESSMENT:
1. From Table 1.0, provide the following metrics:
• Errors per KLOC (thousand lines of code)
• Defects per KLOC
• PhP per LOC
• Pages of documentation per KLOC
2. From Table 1.0, compute for the following metrics:
• Errors/person-month
• LOC per person-month
• PhP/page of documentation
• Productivity = KLOC/person-month
• Quality = defects/KLOC
• From the metrics above, derive Cost = PhP/LOC
3. From Table 2.0, compute for the function points, then compute for the following metrics:
• Errors per FP
• Defects per FP
• PhP per FP
• Pages of documentation per FP
• FP per person-month
• Productivity = function point(fp) / person-month
• Quality = defects / fp
• From the above metrics, derive the Cost = PhP / fp
4.5 PROJECT RESOURCE ESTIMATION
LEARNING OBJECTIVES:
At the end of this chapter you should be able to:
OVERVIEW:
When a software is planned, estimates of required human effort (usually in person-months),
chronological project duration/schedule (in calendar time), and cost must be derived. Estimates are
made using past experiences as a guide if the project is quite similar to the old ones that were developed.
There are empirical estimation techniques that use past measurements as a basis from which estimates
are made. Project scope is established in advanced; and the project is decomposed or broken into small
pieces, which are estimated individually.
READING MATERIALS:
Once project scope has been established, the software project is decomposed and re-characterized as
a set of smaller, more manageable sub-problems. The decomposition techniques take the "divide and
conquer" approach to software project estimation. Software estimation activities can be performed in a
stepwise fashion when the project is decomposed into major functions and related tasks. This is called
process-based decomposition. See…
https://www.tutorialspoint.com/estimation_techniques/estimation_techniques_overview.htm.
We may also perform problem-based decomposition as what was done in the previous lesson where the
following values were derived:
LOC-oriented
• LOC/person-month
• Productivity = KLOC/person-month
• Cost = PhP/LOC
FP-oriented
• FP/person-month
• Productivity = function point(fp) / person-month
• Cost = PhP / fp
Once the empirical metrics KLOC and/or FP are computed, we may apply empirical models to obtain
estimates of software cost, effort, and duration. Empirical estimation models are used to achieve reliable
cost and effort prediction.
The effort estimate can also be derived by converting the size estimate using an estimation software.
Empirical Estimation Models
These models use empirically derived formula to predict efforts as a function of LOC and FP. Values for
LOC or FP are estimated using the approach discussed in the previous lesson (on software metrics), but
instead of using the tables, the resultant values for LOC and FP are plugged into the estimation model.
A typical estimation model is derived using regression analysis on data collected from past software
projects. The overall structure of the model takes the form [MAT94]:
E = A + B x (ev)c
Where A,B, and C are empirically derived constants, E is effort in person-months, and ev is the estimation
variable(either LOC or FP). The majority of estimation models have some form of project adjustment
component that enables E to be adjusted by other project characteristics (e.g. problem complexity, staff
experience, development environment).
LOC-oriented estimation models:
E = 5.2 x (KLOC)0.91 Walston-Felix Model
E = 5.5 + 0.73 x (KLOC)1.16 Bailey-Basili Model
E = 3.2 x (KLOC)1.05 Boehm Simple Model
E = 5.288 x (KLOC)1.047 Doty Model for KLOC > 9
The models listed above will yield a different result for the same value of LOC or FP. Therefore, estimation
models must be calibrated for local needs. No estimation model is appropriate for all classes of software
and in all development environments. Hence, resulting values from these models must be used
judiciously.
These estimation models must also be tested by applying data collected from completed projects; plug
the data into the model; and compare actual to predicted results. An estimation model should also be
calibrated to reflect local conditions.
The Function Points (FP) metrics discussed earlier, rely on the requirements specifications so that
function points reflect the user’s view of the system being developed, and, therefore, they are as stable
as the requirements themselves. As a requirements-based estimation technique, estimations are
obtained once the software project scope is clearly defined in terms of the required functionalities (during
the requirements phase of software development). Computing the number of function points (fp count)
for the project is independent of the design choices taken, tools used, or the programming language
utilized to implement the system.
The unadjusted actor weight (UAW) is the sum of the complexity values assigned to each actor. Similarly,
the unadjusted use case weight (UUCW) is the sum of the complexity values assigned to each use case.
The total unadjusted use case point (UUCP) is the sum of the UAW and UUCW. The number of adjusted
use case points (AUCP) is computed by multiplying the UUCP with the product of two adjustment factors:
the technical complexity factor (TCF) and the environmental factor (EF).
The TCF is obtained using the equation: TCF = 0.6 + (0.01 X TF)
where TF is the sum of all the weighted values computed for each of the 13 technical factors listed in the
table below.
Table 2.0 Technical and environmental complexity values
Changeability requirements 1
Concurrency 1
Security requirements 1
Technical complexity factors are mainly related to the product and its complexity in terms of functional
and non-functional requirements (NFRs). Each factor has its own weight, and a value ranging from 0 to
5 is assigned to a factor, depending on the technical complexity of the corresponding factor. For example,
the technical factor related to the level of security requirements is given a weight of 1. If the security
requirements are complex, a high value of 5 is assigned to the factor yielding a weighted value of 5. The
smallest and largest possible values of TCF can be computed.
The EF is obtained using the equation: EF = 1.4 – (0.03 X ENVF)
Where ENVF is the sum of all the weighted values computed for each of the 8 environmental factors
listed in the table. Environmental factors are related to the people, process, and project aspects of the
software. Each factor has its own weight, and a value ranging from 0 to 5 is assigned to a factor,
depending on its relevance. For example, the stability of requirements is given the highest weight of 2
and if the requirements are felt to be volatile or not well-defined, a high value of 5 is assigned to it, making
the weighted value 10. The smallest and largest possible values of EF can be computed.
The equation to obtain the number of adjusted use case points (AUCP) is:
AUCP = (UAW + UUCW) X TCF X EF
To obtain the estimated effort in person-hours needed to develop the software according to the UCP
metrics, Kamer stated that 20 person-hours are needed or each use case point. However, other
refinements and empirical studies of the UCP technique suggested range between 15 and 30 person-
hours per UCP. Assuming we use p person-hours peer UCP and a work day of h hours, the number of
work days would then be: ((p X AUCP)/h) days.
In 1981, Barry Boehm[BOE81] introduced a hierarchy of software estimation models bearing the name
COCOMO, for Constructive Cost Model. It takes the following form:
Model 1. The Basic COCOMO model computes software development effort (and cost) as a function of
program size expressed in estimated lines of code.
Model 2. The Intermediate COCOMO model computes software development effort as a function of
program size and a set of “cost drivers” that include subjective assessments of product, hardware,
personnel, and project attributes.
Model 3. The Advanced COCOMO model incorporates all characteristics of the intermediate version
with an assessment of the cost driver’s impact on each step (analysis, design, etc.) of the software
engineering process.
The COCOMO models are defined for three classes of software projects: (1) organic mode – relatively
small, simple software projects in which small teams with good application experience work to a set of
less than rigid requirements; (2) semi-detached mode – an intermediate (in size and complexity)
software project in which teams with mixed experience levels must meet a mix of rigid and less than rigid
requirements (e.g. transaction processing system with fixed requirements for terminal hardware and
database software); (3) embedded mode – a software project that must be developed within a set of
tight hardware, software and operational constraints(e.g. flight control software for aircraft).
Table 3.0 Basic COCOMO model
Software Project Ab Bb Cb db
Organic 2.4 1.05 2.5 0.38
The effort estimate is used to compute for the project duration, following the above formula. The value
for project duration enables the planner to determine a recommended number of people for the project.
N = E/D
Where:
N is the recommended number of people for the project;
E is the effort estimate computed;
D is the project duration computed.
The Basic model is extended to consider a set of “cost driver attributes” [BOE81] that can be grouped
into four major categories: product attributes, hardware attributes, personnel attributes, and project
attributes. Each of the fifteen (15) attributes in these categories is rated on a six-point scale that ranges
from “very low” to “extra high” (in importance or value). Based on the rating, an effort multiplier is
determined from tables published by Boehm, and the product of all effort multipliers results is an Effort
Adjustment Factor(EAF). Typical values for EAF range from 0.9 to 1.4.
COCOMO represents a comprehensive empirical model for software estimation. However, “software cost
estimation model is doing well if it can estimate software development costs within 20% of actual costs,
70% of the time, and this is not as precise as we might like, but it is accurate enough to provide a good
deal of help in software engineering economic analysis and decision making”. [BOE81]
See https://www.geeksforgeeks.org/software-engineering-cocomo-model/.
See also http://athena.ecs.csus.edu/~buckley/CSc231_files/COCOMO.pdf.
COCOMO has evolved into a more comprehensive estimation model, called COCOMO II. Like its
predecessor, COCOMO II is actually a hierarchy of estimation models that address the following areas:
Application composition model. Used during the early stages of software engineering, when
prototyping of user interfaces, consideration of software and system interaction, assessment of
performance, and evaluation of technology maturity are paramount.
Early design stage model. Used once requirements have been stabilized and basic software
architecture has been established.
Post-architecture-stage model. Used during the construction of the software.
Like all estimation models for software, the COCOMO II models require sizing information. Three different
sizing options are available as part of the model hierarchy: object points, function points, and lines of
source code.
The COCOMO II application composition model uses object points . It should be noted that other, more
sophisticated estimation models (using FP and KLOC) are also available as part of COCOMO II.
Like function points , the object point is an indirect software measure that is computed using counts of
the number of (1) screens (at the user interface), (2) reports, and (3) components likely to be required to
build the application. Each object instance (e.g., a screen or report) is classified into one of three
complexity levels (i.e., simple, medium, or difficult) using criteria suggested by Boehm . In essence,
complexity is a function of the number and source of the client and server data tables that are required
to generate the screen or report and the number of views or sections presented as part of the screen or
report.
Once complexity is determined, the number of screens, reports, and components
are weighted The object point count is then determined by multiplying the original number of object
instances by the weighting factor and summing to obtain a total object point count. When component-
based development or general software reuse is to be applied, the percent of reuse (%reuse) is estimated
and the object point count is adjusted:
PROD = NOP/person-month
Once the productivity rate has been determined, an estimate of project effort can be derived as:
estimated effort = NOP/PROD
SUMMARY:
Although there are different estimation techniques, their common attributes are: Project scope must be
established in advance; software metrics (past measurements) is used as a basis from which estimates
are made; the project is broken into small pieces, which are estimated individually. Empirical estimation
techniques are used to provide reliable and accurate estimates of the software effort, schedule and cost.
However, it is recommended to use several estimation techniques and compare the results and apply
adjustments on the models used based on local conditions.
BOOK REFERENCE/S:
Software Engineering: A Practitioner’s Approach 7/e by Roger S. Pressman
ASSESSMENT:
1. Interview a software project manager who has completed a software project and collect software
metrics (LOC-oriented and FP-oriented) needed for the empirical estimation models discussed
above.
2. Using COCOMO, predict the project effort, cost and schedule requirements; and compare your
prediction with the actual project effort, schedule and cost. Discuss the difference.
3. Which do you think is more appropriate to use as metrics for effort, cost and schedule projection,
LOC-oriented or FP-oriented? Why?
4.6 PROJECT RISK MANAGEMENT
LEARNING OBJECTIVES:
At the end of this chapter you should be able to:
OVERVIEW:
One of the main reasons for the failures of software projects is the inability to deal adequately with both
anticipated and unanticipated problems occurring during the execution of the project. A software risk is a
problem occurring during the development of the software and the consequence of that problem.
Software project risk management encompasses activities that deal with the continuous identification,
classification, assessment, prioritization, avoidance, detection, and mitigation of software risks. The
ultimate goal of software risk management is to make timely and informed decisions and take appropriate
risk control actions when anticipated and unanticipated risks occur.
Project risks are technical and non-technical risks related to project management style, project plan, effort
estimation, risk planning, and project dependencies and constraints. Examples of technical project risks
are: (1) underestimation of effort for scheduled project activities, (2) inadequacy or lack of project
progress monitoring methods, (3) unavailability of third-party software when needed. Examples of non-
technical people-related project risks are: (1) lack of synergy among team members, (2) lack of
communication among various project stakeholders.
Identified risks must be well-documented and maintained. Each risk is assigned to an owner. The owner
is a developer who is responsible for following up on the planning, tracking, and control of the risk.
Risk Analysis
After identifying the risks, they must be assessed and verified for appropriateness and applicability. The
likelihood of their occurrence and their impacts on the project schedule, cost, and quality must be
evaluated either qualitatively or quantitatively. For example, in a qualitatively assessment, the likelihood
ranges from very low, low, medium, high, to very high. The risk impact ranges from negligible, minor,
tolerable, significant, to major. In a quantitative assessment, risk likelihood and risk impact are
continuous, and are used to compute risk exposure as follows:
Risk exposure = risk likelihood * risk impact
For example, the likelihood of a risk is 0.25 (or 25 percent), and its impact is the loss of PhP 100,000,
then the risk exposure is PhP 25,000. Based on the risk exposure, identified risks can then be assigned
priorities. A risk priority can be very low, low, medium, high, or very high. High exposure risks should be
dealt with thoroughly since they will likely be assigned a high priority. Many techniques can be used to
assess the risks and analyze them, including interviews and meeting with internal experts or consultants
in the application domain. A project risks table summarizing all project risks, their likelihoods, impacts
and exposures, can be used to view and sort the risks in order to prioritize them. A typical template for a
risks table is shown in Table 1.0.
Table 1.0 Template for a project risks table
Risk Risk Name Risk Likelihood Risk Impact Risk exposure = RL * RI Risk Priority
ID (RL) (RI)
Risk Planning
A risk response plan must be designed for every risk identified. A risk response plan aims at enhancing
the opportunities to counter the risk and to reduce the threats it poses to the project. The types of risk
actions are developed and prioritized. Risk actions include:
➢ Risk avoidance actions to prevent the risk from occurring. Examples are steps to improve
communications among team members and to increase by 20 percent the efforts estimated for
critical activities in the project schedule to deal with the risk of project delivery delays.
➢ Risk mitigation actions to reduce the risk impact should it occur. Timely and planned actions to
reduce the likelihood and impact of a risk are typically taken when the risk is unavoidable but its
impact could be costly. An example is the development of a disaster recovery plan to deal with
the risk of a natural or man-made disaster leading to the interruption of the project development
team.
➢ Risk acceptance, meaning no action is taken should the risk occur. Typically, very low-impact
and low-exposure risks are accepted and their costs are assumed without further actions.
➢ Risk transfer actions shift the responsibility of dealing with the risk and taking the appropriate
action to a third party should the risk occur. The third party could be an insurance company or a
financial institution. Risk transference is normally considered when dealing with non-technical
risks such as contracts, financing risks, and natural disasters.
The aim of a risk action is to reduce the risk exposure. The risk reduction leverage (RRL) can be
computed for every risk action as follows:
RRL= (Exposure before reduction – Exposure after reduction) / Risk action cost
For example, if a risk action costs PhP10,000 and reduces the risk exposure from PhP 500,000 to PhP
100,000, the RRL would be 40.
Risk Tracking
Risk tracking is an ongoing activity mainly based on the monitoring of the risks by continuously checking
the conditions for their occurrences. The proper implementation of risk actions is also monitored. Risk
tracking techniques include periodic risk status reports and the monitoring of key risk indicators. The early
detection of the imminence of a risk occurrence is desirable because it enhances the preparedness of
the team to initiate, implement, and control the risk actions planned earlier. Once a risk is realized, the
planned risk actions are activated to deal with that risk.
Risk Control
Risk control is part of the overall project control dealing with the proper implementation of the control
actions and risk plan. If corrections to the actions or to their implementations are needed, updates to the
risk management plan are made. Risk control involves risk reassessment, audits, and status meeting.
These risk control activities are normally needed when some identified risks are not being dealt with
according to plan or if the manager notices the occurrence of an unusual number of unanticipated risks.
Risk Communication
Risks are potential problems that have not been seen nor felt but may occur in the future. Risks in a
software development project that are identified, assessed, and planned for must be communicated to
the concerned stakeholders. To properly follow up and control risks, they must be communicated to
various units within the organization, to the appropriate levels of management, and to the client’s
organization. For example, the client must be aware of the risk related to changes to the requirements
and the consequences of such changes on the project schedule. A risk is typically identified by any project
stakeholder. The project manager will review the risk and check its validity. If it is found to be a relevant
risk, the risk is saved in the risk registry. The project review team would then review the risk and prescribe
the appropriate actions. The assigned risk owner (member of the project team) is then responsible for
implementing the risk actions.
A typical template for documenting a risk is shown in table 2.0.
Table 2.0. Template for a risk description
Risk ID
Risk description:
Risk stakeholders:
Risk likelihood: Risk impact: Risk priority:
Table 2.0 provides a formal risk description for each identified risk earlier identified and analyzed, that
should be communicated to concerned stakeholders. The risk likelihood should indicate whether the
probability of occurrence is low, medium or high. The risk impact should show whether the negative effect
on the project when the risk happens is low, medium or high. The risk priority should indicate whether
the risk is of low, medium or high priority for the project resources. The specified risk owner shall
implement the recommended risk actions.
SUMMARY:
Risks are problems that may not have been felt nor seen but may occur in the future; and when they do
occur, the will have an impact on the project cost and schedule. Software project risks may be related to
system elements, including information, people, hardware, and software; and may also be related to the
project management style, project plan, effort estimation, risk planning, and project dependencies and
constraints. All these risks should be properly identified and analyzed early on during the project initiation
phase. They should be properly documented, communicated and monitored as the project progresses;
and proper risk actions be implemented should they occur.
BOOK REFERENCE/S:
Software Engineering: A Practitioner’s Approach 7/e by Roger S. Pressman
ASSESSMENT:
1. For a simple information system developed for academic requirements, identify the project risks.
The software project may be hypothetical or may be an actual software project.
2. Create a project risks table, where risk analysis is performed for each identified project risk.
3. Create a formal risk description for each identified risk following the template provided in the
lesson.
5.1 PROBLEM ANALYSIS
LEARNING OBJECTIVES:
➢ Describe problem analysis as part of system analysis.
➢ Utilize problem analysis tools to correctly identify and analyze system problems
➢ Draw fishbone diagram to present analysis of an existing organizational or sectoral problem
OVERVIEW:
Every software development effort starts with analyzing a system problem that can be addressed by a
software solution. The software solution then becomes the computerized or automated system. This
process is called problem or root cause analysis. Hence, we can say that problem analysis is the first
step in systems analysis. It aims to dig the root causes or the ‘real’ problems that lead to the observed
symptoms or effects. The are available tools that can be used to analyze problem or root cause. One of
the widely used tools is the Fish Bone Diagram also called Ishikawa Diagram. The diagram illustrates the
observed effect (negative symptom) as a fish head and the factors that cause it as bone ribs.
Fishbone Diagrams (FBD) also known as cause and effect diagrams, and Ishikawa diagrams, are used
in process improvement methods to identify all of the contributing root causes likely to be causing a
problem. It was developed by Developed by Dr. Kaoru Ishikawa at the University of Tokyo in 1943.
Completed Fishbone diagram includes a central spine and several branches reminiscent of a fish
skeleton. It can be used on any type of problem, and can be tailored by the user to fit the circumstances.
The following questions should be answered when analyzing the FBD.
Root cause analysis is a structured team process that assists in identifying underlying factors or causes
of an adverse event or near-miss. Understanding the contributing factors or causes of a system failure
can help develop actions that sustain the correction. A cause and effect diagram, often called a “fishbone”
diagram, can help in brainstorming to identify possible causes of a problem and in sorting ideas into
useful categories. A fishbone diagram is a visual way to look at cause and effect. It is a more structured
approach than some other tools available for brainstorming causes of a problem (e.g., the Five Whys
tool, SWOT analysis, etc). The problem or effect is displayed at the head or mouth of the fish. Possible
contributing causes are listed on the smaller “bones” under various cause categories. A fishbone diagram
can be helpful in identifying possible causes for a problem that might not otherwise be considered by
directing the team to look at the categories and think of alternative causes. Include team members who
have personal knowledge of the processes and systems involved in the problem or event to be
investigated.
Directions:
The team using the fishbone diagram tool should carry out the steps listed below.
● Agree on the problem statement (also referred to as the effect). This is written at the mouth of the “fish.”
Be as clear and specific as you can about the problem. Beware of defining the problem in terms of a
solution (e.g., we need more of something).
● Agree on the major categories of causes of the problem (written as branches from the main arrow).
Major categories often include: equipment or supply factors, environmental factors,
rules/policy/procedure factors, and people/staff factors.
● Brainstorm all the possible causes of the problem. Ask “Why does this happen?” As each idea is given,
the facilitator writes the causal factor as a branch from the appropriate category (places it on the fishbone
diagram). Causes can be written in several places if they relate to several categories.
● Again ask “Why does this happen?” about each cause. Write sub-causes branching off the cause
branches.
● Continues to ask “Why?” and generate deeper levels of causes and continue organizing them under
related causes or categories. This will help you to identify and then address root causes to prevent future
problems.
Tips:
● Use the fishbone diagram tool to keep the team focused on the causes of the problem, rather than the
symptoms.
● Consider drawing your fish on a flip chart or large dry erase board.
● Make sure to leave enough space between the major categories on the diagram so that you can add
minor detailed causes later.
● When you are brainstorming causes, consider having team members write each cause on sticky notes,
going around the group asking each person for one cause. Continue going through the rounds, getting
more causes, until all ideas are exhausted.
● Encourage each person to participate in the brainstorming activity and to voice their own opinions.
● Note that the “five-whys” technique is often used in conjunction with the fishbone diagram – keep asking
why until you get to the root cause.
● To help identify the root causes from all the ideas generated, consider a multi-voting technique such
as having each team member identify the top three root causes. Ask each team member to place three
tally marks or colored sticky dots on the fishbone next to what they believe are the root causes that could
potentially be addressed.
The value of using the fishbone diagram is to dig deeper, to go beyond the initial incident report, to better
understand what in the organization’s systems and processes are causing the problem, so they can be
addressed. To create a Fishbone Diagram, you can use any of a variety of materials like a white board,
or a flip chart to get started. You may also want to use “Post It” notes to list possible causes but have the
ability to re-arrange the notes as the diagram develops. There are also several software packages that
can be useful in creating a Fishbone Diagram, including Microsoft Excel, EngineRoom for Excel and
EngineRoom software.
ASSESSMENTS:
1. Analyze the given examples and extract the steps in drawing and using the FBD
2. Following the guidelines, draw your own FBD for an existing organizational (or unit) problem or a
problem of a societal sector (people group). Evaluate if the root cause/problem can be addressed
by a computerized system.
3. If the problem can be addressed by a computerized/software solution, create a formal problem
and solution statement describing what you analyzed and the proposed solution on how the root
causes can be addressed by the software.
5.2 USER REQUIREMENTS ANALYSIS
LEARNING OBJECTIVES
➢ Create a product vision and project scope document
➢ Explain the difference between functional and non-functional requirements (NFRs)
➢ Explain the requirements engineering process steps
➢ Apply requirements elicitation techniques to identify functional and non-functional requirements
of a proposed software solution
➢ Develop a use case model of a proposed software solution
➢ Validate software requirements identified
➢ Write initial software requirements specifications (SRS) document using IEEE format
OVERVIEW:
The first phase of a typical software development process model is the software analysis phase which
focuses on the definition of what the software under development is supposed to do. Software analysis
involves defining the scope of the software project, capturing and documenting it’s users’ requirements,
knowing the various constraints that have to be met, and understanding the interfaces with external
systems, entities and users. The steps in software analysis involve the following: (1) project scope
definition; (2) user requirements analysis; (3) software requirements specification; (4) software
requirements review and validation.
READING MATERIALS:
Table 1 Template for a software product vision and project scope document
Title Page
Change History
Preface
Table of contents
Annexes
Index
After the project scope has been clearly defined, the next step is to build the analysis model by specifying
and documenting user requirements.
Elicitation Techniques
1. Interviews or questionnaires
2. Task analysis and scenarios
3. Preliminary requirements domain analysis
4. Brainstorming
5. Workshops, meetings, and/or observations
6. Ethnographic assessment
7. Practicing
8. prototyping
Interviewing. An informal technique that engages various participants, and is used to establish the
mission statement and goals of the system being developed; it can either be structured, unstructured, or
hybrid. Structured interview requires a set of questions prepared ahead of time and can be distributed to
the participants before the interview; whereas in unstructured interview, questions are developed
dynamically as the interview progresses. Hybrid interviews are formatted with a fixed set of questions
and impromptu questions asked during the interview.
Questionnaire/Survey. Is an instrument used to poll the participants and stakeholders and to obtain
their thoughts on the issues related to the system. The questions have to be clear, concise, and relevant;
and can be multiple choice, true and false, or open-ended questions (must be limited). The answers to
the questions can be used by the requirements engineer to identify initial conflicting requirements that
need to be resolved later.
Task Analysis. Is a technique based on the identification of the uses of the system and the description
of the interactions between the users and the system (scenarios or flow of events) .Task analysis can be
performed in a top-down manner in which initially high-level system tasks are identified, and then refined
into lower level tasks and sub-tasks for which scenarios have to be elicited. Task analysis requires
domain knowledge expertise and an understanding of the tasks performed by similar systems.
Preliminary requirement and domain analysis techniques. Starts from an initial set of requirements
proposed by the expert requirements engineer, and are passed to the various stakeholders for
discussion. In this case, the engineer must be an authority in the application domain.
Brainstorming. Are informal meetings in which stakeholders meet and discuss the various desirable
functionalities and services to be offered by the system, but is not meant to make decisions. All ideas are
encouraged and inventive ideas that might or might not be feasible are generated. The merits of the ideas
are discussed by the requirements analysts and other participants later in more formal settings. The end
product of a brainstorming session is an initial set of software requirements.
Group meeting. Are informal meetings that include all participants and stakeholders to interact at the
start of the elicitation process. Cohesiveness, openness, and transparency are the key communications
features during group meetings.
Requirements workshop. Formal setting used to elicit software requirements participated by a
facilitator, a technical writer, the requirements engineer and representatives from the client and user
group. The aim of a requirements workshop is to reach an agreement on a working draft of the software
requirements. The workshop must be prepared thoroughly ahead of time; expectations from each
participant must be explicitly known; the best case and worst case scenarios must be elicited.
Ethnographic assessment. Is used by the requirements engineer to gain a greater understanding of
the problem domain by being an active or passive participant in the working of similar systems and their
user interfaces. The engineer can go through the various scenarios and business flows, or he can just
observe the users’ activities without interference .
Prototyping. Is an effective tool for eliciting and validating requirements because of the client and users’
active participation in developing the software requirements through their inputs. The requirements
engineer, with possible inputs from the users, can develop an initial prototype of the system showing the
main elements of the system functionalities. The prototype is then evaluated and modified interactively
with the users’ inputs. Prototype-based requirements are faster to elicit and include fewer errors than
requirements developed using other elicitation techniques. However non-technical managers have the
tendency to consider them overhead and they are tempted to use them as a basis for building actual
systems, or they might be misled to conclude that the project is nearly complete.
The exact combination of requirements elicitation techniques used depends on several factors, among
which are the type and size of system being developed, and the expertise of the requirements engineer.
An actor is a role that a user plays in the system. It is important to distinguish between a user and an
actor (better thought of as a role). A user of the system may play several different roles through the
course of his, her or its job (since an actor may be another system). Examples of actors are salesperson,
manager, support person, and web store system. It is possible that the same person may be a sales
person and also provide support. When creating a use case model, we are not concerned with the
individuals, only the roles that they play. An Actor is any external entity that makes use of the system
being modeled. This means that any person, device or external system that have access to, or make use
of the information and functions present in the system being modeled can be considered an actor.
A use case is a complete functional unit that is offered by the system being modeled. A use case must
primarily satisfy some functional requirements. The functional requirements are listed as the steps
followed in the use case; and typically, five to seven steps are included in a use case. In addition, a use
case might have to meet certain constraints or NFRs.
A use case is represented by an oval with the use case name inside it. A use case is normally described
using a verb and a noun. The verb identifies what is being done and the noun identifies to what entity the
verb applies to. An actor, interacting with the use case, is linked with that use case. An actor is
represented with a stickman with the unique actor name next to it. A line represents the fact that the
actor and use case communicates. An optional directed line with an arrow pointing at the use case
indicates that the actor initiates or triggers the communication with the use case, to request a service
through that use case. A plain line indicates a two-way communication between the actor and the use
case, whereby the actor initiates or triggers the communication with the use case to request a service
through that use case; and the use case communicates with the actor to prompt the actor for input or a
decision, or to inform the actor of events or decisions made by the system. An actor can communicate
with several use cases and many actors can communicate with a single use case.
Within use cases there are a number of relationships that can be modeled:
Association Relationship
On a use case diagram, associations are drawn between actors and use cases to show that an actor
carries out a use case. A use case can be carried out by many actors and an actor may carry out many
use cases.
In the diagram below, the actors are shown as the green stick figure shapes on the left, the use cases
are the blue ellipses, and the associations between them are represented by the connecting lines. The
interaction between the actors and the use cases is called association relationship. In the example
below, both the developer and the stakeholder are responsible for specifying the system roles, but only
the developer creates the model.
Use cases can also be related to each other with three different links that represent their relationships:
(1) includes, (2) extends, and (3) generalization links.
Generalization Relationship
When a use case describes a variation on another use case, use a generalization link. In the example
below, the use case limit exceeded describes a situation in which the usual scenario of online purchase
is not performed. Use cases that generalize another use case should only specify an alternative, even
exceptional scenario to the use case being generalized. The overall goal of the use cases should be the
same.
Includes Relationship
To reduce the complexity of a use case, the requirements analyst breaks down a complex use case into
smaller ones by factoring out some behavior from the original use case and then include that behavior in
a new use case. The original use case and the newly created one are then linked using the include
relationship. It is represented by a dashed arrow starting from the original use case and ending at the
new use case. The diagram below shows the use of the includes link. Both invoice purchase and online
purchase include the scenarios defined by purchase valuation. In general, the includes link is used to
avoid repetition of scenarios in multiple use cases.
Extends Relationship
Another way of reducing the complexity of a use case is by factoring out all the behaviors that deal with
either exceptional or abnormal conditions or optional behaviors. In this case, you would want to describe
a variation on behavior in a more controlled form. Exceptional or abnormal behaviors normally interrupt
the progress of the original use case; examples of which include timeout or failures occurring during the
progress of the original use case (also called base use case) or cancelling the use case execution.
Optional behaviors can be selected by one or more of the use case actors during the progress of the
original use case; an example of which is seeking help during the progress of the original use case. In
such instances you can define extension points in the extended use case. In the example below, search
by name is said to extend search at the name extension point. The extends link is more controlled than
the generalization link in that functionality can only be added at the extension points. The extends
relationship is represented by a dashed arrow starting from each newly created use case to the original
use case.
Another advantage of recognizing the common behaviors and using them in include and extend
relationships and including them in separate use cases is the possibility of reusing them in the same
requirements or in future requirements specifications. Hence, each use case in the use case model need
to be fully described and documented showing its detailed specifications. A typical way for describing
and documenting a use case is shown in Table 3.2.
Identification UCx
Date created
Updated by
Date of update
Brief description This use case is started by the buyer to construct electronic basket
with books selected from the catalogue
Postconditions Electronic basket is created and closed prior to placing the order
Priority High
Frequency of use High (one hundred orders per day during the first year)
Alternative flows Use case can be interrupted at any point by the use cases E1 to E7.
Use case is discontinued when interrupted by the use cases: E1 to
E4. However, the use case continues after being interrupted by use
cases E5 to E7.
Modify order
Clear order
Save order
Send order
To illustrate use case modeling, consider the following business scenario in Example 3.1:
Example 3.1
A student has to compile a course schedule for a semester. In order to do this, the student has to register
for two primary courses and four secondary courses. The faculty wants all tasks to be automated within a
system in such a way that the students can compile their course schedules on their own by using only the
system. To this end they have tasked a business analyst to model the business scenario for them.
To compile a use case model the business analyst has to identify the actors and use cases involved in the
system. To start - the actors defined are the students who will register. This also leads to the obvious
functionality; that of being able to register for a course.
In order to register for the courses the students will need to reference a list of courses available. Such lists
are already available from an existing system: the course catalog system. As it does not form a part of our
current system, it can be considered an external entity and as such are modeled as an actor.
In digging through the requirement, the business analyst is informed that the processes for registering for
primary and secondary courses are subtly different. This necessitates the definition of two different
functions: Register primary course and Register secondary course. Once all courses are registered the
student has to be able print out the course schedule, although this requirement is an optional function.
A meeting with the faculty reminds the business analyst that the system has to have the ability for students
to to log in with their different user identification codes to be able to create course schedules. This
immediately highlights the requirement for the students to be created as a user and some sort of
administrator to administer the user identifications. All use of functions in the system must also be logged
via the mechanism of an audit trail.
(Note. The Administrator must be able to log in as well in order to create the users of the system. We can
handle this in two ways: The administrator may have an association with the Login function, or a
generalized actor may be created: Registered user, who will have common characteristics to both
Student and Administrator, but each of the specialized actor will have behavior that is unique to them.)
Step three. Model the relationships where the users (actors) will use functionality (use cases) as follows:
Actor : Registered user
Use case : Login system
Relationship : Association - The registered user will make use of the functionality of this use case.
This implies that the Administrator role and the Student role will use this function via the Generalization
relationship with Registered user.
Actor : Student
Use case : Register course
Relationship : Association - The Student is associated with the use of this use case (Register
course).
Actor : Administrator
Use case : Register user
Relationship : Association - The Administrator is associated with the use of this use case
(Register user).
Performance Installation
Reliability Maintainability
Availability Operability
Robustness Portability
Security Reusability
Safety Scalability
Usability Testability
Political
Normally, non-technical NFRs are generic, such as standards conformity requirements that are system-
wide requirements. On the other hand, technical NFRs can be either system-specific or use-case specific.
For example, various performance requirements can be attached to multiple use cases. As evident in the
discussions in the beginning chapters, some of the NFRs can be considered software quality attributes
that are mainly of interest to the developer but can have a tangible impact on the users. NFRs are
essentially technology-independent and must not attempt to prescribe or impose a technical solution.
Technical NFRs
To elicit technical NFRs, the analyst, client, and user must work together to consider each type of
requirement thoroughly. One approach is to first consider the types of requirements that are mostly
system-wide requirements such as usability and maintainability requirements. Then, proceed to those
requirement types that can be partly use case dependent, such as security and performance. In this way,
the rework of the requirements from generic to specific ones is minimized.
Interoperability requirements impose constraints on the types of systems (hardware or software) with
which the software has to interface. An example of interoperability requirement statement: The system
must be able to interface with all printers manufactured by ABC Company. This imposes some
dependability on the proper specification and implementation of the interface with the printers. The
requirements are indicative of some potential external risks to the development process.
Maintainability requirements impose constraints related to the ease with which the software can be
fixed, adapted to new environments and technologies, or expanded. To meet the requirements, there can
be various technical and non-technical measures that need to be taken. Technical measures are related
to the development environment and tools used as well as the development methodologies and models
adopted. Non-technical measures include hiring decisions and appropriate developers training program.
Operational requirements impose constraints on both the physical and logical environments in which the
software under development will operate, such as: characteristics in which the servers are physically
located, minimum speed of the network connections, the operating systems that are compatible, and the
hardware devices with which the software interfaces.
Performance requirements impose some technical constraints on the response time delays, throughput
of the system, and memory requirements. Response time delays can be either system-wide, (for
example, putting an upper limit on the maximum response time delay for all system functions) or use
case-specific (requiring different upper limits, depending on the individual function or use case). Similarly,
throughput requirements can be either system-wide or use case-specific. A throughput-based use case-
specific performance requirement might be: The maximum memory needed to run the system shall not
exceed 2MB of RAM.
Portability requirements impose some conditions related to the future deployment of the software
system. An example would be: The system should be able to run under Android OS with the least
development effort. To meet this requirement, many constraints related to the development environment
and the implementation programming language used have to be imposed.
Reliability requirements impose some values related to the reliability of the software such as : mean
time between failures (MTBF) or the maximum time allowed for failures over a period of time. Imposing
an upper limit on the downtime of the software, indicating an acceptable level of failures can be
considered availability requirement which is part of security requirements discussed later.
Reusability requirements impose constraints on the development of the system related to the degree of
reuse. There are two types of reuse: development with reuse and development for reuse. Development
with reuse aims at developing software faster by using existing software components. Components that
are of good quality also help the reliability of the overall system. Development for reuse aims at producing
highly maintainable software that is typically made use of reusable components that can be reused in
future projects by the same team or other development teams. A development for reuse requirement help
the maintainability of the software system and can impose specific decisions related to the software
development methodologies used (i.e. object-oriented or component-based methods and development
tools only)
Robustness requirements impose constraints related to the way the software handles abnormal and
erroneous inputs and operational conditions. They address the software behavior with respect to error
recoverability and fault tolerance and can be system-wide or use case-specific. An example of a system-
wide robustness requirement is: The system must recover from power failures and continue operating
without any side effects on the currently executing transactions. An example of a use-case specific
requirement is: Completing the Create Supplier use case shall be guaranteed even in the case of a
database server failure. Robustness requirements should not state how to achieve software robustness
or suggest a particular technological solution to do it.
Safety requirements are needed when the software being developed deals with safety-critical issues
such as aviation software or power and chemical plants control software. The safety requirements must
address and require the enforcement of safety standards that are known in the particular application
domain. An example of safety requirements statement is: In the case of software failure, a safety
procedure XYZ must be activated immediately to ensure no chemical leakage takes place.
Scalability requirements impose constraints on how the software system should scale up to a high-input
load at all interfaces. An example scalability requirement might be: The system must be able to
accommodate a maximum of 150 users logged on and performing all types of transactions. This
requirement can force specific architectural design (implementation and deployment) choices on the
development team. Scalability requirements are quantifiable and are normally verified during load testing
(See chapter on Testing).
Security requirements are critical and need to be identified early in the software development process.
The four main security concerns are: (1) confidentiality, (2) integrity, (3) availability, and (4) accountability.
Confidentiality requirements are access-control related requirements that include identification,
authentication, authorization and physical protection; which can be either system-wide or use case-
specific. The client can require that certain functionalities (or physical elements) are only accessible by
identified, authenticated, and authorized users, and other functionalities (or physical elements) can be
publicly and unanimously accessible.
Integrity concerns are addressed using integrity, immunity, and privacy requirements. An
example of privacy requirement statement is: The software shall allow a registered user to have control
over its own private information. An immunity requirement might state that no files can be attached to a
customer profile without being disinfected with the software. An integrity requirement can be either
system-wide or use case-specific. An example of a system-wide integrity requirement might state that all
files saved by the software must be tamperproof so that any malicious and unauthorized modification of
a file shall be detected.
Availability issues are dealt with using the survivability and physical protection requirements. A
survivability requirement can be applicable system-wide, such as the system shall continue to provide its
own functions even if one node fails. It can also be a function-specific or use case-specific, for example:
the User Validation shall always be performed regardless of some network nodes failures. A physical
protection requirement that addresses availability concerns might state that the database servers shall
be protected in fireproof data centers.
Accountability concerns are dealt with using non-repudiation and standards conformity
requirements. An example of a non-repudiation requirement is: the software shall preserve a tamper-
proof record of every privileged access to the system. Accountability requirements can be either system-
wide or applicable to specific use functions or use cases. Standards conformity requirements are normally
system-wide. An example of a standards conformity requirement could be: the software and the
environment in which it operates shall conform to the ISO 17799 standard.
Although security requirements are considered to be NFRs, some of them must be implemented by first
identifying the appropriate security-related functional requirements. For example, identification,
authentication, and authorization requirements are considered by introducing a Logon use case as a
functional requirement. Other researchers have introduced the idea of a misuse case in which the
involved actors are called misusers. A misuse case represents the abnormal behavior of an attacker or
misuser and specifies the software reaction to the specified misuse.
Testability requirements impose constraints on the future testing of the developed software. Testability
is defined as the ease with which testing can be performed, leading to the ease of maintenance (applying
changes); these two are positively correlated. Ideally, this requirement is quantifiable. An example of
testability requirement is: testing the software must be completed in 36 hours. This requirement imposes
some constraints on the test automation and the tools used for testing, considering the testing time
constraint given.
Traceability requirements impose constraints on the ease with which the software is traceable. This
requirement has two types: (1) traceability of the different parts of the software development process
deliverable; (2) traceability of the software during its execution. The first type refers to the ability to link
every aspect of software deliverables forward and backward. For example, each module in the software
design can be traced backward to a requirement specifications document, or forward to a particular piece
of code or test cases, enhancing the software maintainability (maintainability requirement). An example
of statement for this type is : functional requirements must be traced forward in the design, code and
testing documents. In the second type, traces collected during the execution of the software, for testing
and debugging purposes, thus, enhancing the software testability and help meet the auditability and non-
repudiation aspects of security requirements. Example statement for this type is: all activities of an admin
user session must be recorded by the system.
Usability requirements address the constraints imposed by the client with regards to the user community,
the objective of which is to make the software easy to use by the various users interacting with it. These
requirements are normally elicited by first knowing the intended users and their backgrounds and
characteristics. Example of a system-wide usability requirement states that: the software must be easy
to use by 7- to -9 year-old children. A use case-specific quantifiable usability requirement could be: eighty
percent of students between ages 10 and 14 must be able to create a demo within thirty minutes.
User-friendliness requirements impose constraints on the user experiences when interacting with the
software; these requirements can have implications on the functional requirements and the graphical
user interface design decisions. The availability of context-sensitive help versus generic help, a forgiving
and courteous interface, and the ease of navigability are examples of user-friendliness requirements.
Usability and user-friendliness requirements complement each other and are often seen as equivalent
because ideally, a highly-usable system is normally a user-friendly system; although that is not always
the case.
Non-technical NFRs
These requirements are normally system-wide. However, it is possible to have a system with two types
of users, admin users and normal users, with cultural requirements imposed only on normal users.
Cultural and political requirements address the cultural and political constraints that have to be
considered when developing the software. The analyst and client must be aware of the cultural
sensitivities of the countries in which the software will be deployed and used; such as language use, use
of symbols, and politically offensive contents. Failure to properly elicit the requirements can affect its
acceptability and market penetration and thus, several other versions of the software might have to be
developed and deployed.
Legal and regulatory requirements address the legal and regulatory issues related to the software.
The software and the software process by which it is developed should adhere to local and international
laws. For example, for national security concerns, the development team must not include people that
have resided in certain countries. Other requirement might be that the software is in line with copyright
law and regulations. If overlooked, the requirements can lead to lawsuits and criminal investigations
affecting the economic feasibility and reputation of the development company.
Standards conformity requirements indicate the standards that must be followed while developing the
software. Internal standards that are developed by the software development company can include
coding, testing, and documentation standards and templates. The developer and client must be aware of
specific country standards that might have to be followed. If the military is one of the software
stakeholders, military standards exists and need to be followed. Industry-specific standards exist for
health, finance, construction, and education sectors, among others. Professional standards can also be
referred to such as the IEEE standard for developing Software Requirements Specifications (SRSs).
International standards, such as those developed by International Standard Organization (ISO) and
International Telecommunications Union (ITU) can also be used as part of the standard conformity
requirements. Non-adherence to known and relevant standards and the failure to meet them can lead to
unusable software or a delayed release of the software.
NFRs can be documented separately in the software requirement document if they are generic but if they
are specific to a particular use case, they can be attached to the use case description thru the constraints
section.
Requirements Validation
After specifying all requirements, they must be validated prior to refining them The requirements
validation process cannot be automated and so the most effective way of validating requirements is by
using good communication skills, both verbal and written, for eliciting and reviewing requirements. Ideally,
requirements, specially the NFRs, should be quantifiable. When writing requirements, the requirements
engineer must make sure that the produced requirements possess good qualities.
• Completeness • Testability
• Non-ambiguity • Verifiability
• Consistency • Reusability
Correctness. Requirements, when implemented, should reflect the behavior expected by its users.
Completeness. Requirements should consider all functional and non-functional aspects of all tasks
expected to be performed by all its users.
Clarity and comprehensibility. Requirements should allow all stakeholders to understand them and,
consequently, to pass an informed judgment on their correctness.
Non-ambiguity. Requirements should have a unique (single) interpretation by all its stakeholders.
Consistency. One requirement should not impose some restrictions that conflict with other requirements
and affect their validity as mostly in the case of NFRs. For example, a usability requirement can be in
conflict with performance requirement.
Feasibility. Requirements must be implemented using the available time and technology (technical
feasibility), and the requirements’ automation or inclusion within the system must be financially rewarding
(economic feasibility).
Modifiability and maintainability. Requirements must be documented in a structured and well-
presented manner.
Testability. Requirements must support testing in a given test context. Requirements, in order to be
testable, need to be consistent, complete, unambiguous, quantitative, and verifiable in practice (even
with limited resources).
Traceability. Requirements must be easily identified and referenced; and the origins must be known.
Verifiability. Once implemented in the system, checking whether the requirement is met, must be
feasibly verified either manually or automatically.
Reusability. Requirements must be written or documented in a way that helps its reuse in future software
projects.
Ranking for importance and criticality. A requirement must be ranked for its importance for the
success of the current version of the software under development. A requirement must also be ranked
for its criticality with respect to the levels of risks that can hinder its fulfillment.
Approaches in Requirements Validation
Requirements are validated using two approaches: (1) synthetically or constructively during their
development; and (2) analytically after having been developed. These two complement each other and
there is a need to use both of them to ensure good quality requirements. In the synthetic approach, the
process by which requirements have been obtained must be structured in a way to eliminate or minimize
requirements errors with the use of industry-proven guidelines, templates and standards, and elicitation,
formal specification, and prototyping techniques. It involves some degree of automation but still relies on
human interactions. Once the requirements are developed, analytic validation techniques must follow.
The analytical approach is based on requirements inspection and walkthrough processes. The
processes are used to ensure the various desirable properties of requirements, including correctness,
completeness, non-ambiguity, clarity, feasibility, modifiability, and verifiability. The efficiency and
effectiveness of the processes rely on the traceability of the requirements and the comprehensiveness
and thoroughness of the checklist used during the inspection and walkthrough process.
Requirements Maintenance
Requirements can be subject to varying types of maintenance activities. While in the specification and
design phases of software development, the developer might discover that the requirements are
incomplete, ambiguous or contradictory. The requirements errors must be dealt with before continuing
the development, by coordinating with the originator of the requirements document, who in turn has to
coordinate with the users’ or clients’ representative. If the errors have serious implications to the project
plan, the upper management and the project leader must intervene to avoid delays in the planned project
deadlines.
After the software is released, the user population might report many errors; and some might be caused
by requirements and specification errors that were not caught during development. At times, new
requirements can be requested by the client and users.
In addition to requirements change, sometimes the priority of requirements must be changed as a result
of changes to the project scope. This will have an implication to the software features and functionalities
that will be available in the current and future releases of the software.
Because changes to the requirements can have serious implication to project scope and the deliverable
deadlines, requests for requirement changes and their approvals should be made in a formal manner in
the form of a formal change request procedure, and must be considered an integral part of a change
management plan normally included in a comprehensive software project plan.
Title Page
Change History
Preface
Table of Contents
1. Introduction
1.1 Purpose and intended audience
1.2 Scope
1.3 Definitions, acronyms, and abbreviations
1.4 References
1.5 Overview of the document
2. Overall description
2.1 Product perspectives and context
2.1.1 System interfaces
2.1.2 User interfaces
2.1.3 Hardware and software interfaces
2.1.4 Communications interfaces
2.1.5 Memory constraints
2.1.6 Operational context
2.2 Product functions
2.3 User characteristics
2.4 General development constraints
2.5 Project assumptions and dependencies
3. Specific requirements
3.1 external interfaces
3.2 functional requirements
3.3 performance requirements
3.4 database requirements
3.5 design constraints and standards compliance
3.6 software system attributes (non-functional requirements)
4. Supporting information
4.1 Appendices
4.2 Index
The SRS document produced as a result of requirements phase are user-centered, and is normally used
as a legal contract between the developers and the client representing the users. It is also used to develop
the software acceptance criteria described in the acceptance test plan. Because of this, it is written by
the development team in simple technical terms that are understandable by the users.
SUMMARY
Software analysis is the first phase of a typical software development process model. It includes both the
software requirements stage (gathering and identification of user requirements), and the requirements
specification stage (modeling software requirements). This chapter discusses the software requirements
stage of the software analysis phase, while the specification stage is studied in detail in the next chapter.
Obtaining proper software requirements is an important and crucial task in a software development
project because requirements are the foundation upon which a software architecture and design is
developed. Along with a well-defined product vision and project scope document, a well-defined software
requirements engineering process must be used to produce software requirements. A typical requirement
engineering process starts with requirements elicitation. Requirements elicitation helps to capture, invent,
and discover the software requirements. Different elicitation techniques can be used depending on the
complexity of the target product to be developed. A requirements model based on the use case modeling
approach can be developed and documented.
There are two types of requirements, functional and non-functional. Functional requirements are related
to the visible, user-interface-driven functions to be provided by the software. NFRs are mainly quality
requirements related to the attributes of the offered functionalities, and can be product-wide or function-
specific.
Once developed, requirements must be reviewed and validated. Requirements prototyping is a useful
method to obtain an approval on software requirements. Requirements management is also an important
and often overlooked process that allows for the proper handling and maintenance of requirements. Once
software requirements are obtained, they can be explained further using software specification
techniques that will be discussed in the next chapter. The outcomes of the software analysis phase,
including both requirements and specifications, can be documented using a recommended IEEE
standard format for SRS.
ASSESSMENTS:
1. Create a Software Product Vision and Scope Document (IEEE format) for the software solution
you have identified from the previous activity.
2. Identify the functional and non-functional user requirements for the proposed software solution;
and using appropriate approaches in requirements validation, validate the requirements utilizing
IEEE’s standard desirable qualities of requirements.
3. Document the requirements using the IEEE SRS template.
4. Present your outputs and discuss your most significant learnings from the topics and activities.
5.3 SOFTWARE SPECIFICATION
LEARNING OBJECTIVES:
➢ Describe the different process specification techniques
➢ Describe the different data specification techniques
➢ Describe the different behavior specification techniques
➢ Model software structural, architectural, and behavioral requirements using object-oriented
modeling tools
➢ Produce a detailed software requirements specification document using IEEE format.
OVERVIEW:
In the software analysis phase of the software development life cycle, software specification follows after
user requirements are elicited and analyzed. Software specification uses appropriate and relevant
analysis techniques to bridge the gap between the user-centered software requirements specification
(SRS) and the developer-centered software design. The deliverable of this stage is either a separate
software specification document or a more refined SRS document that shows more technical details. The
SRS document produced as a result of requirements phase are user-centered, and is normally used as
a legal contract between the developers and the client representing the users. It is also used to develop
the software acceptance criteria described in the acceptance test plan. It is written by the development
team in simple technical terms that are understandable by the users. Others call this user-oriented
document, software requirements definition. The deliverables of the software analysis phase are used by
software designers to produce an appropriate software design. Before we proceed to software design, it
is important to provide technical analysis of the software requirements that is more detailed and refined.
The software specification phase is mainly the process of refinement and elaboration on the user-
centered requirements specifications to produce more technical details, thus allowing designers a more
sound and formal idea about what the software under development is supposed to do. Consequently,
designers can make better design choices and, more importantly, correct design decisions. Ideally, the
software specification document allows for a better understanding of the software requirements by
modeling the (1) behavioral, (2) data, and (3) processing aspects needed to meet the requirements. The
behavioral and process aspects provide a dynamic view of the system. The behavioral aspect
concentrates on describing the changes in internal and external states of the software system as a result
of handling either internal or external inputs. The process aspect concentrates on the description of
what the software processes do to the incoming internal or external data. The data aspect provides a
static view of the system. It concentrates on the data requirements needed for the system to deliver its
intended functions. Requirements modeling techniques offer important tools for describing, visualizing,
analyzing, and verifying the requirements before proceeding with design.
READING MATERIALS:
Process Modeling
There are tools that can be used to model the software’s process as well as the data. When the
process model adapted is procedural approach (in contrast to object-oriented approach), a
proposed software solution’s process and data are modeled using structured tools.
Level Balancing
➢ Child diagram must have exactly the same data flows as the parent i.e. there is a balance
in data content
➢ 2 ways to balance data content
o If exactly the same data flows are present in the child then the levels are balanced
o If net data content is the same, there is balancing (Wu & Wu, Fig 9-18)
➢ Data stores need not balance - they may be concealed as “unnecessary detail” at a higher
level
Physical Process
➢ processes that use a physical object - e.g. “membership card” is physical, “member
details” is logical
➢ process that performs data entry - e.g. “key in payroll data”
➢ processes that only transmit data - e.g. “Send paycheque” is physical
➢ processes that rearrange data - e.g. sort paycheque
Modeling the Proposed System
➢ Model the existing system using DFDs - include physical features
➢ Remove physical aspects
➢ Modify the logical DFDs in 2, to show the new system
➢ Examine the logical DFDs and determine how each part can be implemented
➢ Produce a set of physical DFD’s
Data Modeling
The behavioral aspects of the software systems requirements can be modeled using different techniques
such as: (1) finite state machine (FSM) model and its extensions, (2) Petri net (PN) model and its
extensions, the (3) activity diagram of the UML, and (4) state chart diagram of the UML. Each of these
modeling techniques has its own expressive power and limitations. It is up to the software analyst to
choose the technique that seems relevant and appropriate to the software requirement to model. The
activity diagram and state chart diagram are behavioral models under the object-oriented analysis (OOA)
approach, whereas the Finite State Machine and Petri net are more traditional behavior modeling tools.
Formally, an FSM modeling process is described by a 6-tuple M = (S, ∑1, ∑0, Ω, T, S0), where:
This machine is also known as Mealy machine in which the output is a partial function of the current
state and the input applied at that state.
There are three alternative and equivalent representations of an FSM: (1) graphical, (2) algebraic, and
(3) tabular. FSM can be represented graphically as follows: a circle represents a state. A directed edge
between two states S1 and S2, also called a transition, represents a transition from S1 and S2. A label on
the transition from S1 to S2 of the form i/o, indicates that when the input i € ∑1 arrives while at state S1, an
output o € ∑0 is generated and the process moves to state S2. It is also possible to have transitions
occurring spontaneously or triggered after the elapse of time or the occurrence of a timeout. In this case,
the input i is represented by ∑1 indicating that no input is needed for the transition to occur. Similarly, in
a transition that does not produce any output, the output o in the label is represented by ∑ 0 indicating
that no output is needed. Consider the example below:
a/0
a/1
c/1
S
1
Figure 4.2 Graphical representation of FSM M
An FSM can also be represented in tabular form. A two-dimensional table will have n rows and n columns,
where n is the finite number of states in S, also called the cardinality of S. Each cell in the n X n table
represents a transition from Si to Sj denoted by (Si, Sj). A table cell includes the label i/o for that transition.
If no transition from Si to Sj exists, the corresponding cell will include -. The tabular representation of the
FSM M is shown in Table 4.1.
An alternative representation is to have an n x m table in which n is the number of states and m is the
number of possible inputs. In this case, a cell shows the next state reached and the output generated.
Table 4.2 illustrates the alternative table for the FSM representation in Example 4.1.
Table 4.2 Alternative tabular representation of the FSM M shown in Figure 4.2
S/Input A B C -
s0 s2, 1 - - -
s1 - - s0, 1 s2, 0
s2 s1, 1 s2, - /- -
Completeness
The FSM should be completely specified, or in other words, the FSM should be able to react to every
input at every state. The FSM in Example 4.1 is not complete because at state S0 it is not specified what
to do if input arrives while at this state. In a tabular form, an FSM is incomplete if a cell includes – or Ф
exists in the table. A complete specifications allows the implementation of a robust process – a process
capable of dealing with both correct and incorrect inputs.
Determinism
The FSM is deterministic if, and only if, at any state, the reaction to the input is unique and unambiguously
determined; meaning for the same input, the FSM should move to the next state and should deliver the
same output anytime it executes. The FSM in Example 4.1 is deterministic because there are no distinct
transitions with the same input at any given state. A software implementation must be deterministic
because a user, at the same state, would like to obtain the same result any time the same request (input)
is present. (For the Extended FSM, a model is deterministic if at the same state, for the same input, and
the same predicate, the same transition (next state and output) must always occur).
Strong connectedness
An FSM is strongly connected if from any state we can reach any other state immediately by executing
one or more transitions. The FSM in Example 4.1 is strongly connected because any state is reachable
from any other state in the FSM. A state that is not reachable from any other state means that the process
is somehow disconnected or discontinued; therefore, the unreachable part of the process is useless.
Normally, in a user-driven interface any situation (state or screen) must be reached somehow at one
point, and we should be able to get out of that state or screen.
Minimality
An FSM is said to be minimal if there exists no other equivalent FSM with fewer numbers of states or
transitions. Implementing a non-minimal FSM for software and digital systems implies wasting
development efforts on a non reduced and somehow redundant specification (assuming that all
transitions are of equal complexity).
The basic FSM model is unable to describe certain process behavior requirements such as timing and
timeout specifications, conditional transitions, variable or data manipulation, and concurrency
specifications.
Conditional transitions
Suppose that at a given state of the FSM we would like to specify that in addition to the availability of an
input symbol, certain predicate(s) should evaluate to true for the transition to take place. A predicate is a
Boolean function P: X → {True, False},where X is an arbitrary set, and P is said to be a predicate on X.
We would like to have certain predicated or conditional transitions. In addition to the correct input at the
source state of a conditional transition ( for the basic FSM model), there has to be a predicate specified
for this transition which is evaluated; then the transition would take place only if the predicate evaluates
to true.
Variable condition
Suppose that a given state of the FSM, the reaction to the next input symbol, must change a certain
variable value, which is critically needed in future transitions (for example in a predicate evaluation). For
example, in a user-interface driven process, at the logon state, the reaction to a bad login input can
depend on the number of times a bad login input was performed earlier. Therefore, a variable holding a
counter of the number of bad logins is needed.
Concurrency specification
Due to its inherently sequential nature, a basic FSM cannot model concurrent behaviors that can be
needed to describe complex concurrent applications. The UML statechart diagram can be an extension
to this model with the specification of concurrent substates.
The extended finite state machine (EFSM) model can overcome the limitations of FSM on timing and
timeout constraints, conditional transitions, and variable condition with the introduction of the formal
definition of EFSM by an 8-tuple M = (S, ∑1, ∑0, Ω, V, T, S0, V0) where:
In the EFSM model, the transition function determines for each transition:
• Predicate, if any is needed, that must be evaluated to true
• Time delay, if any, that must elapse before the transition takes place
• Changes to the variable values that must be performed when the transition occurs
However, when a time delay is specified for a transition, no input symbol should exist in the corresponding
transition specification.
As a result of the modification to the basic FSM model, a cell in the tabular representation of the ESFM
can contain more than one entry. For example, from state Si to Sj, as shown in Figure 4.3, we can have
a delayed transition and one or more conditional or predicated transitions. Also, in an EFSM graphical
representation, the time delay, the predicate, and f(v) can be added to the label of the appropriate
transition.
Sj
.
.
.
The EFSM model is a powerful model for describing complex software systems such as a graphical user
interface, telephone systems interaction, programming language parser, communications protocols, and
many more types of software systems. Consider the GUI as a process with deterministic behavior. The
set of states typically correspond to the set of screens, inputs include all those possible input to the
screens; outputs correspond to the distinct outcomes from the system, including voice messages, control
signals, warning messages, error messages, help messages, and printed logs. In a communications
protocol specification, each protocol entity or participating machine can be described by an ESFM. A
global state of the distributed system is composed of the individual states of each FSM and the content
of the communications channels between the communicating FSMs. The initial global state is when each
FSM is at its initial state and all channels are empty.
Petri Nets were first introduced by Carl Petri in 1963. A PN provides a powerful modeling technique with
a strong mathematical foundation which facilitates the verification of the model properties. It can be
represented mathematically and graphically.
Mathematical Representation
If we order the set P and T, then the functions of F and B can be represented by p X t matrices. n1 arcs
exists from transition ti to place pk, if and only if, B(pk, ti) = n1. Also, n2 arcs exist from place p1 to transition
tj if, and only if, F(p1, tj) = n2. Finally, M0 is a p X 1 vector, called initial marking of the PN, representing
the initial mapping of tokens where M0(p) = n is represented by n tokens in place p. A marking M can be
considered as one state of the net. Marking M0 denotes the initial state of the net. The definition of B
implies that if no arcs exist from ti to pj, B[pj, ti] will be 0. Similarly, if no arcs exist from pi to tj, F[pi, tj] will
be 0.
Graphical Representation
The initial distribution of tokens, in M0, among the many places of the net is a choice that depends on the
initial state of the system we are modeling. In Figure 4.7, t1 and t2 are transitions and p1, p2, andp3 are
places. Arc a is a forward arc while arc b is a backward arc. The initial marking M0 is (1, 0, 1).
A transition is called a synchronization transition if it has two or more incoming arcs and one outgoing
arcs. A transition is called a forking transition if it has one incoming arc and more than one outgoing arc;
a forking transition specifies the enabling of concurrent executions. A transition can be both a
synchronizing and a forking transition.
p3 p1
t1 t2
a
p2
t1
t2
p2 p3 p4
t3 t4
p5
t1 t2 t3 t4 t1 t2 t3 t4
p1 0 0 0 2 p1 1 1 0 0
p2 1 0 0 0 p2 0 0 1 0
B= p3 1 0 0 0 F= p3 0 0 1 0
p4 0 1 0 0 p4 0 0 1 0
p5 0 0 1 0 p5 0 0 0 1
Figure 4.9 Backward and forward matrices for the Petri net n in Figure 4.8
The formula defining the incidence matrix C implies that the new marking is the net result of the tokens
that are gained minus the tokens that are lost as a result of the firings of certain fireable transitions.
Given a marking M, we say that a transition t of a PN is enabled or fireable if, and only if, for every p €
PRE(t), M(p) ≥ F(p, t). Firing of a transition t € T is defined by the transformation of the enabling marking
M into a new marking M’ such that: p € P, M’ (p) = M(p) + C(p, t) σ
The main advantage of the PN as a specification model lies in its verifiability, using some mathematical
manipulations from linear algebra.
Activity Diagram
The logical place to start analysis and design using UML diagrams is with the use of Activity Diagram. It
describes several related activities in time order as a group of jobs or a series of processes. The easiest
way to visualize an Activity Diagram is to think of a flowchart of a code. The flowchart is used to depict
the business logic flow and the events that cause decisions and actions in the code to take place. Activity
diagram is a dynamic diagram that shows the activity and the event that causes the object to be in the
particular state. It is a flowchart that models the actions, the object will perform and in what order. It is
used to break out the activities that occur within a use case and is good for showing parallel threads.
From the software engineering perspective they are used to analyze requirements and use cases to the
process flow diagrams to give the broad picture of the overall process flow.
Uses of Activity Diagram
✓ It can be used early on in the analysis and design process to show business workflow.
✓ It can be used to show where each of the Use Cases might be in an activity to illustrate what Use
Case has to happen.
✓ It can be used to show how things flow between the Use Cases.
✓ It can be used at the design level to model very complicated set of algorithms for a particular
class.
✓ It can be used to show the flow between the methods of a class.
Basic parts of the activity diagram are : Activities or Action States: Related activities in time order are
represented as rounded rectangles. These activities are typically action states – states that transition
automatically to the next state after the action is complete; Initial State: The filled in circle (followed by
an arrow) represents the start of the activity diagram – where the flow of control starts; Final State: An
arrow pointing to a filled circle nested inside another circle represents the final action state; Transitions:
Transitions shown as arrows show how you move from activity to activity or the relationships among
action states; Synchronization bars: These bars show how activities happen in parallel. It can guard a
transition that says “Go to this activity only if this condition is true,” and it can show you where it stops;
Swimlanes: These swimlanes show ownership. They clearly illustrate to all parties what individual or
group is responsible for what activity. Here, related activities are grouped in one column. However there
are other elements that need to be considered when drawing an activity diagram. The table below lists
those elements and symbols.
Table 4.10 Elements and Symbols of Activity Diagram
Element & Symbol Description
Start State/ Initial Activity This shows the starting point or first activity of the flow.
Denoted by a solid circle.
Join
Create
curriculum
Select courses
To teach
Create
catalog
[Registration time period expired]
In bookstore To students
Open
registration
Close
registration
In this example, completing the Take Order activity, creates an Order in the [entered] state. The
Fill Order activity requires an Order in the [entered] state and creates an Order in the [filled] state.
In this example, the transition from Take Order to Fill Order sends an enterOrder signal to the
Order object. The transition from Fill Order to Deliver Order receives an orderFilled signal from the Order
object.
Figure 4.12 Example Activity Diagram for Signal Sending and Receiving
Example of Swimlane
To create the two swimlanes, use a partition and a horizontal or vertical swimlane separator.
Request Service
Take Order
Pay
Fill Order
Deliver Order
Collect Order
The Activity Diagram focuses on activities, in this sense it is like a flow chart supporting compound
decisions. However, it differs from a flow chart by explicitly supporting parallel activities and their
synchronization. Unlike EPC, the starting point eliminates need to traverse through the entire process
model for identifying the process start or triggering event that is of user interest. The back flows of
activities can be represented unlike the Event Trace Diagrams.
The biggest disadvantage of Activity Diagrams is that they do not make explicit which objects
execute which activities, and the way that the messaging works between them. Labeling of each activity
with the responsible object can be done. Often it is useful to draw an Activity Diagram early on in the
modeling of a process, to help you understand the overall process. Then interaction diagrams can be
used to help you allocate activities to classes.
Guidelines in Diagramming
A. General Guidelines
A.1 Place the Start Point in the Top-Left Corner
A start point is modeled with a filled in circle, using the same notation that UML State Chart
Diagrams use. Every UML Activity Diagram should have a starting point, and placing it in the top-left
corner reflects the way that people in Western cultures begin reading. Figure 1 which models the
business process of enrolling in a university, takes this approach.
Figure 4.5 Modeling a business process with a UML Activity Diagram.
Figure 4.6 Is interesting because it does not include an end point because it describes a
continuous process – sometimes the guidelines don’t apply.
B. Activities
An activity, also known as an activity state, on a UML Activity Diagram typically represents the
invocation of an operation, a step in a business process, or an entire business process.
D. Guards
D.1 Each Transition Leaving a Decision Point Must Have a Guard
This ensures that you have thought through all possibilities for that decision point.
D.4 Exit Transition Guards and Activity Invariants Must Form a Complete Set
An activity invariant is a condition that is always true when your system is processing an activity.
For example, in Figure 4.5 an invariant of the Enroll In University activity is that the person is not yet
officially a student. Clearly the conditions that are true while processing an activity must not overlap with
its exit conditions and the invariants and exit conditions must “add up” to a complete set.
It is possible to show that activities can occur in parallel, as you see in Figure 4.5 depicted using
two parallel bars. The first bar is called a fork; it has one transition entering it and two or more transitions
leaving it. The second bar is a join, with two or more transitions entering it and only one leaving it.
F. Swimlane Guidelines
A swimlane is a way to group activities performed by the same actor on an activity diagram or to
group activities in a single thread (Douglass 1999). Figure 4.6 includes three swimlanes, one for each
actor.
Figure 4.6. A UML activity diagram for the enterprise architectural modeling (simplified).
F.1 Order Swimlanes in a Logical Manner
Although there are no semantics behind the ordering of swimlanes there often is a natural ordering
for them. For example, in Figure 4.6 you see that the swimlanes are listed left-to-right in the relative
order that the activities would occur in a serial process (even though this one is iterative) – stakeholders
will start by identifying and prioritizing requirements, the analyst will model them, then the architects will
act on them.
F.5 Swim areas Suggest the Need to Reorganize Into Smaller Activity Diagrams
When a swim area includes several activities you may instead decide to introduce a UML
package, or simply a higher-level activity, that is then described by a detailed UML Activity Diagram. For
example, Figure 4.6 may simply be the detailed description of a Model the Enterprise activity on a high-
level diagram for that EUP discipline.
Activities act on objects, in the strict object-oriented sense of the term an action object is a system
object, a software construct. In the looser, and much more useful for business application modeling,
sense of the term an action object is any sort of item. For example in Figure 4.7 the ExpenseForm action
object is likely a paper form.
Note that this notation may be applied to any object on any UML diagram, including UML
Sequence diagrams and UML Collaboration diagrams.
G.3 State Names Should Reflect the Lifecycle Stage of an Action Object
You depict the same action object on a UML Activity Diagram in several places because it is
pertinent to what is being modeled and because itself object has changed (it has progressed through one
or more stages of its lifecycle).
To depict the fact that an activity is implemented by an action object you use a solid arrow.
State charts diagrams captures the life cycles of objects, sub-systems and systems. They indicate
what states an object can have and how different events affect those states over time.
State chart diagrams should be attached to classes that have clearly identifiable states and is governed
by complex behaviour.
A State is displayed as a rounded rectangle with optional compartments for attributes, events and
internal activities. State flows or transitions are drawn between States, usually with guard conditions and
rules governing how and when an object may transition from one state to another.
States are usually named according to their condition, for example 'Checking', 'Waiting' and
'Dispatching' are all active conditions an object can be in while waiting to transition to another state or
end the cycle completely.
Start and end nodes represented as solid and empty circles are used to represent the beginning
and end of all transitions. State charts can have a start point and several end points.
State transitions may be triggered by events. These events may have keywords (guards)
associated with it to clarify the event. It is not always necessary to show these events.
States can be nested. This implies that states (sub states) can exist in an overall state. Parallel
states can also be defined where an object may have several states at the same time. For example: A
person has at any time many parallel states. These may be: walking, thinking, young, etc.
Formerly called state chart diagrams in UML 1, state machine diagrams depict the dynamic behavior of
an entity based on its response to events, showing how the entity reacts to various events depending on
the current state that it is in. Create a UML state machine diagram to explore the nature of a:
Initial State: This shows the starting point or first activity of the flow. Denoted
by a solid circle. This is also called as a "pseudo state," where the state has no
variables describing it further and no activities.
State: Represents the state of object at an instant of time. In a state diagram,
there will be multiple of such symbols, one for each state of the Object we are
discussing. Denoted by a rectangle with rounded corners and compartments
(such as a class with rounded corners to denote an Object). We will describe
this symbol in detail a little later.
Transition: An arrow indicating the Object to transition from one state to the
other. The actual trigger event and action causing the transition are written
beside the arrow, separated by a slash. Transitions that occur because the state
completed an activity are called "triggerless" transitions. If an event has to
occur after the completion of some event or action, the event or action is called
the guard condition. The transition takes place after the guard condition occurs.
This guard condition/event/action is depicted by square brackets around the
description of the event/action (in other words, in the form of a Boolean
expression).
History States: A flow may require that the object go into a trance, or wait state,
and on the occurrence of a certain event, go back to the state it was in when it
went into a wait state—its last active state. This is shown in a State diagram
with the help of a letter H enclosed within a circle.
Final State: The end of the state diagram is shown by a bull's eye symbol, also
called a final state. A final state is another example of a pseudo state because
it does not have any variable or action described.
Figure 4.8 A UML state machine Diagram for a seminar during enrollment.
A state is a stage in the behaviour pattern of an entity. States are represented by the values of
the attributes of an entity. For example, in Figure 4.8 a seminar is in the Open For Enrollment state when
it has been flagged as open and there are seats available to be filled.
State names such as Open For Enrollment and Proposed are easy to understand, thus increasing
the communication value of Figure 4.8. Ideally state names should also be written in present tense
although names such as Proposed, past tense, are better than Is Proposed, present tense.
3.4 Top-Level state machines Always Have Initial and Final States
A top-level UML state machine, such as the one depicted in Figure 4.10, should represent the
entire lifecycle of an entity including its “birth” and eventual “death”. Lower-level diagrams may not always
include initial and final states, particularly those diagrams that model the “middle states” of an entity’s
lifecycle.
A transition is a progression from one state to another and will be triggered by an event that is
either internal or external to the entity being modeled. For a class, transitions are typically the result of
the invocation of an operation that causes an important change in state, although it is important to
understand that not all method invocations will result in transitions. An action is something, in the case
of a class it is an operation, that is invoked by/on the entity being modeled.
4.3 Indicate Entry Actions Only When Applicable For All Entry Transitions
In Figure 4.10 you see that upon entry into the Closed To Enrollment state the operation
notifyInstructor() is invoked via the entry/ action label. The implication is that this operation will be invoked
every single time that this state is entered – if you don’t want this to occur then associate actions to
specific entry transitions. For example, the addStudent() action is taken on the student enrolled transition
to Open For Enrollment but not to the opened transition, this is because you don’t always add a student
each time you enter this state.
4.4 Indicate Exit Actions Only When Applicable For All Exit Transitions
Exit actions, indicated with the exit/ label, work in a similar manner to entry actions.
4.5 Model Recursive Transitions Only When You Want to Exit and Re-Enter the State
A recursive transition is one that has the same state for both of its end points. An important
implication is that the the entity is exiting and then re-entering the state, therefore any operations that
would be invoked due to entry/ or exit/ action labels would be automatically invoked. This would be the
case with the recursive transitions of the Open For Enrollment state of Figure 4.10 where the current
seminar size is logged on entry.
The transition events in Figure 4.8 , such as seminar split and cancelled, are written in past tense
reflecting the fact that transitions are the results of events – because the event occurs before the transition
it should be referred to in past tense.
5. Guards
As a summary, we should create state diagrams when the business logic for a particular flow is very
complex, or needs greater understanding by the developer to be coded perfectly. Arrange the states and
transitions to ensure that the lines that cross each other are minimal. Criss-crossing lines are potential
sources of confusion in conveying the diagram's meaning. Statechart Diagram is very much important in
designing a particular system. Through this diagram, we are able to know the life cycle of a system. We
are able to point out what part of the system occurs complexity. We are also able to analyze the stages
and behaviors of each object.
Object-Oriented Analysis
Most new client-server application development tools emphasize object-oriented features. The
introduction of the object-oriented approach in th 1970s marked a radical change in the methodology and
approach of large-scale application development. In contrast to the old paradigm where each module in
a system denotes a major step in some overall process, where applications relied heavily on testing and
debugging to meet required specifications, the object-oriented paradigm requires that applications are
decomposed by primary objects and major components are developed independently.
Suppose you're at the dinner table, you would like some salt, and the salt shaker is inconveniently located
at the other end of the table. You might say to your friend, "Please pass me the salt," and she would do
so. On the other hand, instead of saying just "Please pass me the salt," you could try, "Please remove
your right hand from your wine glass, move it to the left until it contacts the salt shaker, grasp it, lift it from
the table, move it in a natural arc in my direction, stop when it contacts my hand, wait until my hand has
closed around it, and then release it. The object-oriented way is to say "Pass the salt," and leave it up to
the object to carry out the request any way it chooses. The procedural way is to specify each and every
step of getting that shaker of salt into your hands.
Concepts Of Object-Orientation
Encapsulation
• An object is a "black box" (that contains code and data) which receives and sends messages.
• All communication is to be done via messages. Messages define the interface to the object.
• The action that a message carries out is called a method. It is the code that gets executed when
the message is sent to a particular object.
• An object can be used without knowing exactly what is inside of it, and it becomes unnecessary
to directly modify the object.
• Providing access to an object only through its messages, while keeping the details private is called
encapsulation"
• Encapsulation is important because parts of software must sometimes be changed or re-used.
Classes
An object is defined via its class which determines everything about an object. Objects are individual
instances of a class. "For example, you may create an object called Tagpi from class Dog. The Dog class
defines what it is to be a Dog object, and all the "dog-related" messages a Dog object can act upon". All
object-oriented languages have some means to create object instances from a class definition.
More than one object can be created for a class. In the above example, objects named Putot and Batik
might also be created in class Dog. In a class, messages are defined that objects in the class understand.
Using the above example, the Dog objects might understand messages such as Bark, Fetch, and Roll-
over.
Arguments are supplied as part of a message. "For example, the "fetch" message might contain an
argument that says what to fetch or the "roll-over" message could contain one argument to say how fast,
and a second argument to say how many times"
Inheritance
If there is already a class which can respond to many different messages, it is possible to make a new,
similar class which adds just a couple more messages without having to re-write the entire class by
creating a subclass. This new class inherits all the existing messages, and therefore, all the behavior of
the original class. The original class is called the superclass of the new class.
Inheritance also promotes reuse. It is not necessary to start from scratch when writing a new program if
the existing classes have similar behaviors to those needed in the new program. "For example, after
creating the class Dog, you might make a subclass called Wolf, which defines some wolf-specific
messages, such as hunt. Or it might make more sense to define a common class called Canine, of which
both Dog and Wolf are subclasses".
OOA differs the most from Structured analysis. "Structured analysis maintains a process-oriented view
of systems, providing a decomposition based on processes, whereas OOA decomposes the problem
domain based on classification entities".
Information engineering is closer to OOA because it provides a variety of tools for modeling of entities
(namely, entity-relationship diagramming). The differences between OOA and information
engineering lie in OOA's requirement for encapsulated operations. "Information engineering violates this
rule because operations may access numerous entities and are not subordinated to one entity".
Developers who are currently using structured analysis techniques usually discover that their experience
in modeling requirements using data flow diagrams is irrelevant or worthwhile only in the context of
modeling existing procedures. Those developers schooled in information engineering will find the road to
object-oriented analysis much easier to follow. However, developers still need to alter their views from
modeling disembodied processes to encapsulated services.
Domain modeling identifies real-world, problem space object or domain objects within a system. The
domain model serves as a glossary of terms for writers of use cases. Domain modeling allows writing
of use cases in the context of the object model or in terms of the domain objects. Effective domain
modeling encourages reuse of objects among applications. Domain objects are abstractions of the real
world i.e. the main conceptual objects that are going to participate in the system concerned. When you
design object-oriented software, you structure the software around objects. Domain objects are modeled
thru Class Diagrams.
Redundant classes: if two classes express the same information, the most descriptive name should
be kept;
Irrelevant classes: if a class has little or nothing to do with the problem, it should be eliminated;
Vague classes: non-specific classes with ill-defined boundaries should be eliminated;
Attributes: names that primarily describe individual objects should be restated as attributes
Operations: if a name describes an operation that is applied to objects and not manipulated in its
own right, then it is not a class.
Roles: the name of a class should reflect its intrinsic nature and not a role that it plays in an
association.
Implementation constructs: constructs extraneous to the real world should be eliminated from the
analysis model.
Or you may ask the following questions:
▪ Is the candidate a synonym of another domain object?
▪ Is the candidate outside the scope of the system?
▪ Is the candidate a role without unique behavior, or is it an external role?
▪ Is the candidate unclear or in need of focus?
▪ Is the candidate an action or an attribute?
Any candidate that qualifies to these questions should be discarded.
Asset
Title:
Acquisition Date:
Check out
2. Simple Aggregation:
• A relationship between two classes where one class is dependent on another class but it still
can exist without the other class
• For example, Customer Master List class includes the Customer class. The Customer class
can still exist without the Customer Master List class.
• Represented by a diamond that is not filled on the line connecting the classes
Figure 4.11. Example of regular association, aggregation and composition.
Class Behavior
Boundary In an ideal multi tier system, the user interacts only with the boundary
classes. For example, JSPs in a typical MVC architecture form the
boundary classes.
Control These classes typically don't contain any business functionality.
However, their main task is to transfer control to the appropriate business
logic class, depending on a few inputs received from the boundary
classes.
Entity These classes are those that contain the business functionality. Any
interactions with back-end systems are generally done through these
classes.
• Interface: An interface is a variation of a class. As we saw from the previous point, a class provides
an encapsulated implementation of certain business functionality of a system. An interface on the
other hand provides only a definition of business functionality of a system. A separate class
implements the actual business functionality.
So, why would a class not suffice? You can define an abstract class that declares business
functionality as abstract methods. A child class can provide the actual implementation of the
business functionality. The problem with such an approach is that your design elements get tied
together in a hierarchy of classes. So, even though you may not have intended to connect your
design elements representing drastically different business entities, that is what might result.
Hence, the use of the interface design construct in class diagrams. Different classes belonging to
different and discrete hierarchies can maintain their distinct hierarchies and still realize the
functionality defined in the methods of the interface.
An interface shares the same features as a class; in other words, it contains attributes and
methods. The only difference is that that the methods are only declared in the interface and will
be implemented by the class implementing the interface.
In addition to the above, there is one more element used in class diagrams:
• Package: A package provides the ability to group together classes and/or interfaces that are either
similar in nature or related. Grouping these design elements in a package element provides for
better readability of class diagrams, especially complex class diagrams.
From Figure 4.12, you can see a package is represented as a tabbed folder. A package can also
have relationships with other packages similar to relationships between classes and interfaces.
Relationships Between Classes
In a class diagram, obviously you can't have classes just floating around; you need to see the relationship
between them. The following table shows the kinds of relationships between classes, their notation, and
what they mean.
NOTE: Item appears on Order but was not modeled because association is implied through OrderItem
UML Interaction Diagrams
Interaction diagrams are models that describe how a group of objects collaborate in some
behavior - typically a single use-case. The diagrams show a number of example objects and the
messages that are passed between these objects within the use-case.
Interactions are shown as sequence diagrams or as collaboration diagrams both present in UML.
Both diagram formats show the execution of collaborations.
Sequence diagrams were found in a variety of OO methods under a variety of names and date to
pre-OO days. Collaboration diagrams were adapted from Booch (object diagram), Fusion (object
interaction graph), and a number of other sources. Collaborations are now first-class modeling entities,
and often form the basis of patterns.
1. Sequence Diagram - A sequence diagram shows the interactions among a set of objects in temporal
order, which is good for understanding timing issues. In this form, objects are shown as vertical lines with
the messages as horizontal lines between them. This form was first popularized by Jacobson.
2. Collaboration diagram - A collaboration diagram is a scenario diagram that shows the sequence of
messages that implement an operation or a transaction. Whereas Sequence diagrams emphasize the
temporal flow of behavior,
Collaboration diagrams emphasize relationships. They define a context, that is, a graph of objects and
links with message flows attached to its links. The context of the diagram shows the objects relevant to
the performance of an operation, including objects indirectly affected or accessed during the operation.
Scenario: the order entry window sends a prepare message to an order. The order then sends prepare
to each order line on the order. The order line first checks the stock item, and if the check returns true it
removes stock from the stock item. If stock item falls below the reorder level it requests a new delivery.
Sequence Diagrams
A sequence diagram has two dimensions: the vertical dimension represents time; the horizontal
dimension represents different objects. Normally time proceeds down the page. (The dimensions may be
reversed if desired). Usually only time sequences are important but in real-time applications, the time
axis could be an actual metric. There is no significance to the horizontal ordering of the objects. Objects
can be grouped into "swim lanes" on a diagram.
Within a sequence diagram an object is shown as a box at the top of a dashed vertical line (See
Fig 1). This vertical line is called the object's lifeline. The lifeline represents the object's life during the
interaction.
Each message is represented by an arrow between the lifelines of two objects. The order in which
these messages occur is shown top to bottom on the page. Each message is labeled at minimum with
the message name; you can also include the arguments and some control information, and you can show
self-delegation, a message that an object send to itself, by sending the message arrow back to the same
lifeline.
Two bits of control information are valuable. First, there is a condition, which indicates when a
message is sent (for example, [remove()=“true”). The message is only sent if the condition is true. The
second useful control marker is the iteration marker, which shows that a message is sent many times to
multiple receiver objects, as would happen when you are iterating over a collection (such as *prepare).
Collaboration Diagrams
The second form of the interaction diagram is the collaboration diagram. Here the example objects
are shown as icons. Again arrows indicate the messages sent in the use case. This time the sequence
is indicated by a numbering scheme. Simple collaboration diagrams simply number the messages in
sequence. More complex schemes use a decimal numbering approach to indicate if messages are sent
as part of the implementation of another message. In addition a letter can be used to show concurrent
threads.
Figure 4.16 A collaboration Diagram
In the past, people used the simple numbering scheme. The UML uses the decimal scheme
because it makes it clear which operation is calling which other operation, although it is harder to see the
overall sequence. Regardless of what numbering scheme you use, you can add the same kind of control
information you might show on a sequence diagram.
Different people have different preferences when it comes to choosing the form of interaction
diagram to use. Some prefer the sequence diagram because it puts emphasis on sequence; it is easy to
see the order in which things occur. Others prefer the collaboration diagram because they can use the
layout to indicate how objects are statically connected.
One of the great strengths of an interaction diagram is its simplicity. You can easily see the
messages by looking at the diagram. They do, however, have weaknesses, the principal one is that
although they are good at describing behavior: they do not define it. If you try to represent something
other than a single sequential process without much conditional or looping behavior, the technique begins
to break down.
They typically do not show all the iteration and control that is needed to give a computationally
complete description. Various things have been done to try and remedy this. Jacobson uses pseudo-
code in conjunction with sequence charts to provide a more executable model. Others have added
various diagrammatic notations to increase the model's executability. Many of these are included in the
UML.
However, the beauty of interaction diagrams is their simplicity, and much of these additional
notations lose this in their drive to computational completeness. Thus it might be a good idea not to rush
to the more complex forms of interaction diagrams; you may find that the simpler ones give you the best
value.
Interaction diagrams should be used when you want to look at the behavior of several objects
within a single use case. They are good at showing the collaborations between the objects; they are not
so good at precise definition of the behavior.
If you want to look at the behavior of a single object across many use-cases, use a state transition
diagram. If you want to look at behavior across many use cases or many threads, consider an activity
diagram.
One of the great strengths of an interaction diagram is its simplicity. It is difficult to write much
about interaction diagrams because they are so simple. They do, however, have weaknesses, the
principal one is that although they are good at describing behavior: they do not define it. They typically
do not show all the iteration and control that is needed to give a computationally complete description.
REFERENCES:
https://www.visual-paradigm.com
https://www.uml-diagrams.org/
https://www.youtube.com/watch?v=sB2iQSvrcG0
ASSESSMENTS:
1. Following your adapted approach ins systems analysis (procedural vs object-oriented), identify
the different tools that you will use to model and specify your proposed software solution.
2. Use appropriate software available online to draw the diagrams that will specify the different
objects, the structure, the behavior and architecture of your proposed solution.
3. Specify your proposed software specifications following the IEEE standard for detailed Software
Requirements Specification document/template.
4. Present your outputs and discuss your most significant learnings from the topic and the activities.
5. *Watch the video clip https://www.youtube.com/watch?v=sB2iQSvrcG0. Relate your
learnings from the video with the topic you read from this material. Discuss.
LEARNING OBJECTIVES:
• Apply various design principles, techniques and patterns in the development of a software
project.
• Construct an architectural diagram based on the analyzed system requirements.
• Design the software data, program/class structure, and static behavior based on specified
requirements
• Design a preliminary system prototype or working model/version of the software.
• Apply patterns in the design of a software solution effectively
• Validate each design component for each subsystem of the project.
OVERVIEW:
Developing software involves many important steps and phases, just as any product does. The product’s
efficacy, the customer’s satisfaction, and the cost-effectiveness are all as important as they are for any
developed hardware product, and are likewise reliant on a multi-stepped and sometimes complicated
process. The actual design, which can be thought of as a blue print, cannot begin until the requirements
are determined. Software requirements documents such as the SRS, help determine what the software
must accomplish. Once software requirements have been specified, these specifications are translated
into software design specifications. After this step, the actual design is done, and then the coding can
take place, after which testing, debugging, and maintenance occur (“Software design”, n.d., para 1).
READING MATERIALS:
Software design is a process of defining the architecture, components, interfaces, and other
characteristics of a system or component and planning for a software solution. After the purpose and
specifications of software is determined, software developers will design or employ designers to develop
a plan for a solution (archive.cnx.org, n.d). It is the process by which an agent creates a specification of
a software artifact intended to accomplish goals, using a set of primitive components and subject
to constraints (Ralph & Wand, 2009). Software design may refer to either "all the activity involved in
conceptualizing, framing, implementing, commissioning, and ultimately modifying complex systems" or
"the activity following requirements specification and before programming, as a stylized software
engineering process" (Freeman & Hart, 2004). Software design usually involves problem-solving and
planning a software solution. This includes both a low-level component and algorithm design, and a high-
level architecture design.
Design Principles
Basic design principles enable the software engineer to navigate the design process. Davis (Davis, 1995)
suggests a set of principles for software design, which have been adapted and extended in the following
list:
• The design process should not suffer from "tunnel vision." A good designer should consider
alternative approaches, judging each based on the requirements of the problem, the resources
available to do the job.
• The design should be traceable to the analysis model. Because a single element of the design
model can often be traced back to multiple requirements, it is necessary to have a means for tracking
how requirements have been satisfied by the design model.
• The design should not reinvent the wheel. Systems are constructed using a set of design patterns,
many of which have likely been encountered before. These patterns should always be chosen as an
alternative to reinvention. Time is short and resources are limited; design time should be invested in
representing (truly new) ideas by integrating patterns that already exist (when applicable).
• The design should "minimize the intellectual distance" between the software and the problem
as it exists in the real world. That is, the structure of the software design should, whenever possible,
mimic the structure of the problem domain.
• The design should exhibit uniformity and integration. A design is uniform if it appears fully
coherent. In order to achieve this outcome, rules of style and format should be defined for a design
team before design work begins. A design is integrated if care is taken in defining interfaces between
design components.
• The design should be structured to accommodate change. The design concepts discussed in
the next section enable a design to achieve this principle.
• The design should be structured to degrade gently, even when aberrant data, events, or
operating conditions are encountered. Well-designed software should never "bomb"; it should be
designed to accommodate unusual circumstances, and if it must terminate processing, it should do
so in a graceful manner.
• Design is not coding, coding is not design. Even when detailed procedural designs are created
for program components, the level of abstraction of the design model is higher than the source code.
The only design decisions made at the coding level should address the small implementation details
that enable the procedural design to be coded.
• The design should be assessed for quality as it is being created, not after the fact. A variety of
design concepts and design measures are available to assist the designer in assessing quality
throughout the development process.
• The design should be reviewed to minimize conceptual (semantic) errors. There is sometimes
a tendency to focus on minutiae when the design is reviewed, missing the forest for the trees. A
design team should ensure that major conceptual elements of the design (omissions, ambiguity,
inconsistency) have been addressed before worrying about the syntax of the design model.
STS Method
The acronym STS stand for Source, Transform, and Sink. In the STS partitioning method, the program
processing is divided into three functions: Source (input section), Transform (processing section), and
Sink (output section). STS partitioning has partitioning criterion boundary points called the maximum
abstraction input point and the maximum abstraction output point, ad modules are partitioned using these
points. A point immediately before the input transformed losing its original form as it is, is called the
maximum abstraction input point. The point where the output data begins to be created, as process
steps are traced in the reverse order from the final output is called the maximum abstraction output
point. The section from data input to the maximum abstraction input point is defined as S (Source), the
section from the maximum abstraction input point to the maximum abstraction output point is defined as
T (Transform), and the section from the maximum abstraction point to output is defined as S (Sink). This
method is illustrated below:
STS partitioning is suited for partitioning based on data flow without branches. Basically, the same
processing is performed for all input data. it is difficult to implement compared to transaction method.
Procedures of STS Partitioning:
1. Clarify and extract the problem structure.
2. Determine the main flow of input data and output data in the problem structure.
3. Find the logical final point of the input data flow and the logical first point of the output data flow.
4. Use these points as partitioning points, and describe each section as a single function.
Transaction Partitioning Method. Transaction means a unit of processing for which a request is issued
to the computer to perform a specific process. A structured design where/that:
1. Modules are partitioned with focus on transaction
This method is used when input data can be classified into different types of processing.
2. Is suitable for branched data flow
Transaction is suited for data flow with branches because 2 or more types of data exist, and
processing suited to each type is performed while in STS method same processing is performed to all
input data.
Function
Function
Common Function Partitioning Method. This method separates a module having a commonly used
function from those that have been identified as a result of either the STS method or the Transaction
method. Generally, it has a main module that handles 3 types of processing, INIT (initialization), PROC
(procedure), and END. The main module thus consists mostly of instructions calling these 3 processing
functions.
Steps: Partitioning the PROC function
1. Find the Maximum Control Function in PROC processing
2. Determine the Process Function, which is dependent on the control function.
3.
<<PROC>>
5. Find the Control Function in each Processing Function and its subordinate processing functions.
Repeat this procedure and partition until no control function can be found.
• Processing function when key item is found only in the master file
The function does not include any control function and it means no further partitioning. This
processing function can be changed to “copy master file” to represent the function more
accurately.
• Processing function when key item in the master matched with the key item in the
transaction file
Each subordinate processing function do not contain a control function, thus stops the partitioning.
Change the name of the processing that is carried out when the master file matches with the
transaction files the “update master file”.
In this case partition ends here. Again, change the name of the process when the key item is not
found as “creation of new master file”
6. When no more control function is found, focus on the processing function to partition major
processing function into single functions.
Major functions
Change processing •
Cancellation processing •
Error proc.(duplicate) •
New Setting •
Error proc.(unmatched) •
Error proc.(unmatched) •
The objective of this partitioning is to obtain information about common internal modules in a program
thus if the same function is found in several places, it can be handled as a common internal module
in the program. In this example, the previous four functions that appeared as single function
separately are considered as module.
7. Combine the functions into unit of module so that it is easier to exist as such. While consolidate
modules that can be shared, name each module in such manner that represents the function and
its function can be easily understood from the name. In this example, error processing for
“unmatched state of change indication” and the error processing for “unmatched state of
cancellation indication” can be combined into one module. Use the same steps for INIT
processing and END processing to refine and evaluate the whole module structure. Summing up
the above descriptions, here is the hierarchical structure of the program.
Master maintenance
Read a Read a
master file transaction
Jackson Method
A method designed by Michael A. Jackson and John Cameron. The program structure is based on the
corresponding relationship between the input data structure and the output data. The concept of this
method implies that when the corresponding relationship between the data is revealed, the structure of
the program can be clarified as well. It is best suitable for handling input- output of clear data structure
(i.e. job processing system). The steps in partitioning a program are:
1. Define the structure of input data and output data.
2. Check for a one-to- one relationship between the components of input data and output data. If no
relationship found, define an intermediate data structure.
3. Create the program structure based on the corresponding relationship of the components.
4. Assign basic instructions according to the program structure.
There are four structures of data, namely: basic, consecutive, repetition and selection.
➢ Basic
The lowest part of the structure, it cannot be decomposed further.
A B
***Data A, Data B
**Indicates a data item
➢ Consecutive
Sequence components consist of elementary component parts that occur in a specific
order, left to right. The leftmost component part occurs first and the rightmost part occurs
last.
I J
***H is either B or C
**Indicates a selection record
The structure of data is then represented with a chart called a JSP Tree (Jackson Structured
Programming).
Warnier/ Orr Method
A hierarchical flowchart designed by Jean Dominique Warnier (France) and Kenneth Orr (US). It is a
method designed mainly on the structure of the input data. The Warnier method analyzes the input data
with regards to the Hierarchy, Sequence, Selection, Repetition, Concurrency and Recursion. In
comparison with the Jackson Method, This method places more importance on how many times the data
appears during processing. It makes use of brackets to denote the sub process of a process or a sub
element of an element.
First Name
➢ Sequence
It is the simplest structure of this method. Within one level of hierarchy, the features are
shown in the order in which they occur.
Step 1
Step 2
Process Step 3
➢ Repetition
It is the representation of classical “loop” in programming terms. It occurs whenever the
same set of data occurs over and over again or whenever the same group of actions is to occur
over and over again. Repetition is indicated by placing a set of numbers inside parentheses
beneath the repeating set.
(28, 31)
➢ Alternation/Selection
The traditional “selection” process whereby a determination is made to execute one process or
another. It indicates a relationship between two subsets of a set. The exclusive OR symbol
indicates that the sets immediately above and below it are mutually exclusive (if one is present
the other is not). It is also permissible to use a “negation bar” above an alternative in a manner
similar to engineering notation.
Management ..etc.
(0,1)
Employee
➢ Concurrency
One of the advanced constructs in the methodology. It is used whenever sequence is
unimportant.
➢ Recursion
Recursion is the least used of the constructs. It is use to indicate that a set contains an
earlier or less ordered version of itself.
Warnier Method performs processing based on the contents of input data, the processing
structure is determined according to how often the data appears during processing. It may look
simple yet it is a powerful tool to partition a data structure.
Measuring a Module
1. Coupling and Cohesion
The ideas of coupling and cohesion are a terminology and a classification scheme for describing the
interactions between modules and within modules. Ideally, a piece of software should be constructed
from modules in such a way that there is a minimum of interactions between modules (low coupling) and,
conversely, a high degree of interaction within a module (high cohesion). If this can be achieved, then an
individual module can be designed, coded, tested, or amended without the undue complications of having
to deal with other modules. Another beneficial effe4ct is that when an error occurs in a module, the spread
of damage to other modules may be limited. Coupling and cohesion are opposite sides of the same coin,
in that strong cohesion will tend to create weak coupling, and vice versa.
Coupling is the degree of interaction between modules.
Types of Coupling:
Bad
(a) Content Coupling
(b) Common Coupling
(c) Control Coupling
(d) Stamp Coupling
(e) Data Coupling Good
Content Coupling Content Coupling exists if one module refers to the inside of another. In other words,
it branches into or changes data in or alters a statement in, the other module. Clearly, for this to happen,
the invoking module must know a great deal about the called module.
A
B C
D E
Common Coupling Modules are common coupled if they refer to the same global variable. This is
undesirable because, in the format of the global data needs to be changed, then many modules may be
affected. Unless an up-to-date cross-reference list is maintained, which relates data items to the
modules where they are used, and then it may be necessary to check every module.
Global
A1
A2
A3
EXEC
COMMAND
GETCOMM
(a)
EXEC
COMMAND
Parsed Command
GETPCOMM
Command
GETCOMM
Command (b)
** The figure above shows that a module, EXEC COMMAND, is able to call another module GETCOMM.
When called, GETCOMM is expected to provide the parameter Command. However, EXEC COMMAND
may require the parameter in parsed or unparsed form. The super ordinate module indicates the version
required by the downward-traveling parameter Parse flag.
An alternative structure, which eliminates parse flag and the consequent control coupling, is shown in
figure b. if parsed command is required, then GETPCOMM calls GETCOMM to obtain the unparsed
version, parses it, and returns it to EXEC COMMAND.
Stamp Coupling. Two modules are stamp coupled if they accept the same record type as a parameter.
This type of coupling may manufacture independency between otherwise interrelated modules. A further
disadvantage of this type of coupling is that it may prevent a basically simple and useful module from
being used elsewhere.
PRODINVOICE
Customer Customer
Record Basic Mile Record
Charge Charge
CALC CALC
BASECHARGE MILECHARGE
Stamp
Coupling
** A module PRODINVOICE is intended to generate invoices for car hire. The invoice value comprises
two components: the basic rental charge (calculated in CALC BASECHARGE) and the mileage charge
(calculated in CALC MILECHARGE) the parameter to both is customer record. Now it may be that the
two subordinate modules need different data items in Customer Record. For instance, CAC
BASECHARGE may need Customer Address and Rental Period. CALC MILECHARGE may require
miles traveled only. Thus, a change to the format or structure of Customer Address for the benefit of
CALC BASECHARGE may enforce changes to CALC MILECHARGE.
Data Coupling. If modules communicate by parameter, each one being either a single data item or a
homogeneous set of data items which do not incorporate any control element, then the modules are data
coupled. This is the necessary communication between modules and is unavoidable.
Cohesion is the interaction within a module.
Types of Cohesion: Bad
(a) Coincidental Cohesion
(b) Logical Cohesion
(c) Temporal Cohesion
(d) Procedural Cohesion
(e) Communicational Cohesion
(f) Sequential Cohesion
(g) Functional Cohesion Good
Coincidental Cohesion. This occurs when there is little or no functional relationship among the elements
of a module.
Logical Cohesion. The elements of a module are logically associated if they appear to fall into the same
logical class of activities. For example, we could combine into a single module all processing elements
that fall into the class of printing output. E.g., output text to screen, output line to printer, output record to
file. The potential disadvantage though is that different types of input may be required at different times
so that the calling module must know something about the inside of the called module and employ a
downward-traveling flag into the bargain.
Temporal Cohesion. The elements of a module are temporally associated if they are logically associated
and related in time. An example might be an initialization module which includes such elements as: read
a control message from the terminal; open disk files; reset counters; set accumulators to zero. Although
temporal is regarded as stronger than logical, experience has shown that it still may lead to complications
at the maintenance stage.
Procedural Cohesion. Often, functions must be performed in certain order. When these functions are
grouped together in a module just to insure its order, then it is procedurally cohesive.
Communicational Cohesion. This type of cohesion occurs when the elements of the module use the
same input data or contribute to the same output data. On the whole, such modules are acceptable
although experience has shown that they may on occasion cause maintenance problems.
Sequential Cohesion. With this type, the output data from one element serves as input to another. As
such a partitioning approach may result in the inclusion of part-functions into a single module, rather than
one complete function, it is not regarded as the ultimate, cohesion-wise.
Functional Cohesion. In a completely functional module, every element is an integral part of, and is
essential to, the performance of a single function. A good operational definition is the following: ‘If it is
not sequential, communicational, procedural, temporal, logical or coincidental...then it is functional!’
FUNCTION A COINCIDENTAL COMMUNICATIONAL -
Parts Access same data
FUNCTION unrelated
FUNCTION
FUNCTION B C
FUNCTION A
FUNCTION
FUNCTION D E
B
FUNCTION
FUNCTION A’
LOGICAL-
FUNCTION SEQUENTIAL-
similar functions Output of one is
LOGIC FUNCTION A’’ A input to
FUNCTION next
FUNCTION A’’’ B
FUNCTION
PROCEDURAL-
FUNCTION A Related by order of
functions
FUNCTION B
FUNCTION C
The issue control of one module by another is an important one for functionally decomposed designs.
Suppose our design is composed of modules that are functionally cohesive (to guarantee internal
functional consistency), and we connect the modules in such a way that we have a low degree of coupling
(so that the module are independent of one another). What else we examine to tell us about the quality
of the design?
Fan-in indicates how many modules directly control a given module. It represents the elimination of
replicated code and thus is highly desirable from the maintenance point of view. Fan-in should be
maximized but not in any cost.
Fan-out is a measure of the numbers of modules that are directly controlled by another module. If this
number is excessive the module is deemed as likely to be too complex for comfort and correspondingly
difficult to maintain. The Fan-out of a module should be less than 8. The origin of the upper limit of eight
is obscure. It is at least partially based on Miler’s magical number seven, plus or minus two. This is all
about the limits of human capacity for processing information. It is often quoted as evidence of the number
of subordinates that a human manager can cope with efficiently. It is interesting, therefore, that a heuristic
that won its spurs in the field of human organization design is now quoted in the context of software
design.
Depth & Width provide an indication of the number of levels of control and overall span of control,
respectively. A module that controls another module is said to be super ordinate to it, and conversely, a
module controlled by another is said to be super ordinate to the controller.
Example1:
System 1 A
B C D
E F G
System 2
C B D F G
E
Module A has a fan-out of 3 in system 1 but a fan-out of 5 in system 2. Similarly, the fan-out for module
C in either system is 1. Which is the better design? In general, we want to minimize the number of
modules with a high fan-out. A module controlling many other modules usually indicates that the
controlling module is doing too much; the controlling module probably performing more than one function.
Thus, system 1 may be a better design than system 2 since its modules have low fan-out. On the other
hand, as we increase the number of levels in the design, sometimes we want to use a particular module
more than once.
For instance, in many cases we may need to search a string for particular character. If we design one
general-purpose module to do that task, and then invoke that module from many others, the resulting
design is more efficient and easier to test and modify than one in which there is a proliferation of similar
string-searching functions. Thus, for a design with a large number of levels, will create a set of utility
modules: tools or building bocks that are used by other modules to perform often-needed tasks. A typical
utility module has a high fan-in because it is invoked by many other modules. One of our goals in
designing system is creating modules with high fan-in and low fan-out.
Example2:
Z
A B C
D E K L M
F G H N O P Q
I J R
Module M is super ordinate to modules A, B and C. Module H is super ordinate to module E and is
ultimately super ordinate to module M. Width-oriented relationships (e.g. between module D and E),
although possible to express and practice, need not to be defined with explicit terminology.
Scope of Control and Effect. Finally, we want to be sure that the modules in our design do not affect
other modules over which they have no control. An example will show us why this consideration is
important. Look again at system 1 in the first example. The structure chart leads you to believe that what
happens in C affects only F and G. thus, a change to the design of C should only affect F and G. suppose,
however, that module C resets a pointer in A that then affects the processing module E. in the structure
chart, an arrow connects one module to another only if the first module can invoke the other. For a given
module, the set of modules to which arrows are drawn from it is called the scope of control of the module.
The modules controlled by the given module are collectively referred to as the scope of effect. No module
should be in the scope of effect if it is not in the scope of control. If the scope of the effect of a module is
wider than the scope of its control, it is almost impossible to guarantee that change to the module will not
destroy the entire design.
Conventional VS Object-Oriented Design (OOD)
All design methods strive for software that exhibits abstraction, information hiding, functional
independence and modularity, but only OOD provides a mechanism that enables the designer to achieve
all four important software design concepts with less complexity and compromise.
Like conventional software design, OOD applies data design (when attributes represented), interface
design (when messaging model is developed), and procedural design(in the design of operations).
However, unlike the architectural designs derived using conventional software engineering methods, an
OO design does not exhibit a hierarchical control structure. The “architecture” of an OO design has more
to do with the collaborations among objects with the flow of control.
Because many conventional and OOD approaches are available, it is difficult to develop a generalized
comparison between the two methods. However, the table shows which design components(suggested
by Fichman and and Kemerer) supported by OOD are not supported using structured design or its
derivatives.
B. Component Design
In the component design, components contained in subsystems are designed in more detail based on
the outputs of the architecture definition, and also classes contained in each component are designed.
The following are the steps:
1. Class Diagram Refinement
2. Design of an interface between classes in the component
C. Detailed Design
In the detailed design, design is carried out in more detail so that classes contained in the component
can be implemented based on the output of the component design.
Designing is an incremental process and class diagrams are updated as the system gets built. Hence,
do not try to capture and freeze the class diagrams of a system in the first pass.
Relationships between classes may not be apparent in the first iteration. Revise and refine your class
diagrams to determine possible relationships during each iteration.
The data object and relationship defined in the entity relationship diagram and the detailed data content depicted in the data
dictionary provide the basis for the data design.
The design-representation – the modular framework of a computer program can be derived from the analysis model and the
interaction of subsystems defined within the analysis model serves as the basis for architectural design.
An interface implies a flow of information (e.g. data and or control). Therefore, the data and control flow diagrams provide the
information required for interface design.
The information obtained from Process specification (PSPEC), Control Specification (CSPEC) and State-Transition Diagram
serve as the basis for procedural design.
To understand how a class diagram is translated into a design model, consider the following example:
After a thorough inspection of the two versions of class diagram, the following rules can be extracted:
For a detailed discussion on the class diagram from a domain model into a design model, take note of
the following:
In Figure 6.6 instances of Delivery interact with OIDGenerator to obtain a new integer value to act as an
object identifier (OID) to be used as a primary key value in a relational database (Ambler, 2001). You
know that Delivery objects are interacting with OIDGenerator and not an instance of it because the
operation is static. Therefore, because there is no permanent relationship to be recorded and therefore
a dependency is sufficient.
Note that there is a danger that you may be motivated not to change a relationship when you really should
in order to preserve the tree arrangement.
Indicator Meaning
0..1 Zero or one
1 One only
0..* Zero or more
1..* One or more
n Only n (where n > 1)
* Many
0..n Zero to n (where n > 1)
1..n One to n (where n > 1)
n..m Where n & m both > 1
n..* n or more, where n > 1
Avoid a Multiplicity of “*”
You should avoid the use of "*" to indicate multiplicity on a UML Class diagram because your reader can
never be sure if you really meant "0..*" or "1..*".
Note that this partially contradicts the Do Not Model Scaffolding Code guideline. You will need to judge
which guideline to follow, the critical issue being which one will improve your diagram the most given your
situation.
Indicate Role Names When Multiple Associations Between Two Classes Exist
Role names are optionally indicated on association ends to indicate how a class is involved in the
association. Although the name of an association should make the roles of the two classes clear, it isn’t
always obvious when several associations exist between two classes. For example, in Figure 6.8 there
are two associations between Professor and Seminar, delivers and teaches. These to association names
reflect common terminology at the university and cannot be changed, therefore we opt to indicate the
roles that professors play in each association to clarify them.
Note that the use of the term role is different between UML Class diagrams and UML Use Case
diagrams. Roles on UML class diagrams pertain to the class/objects they are associated with, helping
to indicate the context for the behavior of the participating objects. On UML Use Case diagrams actors
represent roles that people, systems, or organizations take with respect to your system.
An interesting aspect of Figure 6.9 is the association between Person and Address. First, this association
was pushed up to Person because Professor, Student, and Alumnus all had a lives at association with
Address. Because associations are implemented by the combination of attributes and operations, both
of which are inherited, the implication is that associations are inherited by implication. If the nature of the
association doesn’t change, for example both students and professors live at only one address, then we
don’t have any reason to redraw the association. However, because we track multiple addresses for
Alumnus the relationship did need to be redrawn between Alumnus and Address.
Apply Composition When the Parts Share The Persistence Lifecycle With the Whole
A good rule of thumb is that if the lifecycle of the parts is the same as the whole, if they’re read in at the
same time, if they’re saved at the same time, if they’re deleted at the same time, then composition is
likely applicable.
The class diagram of our Courseware Management System case study can be built after a careful
analysis of the requirements. In the previous article, we identified the primary actors and use cases in
the use case model of the case study. Because we did much of the groundwork of our analysis while
building the use case model, we will use those analysis steps as the basis for identifying the classes and
interfaces of this system.
Let us recap our analysis that we had performed when we designed the use case model. The following
terms and entities specific to the system were identified from the problem statement:
• Courses and Topics that make up a course
• Tutors who teach courses
• Course administrators who manage the assignment of the courses to tutors
• Calendar or Course Schedule is generated as a result of the
• Students who refer to the Course schedule or Calendar to decide which courses for which they
wish to sign up
The basic rule that we learned until now for identifying classes and interfaces is that classes and
interfaces reflect important entities of the business domain of the system being modeled. We will
apply this rule to determine classes and interfaces of the case study system. At first glance, the
actors identified in the use case appear to be prime candidates for being listed as potential
classes. Even though we had excluded Students and Tutors from our final list of actors, we will
still include them in our list as potential classes. So, our first list of classes in the system appears
to be:
o Course administrators
o Tutors
o Students
2. Identify business domain ("passive") entities in the system
But these are the "active" entities of the system. We had also identified "passive" elements in the
system as well in the analysis for our use case model. These entities reflect the business domain
and hence are potential classes for our system.
o Courses
o Topics that make up a course
o Course calendar generated
Entities that reflect the business terms are also called business domain classes or just "domain
classes." Some of the business domain classes hold transient data and some hold persistent
data for the application. Normally, such business domain classes map to either one or many
database tables.
For example, in our case study, the Course class can be modeled as a database table
cms_course. The data in this table for a particular course will be represented by an instance of
the Course class and made available to the rest of the application.
Our two-step process has definitely yielded promising results! We have covered all the relevant
items in our analysis. So, let us list the list of classes and interfaces that we have identified in the
Courseware Management System.
o CourseAdministrator
o Tutor
o Student
o Course
o Topic
o CourseCalendar
3. Categorize and map the use cases and any relevant business functionality to either the passive
or active entities. These will become the business methods of the classes in the system.
Classes encapsulate functionality. The classes that we have identified for the Courseware
Management System also provide business functionality related to the application. The
functionality encapsulated by these classes is distinct in nature and differs from each class. Recall
from our use case model, that, along with actors, we had identified a set of use cases that the
actors interacted with. Let us try to associate them with our classes. Because our primary actor
is the course administrator and the use cases were related to this actor, we can directly map the
use cases to the CourseAdministrator class as methods.
ClassName Methods
CourseAdministrator viewCourses()
manageCourse()
manageTopic()
viewCourseCalendar()
viewTutors()
manageTutorInformation()
assignTutorToCourse()
In addition to this, we also can determine some implicit functionality of classes that reflect business
entities. For example, what functionality should the Course class provide? Intuitively, we would define
the Course class to provide functionality to view all courses in the system, ability to create new courses
or modify information of existing courses, view the details of a particular course, or even remove a course
from the system. We expect the Course class to provide such business functionality because the Course
class reflects a business entity in the system. Hence, these become the methods exposed by the Course
class. So, we can now refine the class diagram and add methods to each of these classes.
To cut a long story short, each of the classes that reflect business entities will provide similar implicit
business functionality. Let us list all such "implicit" functionality for each of these classes.
ClassName Methods
Course viewAllCourses()
viewCourseInformation()
createCourse()
modifyCourse()
removeCourse()
Topic viewAllTopics()
viewTopicInformation()
createTopic()
modifyTopic()
removeTopic()
Tutor viewTutorInformation()
createTutor()
modifyTutor()
removeTutor()
CourseCalendar viewCourseCalendar()
Student viewAllStudents()
viewStudentInformation()
Revisit the class diagram and revise it by identifying shared features and/or common functionality
between classes or interfaces. These will translate into reusable pieces of code for your system. To some
extent, we can say that CourseAdministrator, Tutor, and Student are essentially users of the system.
Hence, we can define a shared parent class named User and define basic functionality like for example,
authentication, in the User class that can be inherited by the CourseAdministrator, Tutor, and Student
classes. It is left to the design expertise to identify reusable classes/functionality.
This completes our analysis of the problem statement to define the classes for the Courseware
Management System.
The next step after defining the classes of the Courseware Management System is to define the
relationships and dependencies between these classes and interfaces. To define the relationships
between the classes, we need to analyze the interconnections between the classes—whether implicit or
explicit. Relationship analysis can be broken up into three steps:
Active entities normally share generalization relationships ("is-a"). Essentially, the common
attributes and functionality between classes are defined in a common parent class. All the related
child classes inherit functionality from the parent class. Apart from generalization, a few active
entities can also be interconnected by a realization relationship. Recall that elements in a
realization relationship implement declared functionality as a "contract." For example, a set of
classes may implement functionality declared as methods in an interface, and this can be
modeled as a realization relationship between the interface and the classes implementing the
interface.
In our case study, we do not find an example of inheritance relationship between the active entities
such as Student, Tutor, and CourseAdministrator or any realization relationships.
Passive business entities frequently share plain association or aggregation relationships ("has-
a"). This is especially true because these business entities are non-transactional in nature and
reflect data more than behavior. It is by far quite intuitive to identify aggregation as well as its
variations—composition relationships for passive business entities.
Some of the classes in our case study do exhibit aggregation relationships. Because a set of
topics makes up a course, we can define an aggregation relationship between the Course and
Topic classes. Moreover, we can define this as a directed aggregation, meaning that you can
check for the topics of a course but not vice versa. Similarly, we can define a plain association
relationship between the Course and Tutor classes and Course and Student classes.
Relationships between active and passive entities can easily be represented using directed association.
The directed association, a variation of the "vanilla" association relationship, provides easy identification
of which is the container class and which is the contained class. The CourseAdministrator class can be
modeled to have a directed association with the Course class. This association can be named as
"manages" because the course administrator manages courses as a business activity. In addition to this,
because the course administrator also manages the tutor information and topic information, we can model
a directed relationship named as "manages" between the CourseAdministrator and the Course and Topic
classes, respectively. We can enhance the readability of the association between CourseAdministrator
and the Course, Tutor, and Topic classes by defining the multiplicity for the association—one to many,
one to one, many to many, and so forth.
Figure 6.11 – shows the class diagram for the Courseware Management System
We have completed identifying the classes for the Courseware Management System and established the
relationships among the classes. Take a look at the class diagram in Figure 4.2.1. The class diagram of
the Courseware Management System includes all the classes and their relationships that we identified
during our analysis of the problem statement.
For example, in our case study application, we can revise the class diagram to define a new
CMSController class that manages the flow of the application. The model layer primarily consists of
classes relevant to the business domain. Next, the classes that we had defined can be categorized as
transactional and persistent classes. The CourseAdministrator class performs most of the activities in
the system. Hence, this class can be designated as a transaction class of the model layer. Similarly,
the Course, Topic, Tutor, CourseCalendar, and Student classes represent persistent business data.
Hence, these can be categorized as persistent classes of the model layer. Finally, you can define a set
of classes that represent the presentation layer; in other words, the user interface of the system.
Forward Engineering from Class Diagrams
Forward engineering is the process of generating source code (in a specific language) from a class
diagram model. The extent to which a UML class diagram can be used to generate source code depends
upon the limitations of the source code language. Because UML is pictorial, and can depict a lot of details,
these details could be lost in the code. Hence, before creating a complete class model, it is a good idea
to be aware of the language that is going to be used, to limit the class model accordingly. Typically, the
association relationships between classes are generated as member variables between the related
classes in the source code. Generalization relationships are generated as inheritance relationships in the
source code.
The above screenshot shows the source code file generated for the CourseAdministrator Java source
code file as a result of forward engineering the class diagram of the Courseware Management System
case study. You need to check how forward engineering works in the tool that you use.
Obtaining a class model from existing source code is called reverse engineering. This is generally done
when it is required to understand the architecture of an existing system, either for re-engineering, or for
maintenance. Reverse engineering is of great use especially when trying to figure out the static structure
and organization of a complex system. Typically, classes defined as member variables in the source
code are modeled as association relationships between the classes. Inheritance relationships in the
source code are generated as generalization relationships between the classes.
The above screenshot shows a class diagram generated as a result of reverse engineering a sample
source code file. You need to check how reverse engineering works in the tool that you use.
• Class diagrams can be used to document a Business Object Model and are widely used in both
high-level and low-level design documents.
• From a Java perspective, it may not be effective to include each and every operation and attribute
of a class in a class diagram because this leads to maintenance issues (e.g., if a method or
attribute changes in the code then the model needs to be updated); rather, javadoc can be used
to document an implementation.
• To maintain consistency with Java coding style, class names should begin with an uppercase
letter while operations and attributes should begin with a lowercase letter.
• Generalization relationships can be mapped to the Java extends relationship while the realizes
relationship can be mapped to the Java implements relationship.
Object Diagram
Although we design and define classes, in a live application classes are not directly used, but instances
or objects of these classes are used for executing the business logic. A pictorial representation of the
relationships between these instantiated classes at any point of time (called objects) is called an "Object
diagram." It looks very similar to a class diagram, and uses the similar notations to denote relationships.
If an object diagram and a class diagram look so similar, what is an object diagram actually used for?
Well, if you looked at a class diagram, you would not get the picture of how these classes interact with
each other at runtime, and in the actual system, how the objects created at runtime are related to the
classes. An object diagram shows this relation between the instantiated classes and the defined class,
and the relation between these objects, in the logical view of the system. These are very useful to explain
smaller portions of your system, when your system class diagram is very complex, and also sometimes
recursive.
Let us now see what the components of an object diagram are. After this, we will build an object diagram
for our case study—Courseware Management system.
Because an object diagram shows how specific instances of a class are linked to each other at runtime,
at any moment in time it consists of the same elements as a class diagram; in other words, it contains
classes and links showing the relationships. However, there is one minor difference. The class diagram
shows a class with attributes and methods declared. However, in an object diagram, these attributes and
method parameters are allocated values.
As an example, in the last article, a class diagram for a multiplicity relation between college and students
was shown, as you cam see in Figure 4:
This class diagram shows that many students can study in a single college. Now, if we were to add
attributes to the classes "College" and "Student," we would have a diagram as shown in Figure 5:
As can be seen from Figure 6.14, the object diagram shows how objects are instantiated in the running
system represented by the College-Student class diagram. The class diagram shows that a single college
has many students, and defines the variables. The object diagram for the same system shows
instantiated classes of Student (Student #1 and Student #2) enrolled in College (Graduate School of
Business).
The object diagram shows the name of the instantiated object, separated from the class name by a ":",
and underlined, to show an instantiation. Eg. Graduate School of Business: College
In the diagram, values are assigned to variables and represented using the notation variable
name=variable value.
This example was the representation of the relation of only two classes with each other. However, in a
real application system, there will be multiple classes. An object diagram then shows the relation between
the instantiations of these classes. We shall see this in our case study.
A class that defines the flow of the system is called as an active class. This class instance in the object
diagram is represented by thick border. In an MVC application architecture, the controller servlet is the
action class, and is denoted by a thicker border. Also, multiple instances of the same class, as in a factory
pattern, if the attributes of the individual objects are not important, or are not different, these can be
represented by a single symbol of overlapping rectangles (see Figure 5.7):
Dos
1. Use the object diagram as a means of debugging the functionality of your system.
2. Object diagrams can also be used to check whether the system has been designed as per the
requirements, and behaves how the business functionality needs the system to respond.
3. Show associations of any kind between objects as linkages (for example, a single segment joining
two objects, without arrows), and not as a dependency or any other specific type of association.
An object diagram only shows the linkages, but not the type of association.
Don'ts
1. Avoid representing all the objects of your system in an object diagram. Because an object diagram
represents the state of objects, it can become quite complex if you try to represent all the objects.
Hence, it is always better to represent the state of objects in certain important/critical flows in your
application using an object diagram. This will keep your object diagram readable, yet useful
enough to capture the state of objects that are important.
2. Because object diagrams represent the state of objects, forward engineering of object diagrams
does not make sense.
Now, we shall create an object diagram for the courseware system. To do this, we will first build up on
our class diagram, and include the possible attributes and define the parameters of to the classes defined
earlier.
The following table outlines the attributes, methods, and their return types for each of the classes:
Class Name
Attributes Methods
CourseAdministrator s_adminId Vector viewCourses()
v_courses Vector manageCourse(s_courseId)
s_courseId Vector manageTopic(s_topicId)
v_tutors Vector
v_tutorInfo viewCourseCalendar(s_courseId)
s_tutorId Vector viewTutors()
v_topics Vector
s_topicId manageTutorInformation(s_tutorId)
Boolean
assignCourseToTutor(s_courseId,
s_tutorId)
To follow a logical sequence now, let us consider that the course administrator, courses, tutors, and
topics already exist. Let us now make an object diagram for the case where the administrator with user
id "admin" wishes to access the course calendar of a course with course id "Math_Course_001."
Hence, the following will be the attribute values, and method calls:
CourseAdministrator
Attributes: s_adminId = admin
s_courseId = Math_Course_001
Methods: viewCourseCalendar("Math_Course_001")
This method will call the method viewCourseInfo of class Course, which returns a Vector object populated
with all the details of the course "MathCourse_001" (see Figure 9)
Course
Methods: viewCourseInfo("Math_Course_001")
Figure 6.15—the object diagram for the courseware management system, for a simple scenario
of the course administrator managing a math course.
In Figure 5.9, for the single case where the flow is from Course Administrator to Course, when the
CourseAdministrator is requesting the course information for a particular course.
Design Patterns
A software designer or architect may identify a design problem which has been visited and perhaps even
solved by others in the past. A template or pattern describing a solution to a common problem is known
as a design pattern. The reuse of such patterns can help speed up the software development process
(Bishop, 2012).
A software design pattern is a general, reusable solution to a commonly occurring problem within a given
context in software design. It is not a finished design that can be transformed directly into source or machine
code. Rather, it is a description or template for how to solve a problem that can be used in many different
situations. Design patterns are formalized best practices that the programmer can use to solve common
problems when designing an application or system.
Object-oriented design patterns typically show relationships and interactions between classes or objects,
without specifying the final application classes or objects that are involved. Patterns that imply mutable state
may be unsuited for functional programming languages, some patterns can be rendered unnecessary in
languages that have built-in support for solving the problem they are trying to solve, and object-oriented
patterns are not necessarily suitable for non-object-oriented languages.
Patterns originated as an architectural concept by Christopher Alexander as early as 1966 (c.f. "The Pattern
of Streets," JOURNAL OF THE AIP, September, 1966, Vol. 32, No. 3, pp. 273-278). In 1987, Kent
Beck and Ward Cunningham began experimenting with the idea of applying patterns to programming –
specifically pattern languages – and presented their results at the OOPSLA conference that year.[2][3] In the
following years, Beck, Cunningham and others followed up on this work.
Design patterns gained popularity in computer science after the book Design Patterns: Elements of Reusable
Object-Oriented Software was published in 1994 by the so-called "Gang of Four" (Gamma et al.), which is
frequently abbreviated as "GoF". That same year, the first Pattern Languages of Programming Conference
was held, and the following year the Portland Pattern Repository was set up for documentation of design
patterns. The scope of the term remains a matter of dispute.
Design patterns can speed up the development process by providing tested, proven development paradigms
(Bishop, 2012). Effective software design requires considering issues that may not become visible until later
in the implementation. Freshly written code can often have hidden subtle issues that take time to be detected,
issues that sometimes can cause major problems down the road. Reusing design patterns helps to prevent
such subtle issues, and it also improves code readability for coders and architects who are familiar with the
patterns.
By definition, a pattern must be programmed anew into each application that uses it. Since some authors see
this as a step backward from software reuse as provided by components, researchers have worked to turn
patterns into components. Meyer and Arnout were able to provide full or partial componentization of two-thirds
of the patterns they attempted (Meyer & Aurnout, 2006).
Software design techniques are difficult to apply to a broader range of problems. Design patterns provide
general solutions, documented in a format that does not require specifics tied to a particular problem.
Design patterns are composed of several sections. Of particular interest are the Structure, Participants, and
Collaboration sections. These sections describe a design motif: a prototypical micro-architecture that
developers copy and adapt to their particular designs to solve the recurrent problem described by the design
pattern. A micro-architecture is a set of program constituents (e.g., classes, methods...) and their relationships.
Developers use the design pattern by introducing in their designs this prototypical micro-architecture, which
means that micro-architectures in their designs will have structure and organization similar to the chosen
design motif.
Efforts have also been made to codify design patterns in particular domains, including use of existing design
patterns as well as domain specific design patterns. Examples include user interface design patterns (Laakso,
2003) secure design (Heer & Agrawala, 2006), "secure usability" (Dougherty et al, 2009), Web design
(Garfinkel, 2005) and business model design
The annual Pattern Languages of Programming Conference proceedings include many examples of domain-
specific patterns.
Verification and validation (V&V) is the process of checking that a software system meets specifications
and that it fulfills its intended purpose. It may also be referred to as software quality control. It is normally
the responsibility of software testers as part of the software development lifecycle. In simple terms,
software verification is: "Assuming we should build X, does our software achieve its goals without any
bugs or gaps?" On the other hand, software validation is: "Was X what we should have built? Does X
meet the high level requirements?"
The software design should undergo verification and validation. What's the difference between validation
and verification? Put simply, design validation determines if you are building the right product. Does
the device work as intended for the end users? Design verification determines if you’re building the
product right. Are design outputs matching design inputs?
Design Validation
• Identification of unstable components/functionalities
• Validation focused on Error-Handling: complementary (not concurrent!) validation regarding the one
performed by the Development team (More for the Money, More for the Time)
• Compliance with Software and System Requirements
• Black box testing and White box testing techniques
• Experience based techniques
SUMMARY
The Class Diagram is the building block of object-oriented analysis and design. The initial class diagram
that models domain objects should be refined during latter iterations and transformed into a more detailed
version that describes the attributes, characteristics and relationships between classes and between
objects in the system. There are guidelines that need to be followed to successfully map the requirements
specifications during the analysis phase into the design specifications using class diagram. The final
class diagram can then be mapped into source codes for implementation. A design problem which has
been visited and solved in the past may be addressed with the use of a template or pattern describing a
solution to a common problem; this is known as a design pattern. The reuse of such patterns can help
speed up the software development process. The software design should undergo both verification and
validation to make sure components adequate, consistent, stable, maintainable and compliant with
specifications.
REFERENCES
Ralph, P. and Wand, Y. (2009). A proposal for a formal definition of the design concept. In Lyytinen, K.,
Loucopoulos, P., Mylopoulos, J., and Robinson, W., editors, Design Requirements Workshop (LNBIP 14), pp. 103–
136. Springer-Verlag, p. 109 doi:10.1007/978-3-540-92966-6_6.
Freeman, Peter; David Hart (2004). "A Science of design for software-intensive systems". Communications of the
ACM. 47 (8): 19–21 [20]. doi:10.1145/1012037.10120547. S2CID 14331332.
Booch, Grady; et al. (2004). Object-Oriented Analysis and Design with Applications(3rd ed.). MA, USA: Addison
Wesley. ISBN 0-201-89551-X. Retrieved 30 January 2015.
Suryanarayana, Girish (November 2014). Refactoring for Software Design Smells. Morgan Kaufmann.
p. 258. ISBN 978-0128013977
Judith Bishop. "C# 3.0 Design Patterns: Use the Power of C# 3.0 to Solve Real-World Problems". C# Books from
O'Reilly Media. Retrieved 2012-05-15. If you want to speed up the development of your .NET applications, you're
ready for C# design patterns -- elegant, accepted and proven ways to tackle common programming problems.
Gabriel, Dick. "A Pattern Definition". Archived from the original on 2007-02-09. Retrieved 2007-03-06.
Bishop, Judith. "C# 3.0 Design Patterns: Use the Power of C# 3.0 to Solve Real-World Problems". C# Books from
O'Reilly Media. Retrieved 2012-05-15. If you want to speed up the development of your .NET applications, you're
ready for C# design patterns -- elegant, accepted and proven ways to tackle common programming problems.
Meyer, Bertrand; Arnout, Karine (July 2006). "Componentization: The Visitor Example"(PDF). IEEE
Computer. 39 (7): 23–30. CiteSeerX 10.1.1.62.6082. doi:10.1109/MC.2006.227. S2CID 15328522.
Laakso, Sari A. (2003-09-16). "Collection of User Interface Design Patterns". University of Helsinki, Dept. of
Computer Science. Retrieved 2008-01-31.
Heer, J.; Agrawala, M. (2006). "Software Design Patterns for Information Visualization". IEEE Transactions on
Visualization and Computer Graphics. 12 (5): 853–
60. CiteSeerX 10.1.1.121.4534. doi:10.1109/TVCG.2006.178. PMID 17080809. S2CID 11634997.
Dougherty, Chad; Sayre, Kirk; Seacord, Robert C.; Svoboda, David; Togashi, Kazuya (2009). Secure Design Patterns (PDF). Software
Engineering Institute.
Garfinkel, Simson L. (2005). Design Principles and Patterns for Computer Systems That Are Simultaneously Secure and Usable (Ph.D.
thesis).
"Yahoo! Design Pattern Library". Archived from the original on 2008-02-29. Retrieved 2008-01-31.
"How to design your Business Model as a Lean Startup?". 2010-01-06. Retrieved 2010-01-06.
http://www.gdpro.com/what_is_uml.html
http://coursehero.com
http://www.developer.com/design/article.php
http://www.agilemodeling.com/artifacts/classDiagrms.htm
http://www.dotnetcoders.com/web/learning/dagrams/classdiagrams.aspx
http://www.agilemodeling.com/artifacts/objecctDiagrms.htm
http://www.dotnetcoders.com/web/learning/dagrams/objectdiagrams.aspx
ASSESSMENTS:
1. Construct an architectural diagram based on your previously specified software requirements
(Refer to UML architectural diagrams).
2. Construct structural diagrams to model the software data structure, class structures, and static
behaviors based on previously specified requirements (Refer to UML structural and behavioral
diagrams).
3. Document these diagrams in a Software Design Document IEEE format.
4. Perform design component validation for each subsystem of the software project.
5. Design a preliminary system prototype or working model/version of the software following the
design principles and guidelines you have studied.
6. Discuss what is your most significant learning on software design and why.
7. *Watch the video clip https://www.youtube.com/watch?v=sB2iQSvrcG0. Relate your
learnings from the video with the topic you read from this material. Discuss.
LEARNING OBJECTIVES:
• Translate design specifications into actual programmable lines of code using appropriate
programming language;
• Apply appropriate coding standards in the creation of source codes;
• Apply appropriate techniques in fault tolerance, exception handling, and security in the creation
of source codes;
• Generate a suitable application program interface (API) document relative to the software
component being developed;
• Apply the necessary code review technique for each of the software components created;
• Produce internal and external source code documents using appropriate modeling and
documentation tools;
OVERVIEW:
Coding is the process of transforming the design of a system into a computer language format. This
coding phase of software development is concerned with software translating design specification into
the source code. It is necessary to write internal and external source code documentation so that
conformance of the code to its specification can be easily verified. Coding is done by the coder or
programmers who are independent people than the designer. The goal is not to reduce the effort and
cost of the coding phase, but to cut to the cost of a later stage. The cost of testing and maintenance can
be significantly reduced with efficient coding. Programmers should follow coding standards, concepts,
principles and guidelines, and employ appropriate techniques and programming style to achieve effective
and efficient codes.
READING MATERIALS:
The design model can be more or less close to the implementation model depending on how you
map its classes to classes or similar constructs in the implementation language. For example, you
may give each design class a 1:1 relation to an implementation class. This will lead to a design
model with a seamless traceability to the implementation model, which is appropriate in round-trip-
engineering environments.
In many programming languages it is possible to separate the class interface from its implementation
and eventually place them in separate files. For example, the common style in C++ is to place the
interface of a class in a header (.h) file and the implementation of the class in a .cpp file. Ada has
the concept of package specification and package body, and of subprogram specification and
subprogram body.
Each programming language may offer a number of features that are difficult to "fit" in a general
process framework. For example, in C++ concepts such as virtual base classes, "const" attributes
and methods, abstract methods, friends, and so on have no direct equivalent in other languages.
Conversely, the programming language might have some limitations as to what can be easily
represented. The implementation discipline aims at this general framework for all object-oriented
languages. However, you need to specialize the implementation discipline to really use all
the possibilities and to handle the limitations of each programming language.
In mapping design to code, the UML artifacts created during the design work, the interaction diagrams
and Design Class Diagrams (DCDs) will be used as input to the code generation process. The
Implementation Model are all the implementation artifacts, such as the source code, database definitions,
JSP/XML/HTML pages, and etc. The creation of code in an OO language such as Java or C# is not part
of OOA/D. It is an end goal. Implementation in an object-oriented language requires writing source code
for: 1) Class and interface definitions 2) Method definitions 3) Collection Classes in Code.
Class Definitions are created from Design Class Diagrams (DCD). DCDs describe the class or interface
name, superclasses, operation signatures, and attributes of a class. This is sufficient to create a basic
class definition in an OO language.
Methods are created from Interaction Diagrams The sequence of the messages in an interaction
diagram translates to a series of statements in the method definitions.
The enterItem message is sent to a Register instance; therefore, the enterItem method is defined in class
Register.
Collection Classes in Code One-to-many relationships are common. For example, a Sale must maintain
visibility to a group of many SalesLineItem instances, as shown in Figure In OO programming
languages, these relationships are usually implemented with collection of object.
For example, the Java libraries contain collection classes such as ArrayList. Using ArrayList, the Sale
class can define an attribute that maintains an ordered list of SalesLineItem instances.
Goals of Coding
1. To translate the design of system into a computer language format: The coding is the
process of transforming the design of a system into a computer language format, which can be
executed by a computer and that perform tasks as specified by the design of operation during the
design phase.
2. To reduce the cost of later phases: The cost of testing and maintenance can be significantly
reduced with efficient coding.
3. Making the program more readable: Program should be easy to read and understand. It
increases code understanding having readability and understandability as a clear objective of the
coding activity can itself help in producing more maintainable software.
For implementing our design into code, we require a high-level functional language. A programming
language should have the following characteristics:
• Readability: A good high-level language will allow programs to be written in some methods that
resemble a quite-English description of the underlying functions. The coding may be done in an
essentially self-documenting way.
• Portability: High-level languages, being virtually machine-independent, should be easy to
develop portable software.
• Generality: Most high-level languages allow the writing of a vast collection of programs, thus
relieving the programmer of the need to develop into an expert in many diverse languages.
• Brevity: Language should have the ability to implement the algorithm with less amount of code.
Programs mean in high-level languages are often significantly shorter than their low-level
equivalents.
• Error checking: A programmer is likely to make many errors in the development of a computer
program. Many high-level languages invoke a lot of bugs checking both at compile-time and run-
time.
• Cost: The ultimate cost of a programming language is a task of many of its characteristics.
• Quick translation: It should permit quick translation.
• Efficiency: It should authorize the creation of an efficient object code.
• Modularity: It is desirable that programs can be developed in the language as several separately
compiled modules, with the appropriate structure for ensuring self-consistency among these
modules.
• Widely available: Language should be widely available, and it should be feasible to provide
translators for all the major machines and all the primary operating systems.
Coding Standards
A coding standard lists several rules to be followed during coding, such as the way variables are to be
named, the way the code is to be laid out, error return conventions, etc. General coding standards refers
to how the developer writes code, so here we will discuss some essential standards regardless of the
programming language being used. The following are some example or representative coding
standards:
• Indentation: Proper and consistent indentation is essential in producing easy to read and
maintainable programs. Indentation should be used to:
o Emphasize the body of a control structure such as a loop or a select statement.
o Emphasize the body of a conditional statement
o Emphasize a new scope block
• Inline comments: Inline comments analyze the functioning of the subroutine, or key aspects of
the algorithm shall be frequently used.
• Limiting the use of global: These rules file what types of data can be declared global and what
cannot.
• Structured Programming: For Structured (or Modular) Programming methods, "GOTO"
statements shall not be used as they lead to "spaghetti" code, which is hard to read and maintain..
• Naming conventions for global variables, local variables, and constant identifiers: A
possible naming convention can be that global variable names always begin with a capital letter,
local variable names are made of small letters, and constant names are always capital letters.
• Error return conventions and exception handling system: Different functions in a program
report the way error conditions are handled should be standard within an organization. For
example, different tasks while encountering an error condition should either return a 0 or 1
consistently.
Coding Guidelines
General coding guidelines provide the programmer with a set of the best methods which can be used to
make programs more comfortable to read and maintain. Most of the examples use the C language syntax,
but the guidelines can be tested to all languages. The following are some representative coding
guidelines recommended by many software development organizations.
Line Length: It is considered a good practice to keep the length of source code lines at or below 80
characters. Lines longer than this may not be visible properly on some terminals and tools. Some printers
will truncate lines longer than 80 columns.
Spacing: The appropriate use of spaces within a line of code can improve readability.
Example:
Bad: cost=price+(price*sales_tax)
fprintf(stdout ,"The total cost is %5.2f\n",cost);
Better: cost = price + ( price * sales_tax )
fprintf (stdout,"The total cost is %5.2f\n",cost);
The code should be well-documented: As a rule of thumb, there must be at least one comment line on
the average for every three-source line.
The length of any function should not exceed 10 source lines: A very lengthy function is generally
very difficult to understand as it possibly carries out many various functions. For the same reason, lengthy
functions are possible to have a disproportionately larger number of bugs.
Do not use goto statements: Use of goto statements makes a program unstructured and very tough to
understand.
Error Messages: Error handling is an essential aspect of computer programming. This does not only
include adding the necessary logic to test for and handle errors but also involves making error messages
meaningful.
Programming Style
Programming style refers to the technique used in writing the source code for a computer program. Most
programming styles are designed to help programmers quickly read and understands the program as
well as avoid making errors. (Older programming styles also focused on conserving screen space.) A
good coding style can overcome the many deficiencies of a first programming language, while poor style
can defeat the intent of an excellent language.
The goal of good programming style is to provide understandable, straightforward, elegant code. The
programming style used in a various program may be derived from the coding standards or code
conventions of a company or other computing organization, as well as the preferences of the actual
programmer. Some general rules or guidelines in respect of programming style:
• Clarity and simplicity of Expression: The programs should be designed in such a manner so
that the objectives of the program is clear.
• Naming: In a program, you are required to name the module, processes, and variable, and so
on. Care should be taken that the naming style should not be cryptic and non-representative.
For Example: a = 3.14 * r * r
area of circle = 3.14 * radius * radius;
• Control Constructs: It is desirable that as much as a possible single entry and single exit
constructs used.
• Information hiding: The information secure in the data structures should be hidden from the rest
of the system where possible. Information hiding can decrease the coupling between modules
and make the system more maintainable.
• Nesting: Deep nesting of loops and conditions greatly harm the static and dynamic behavior of a
program. It also becomes difficult to understand the program logic, so it is desirable to avoid deep
nesting.
• User-defined types: Make heavy use of user-defined data types like enum, class, structure, and
union. These data types make your program code easy to write and easy to understand.
• Module size: The module size should be uniform. The size of the module should not be too big
or too small. If the module size is too large, it is not generally functionally cohesive. If the module
size is too small, it leads to unnecessary overheads.
• Module Interface: A module with a complex interface should be carefully examined.
• Side-effects: When a module is invoked, it sometimes has a side effect of modifying the program
state. Such side-effect should be avoided where as possible.
Source Adapted from : https://www.javatpoint.com/software-engineering-coding
Recovery Blocks
The recovery block method is a simple method developed by Randell from what was observed as
somewhat current practice at the time. [Lyu95] The recovery block operates with an adjudicator which
confirms the results of various implementations of the same algorithm. In a system with recovery blocks,
the system view is broken down into fault recoverable blocks. The entire system is constructed of these
fault tolerant blocks. Each block contains at least a primary, secondary, and exceptional case code along
with an adjudicator. (It is important to note that this definition can be recursive, and that any component
may be composed of another fault tolerant block composed of primary, secondary, exceptional case, and
adjudicator components.) The adjudicator is the component which determines the correctness of the
various blocks to try. The adjudicator should be kept somewhat simple in order to maintain execution
speed and aide in correctness. Upon first entering a unit, the adjudicator first executes the primary
alternate. (There may be N alternates in a unit which the adjudicator may try.) If the adjudicator
determines that the primary block failed, it then tries to roll back the state of the system and tries the
secondary alternate. If the adjudicator does not accept the results of any of the alternates, it then invokes
the exception handler, which then indicates the fact that the software could not perform the requested
operation.
Recovery block operation still has the same dependency which most software fault tolerance systems
have: design diversity. The recovery block method increases the pressure on the specification to be
specific enough to create different multiple alternatives that are functionally the same. This issue is further
discussed in the context of the N-version method.
The recovery block system is also complicated by the fact that it requires the ability to roll back the state
of the system from trying an alternate. This may be accomplished in a variety of ways, including hardware
support for these operations. This try and rollback ability has the effect of making the software to appear
extremely transactional, in which only after a transaction is accepted is it committed to the system. There
are advantages to a system built with a transactional nature, the largest of which is the difficult nature of
getting such a system into an incorrect or unstable state. This property, in combination with checkpointing
and recovery may aide in constructing a distributed hardware fault tolerant system.
N-version Software
The N-version software concept attempts to parallel the traditional hardware fault tolerance concept of
N-way redundant hardware. In an N-version software system, each module is made with up to N different
implementations. Each variant accomplishes the same task, but hopefully in a different way. Each version
then submits its answer to voter or decider which determines the correct answer, (hopefully, all versions
were the same and correct,) and returns that as the result of the module. This system can hopefully
overcome the design faults present in most software by relying upon the design diversity concept. An
important distinction in N-version software is the fact that the system could include multiple types of
hardware using multiple versions of software. The goal is to increase the diversity in order to avoid
common mode failures. Using N-version software, it is encouraged that each different version be
implemented in as diverse a manner as possible, including different tool sets, different programming
languages, and possibly different environments. The various development groups must have as little
interaction related to the programming between them as possible. [Avizienis85] N-version software can
only be successful and successfully tolerate faults if the required design diversity is met.
The dependence on appropriate specifications in N-version software, (and recovery blocks,) can not be
stressed enough. The delicate balance required by the N-version software method requires that a
specification be specific enough so that the various versions are completely inter-operable, so that a
software decider may choose equally between them, but cannot be so limiting that the software
programmers do not have enough freedom to create diverse designs. The flexibility in the specification
to encourage design diversity, yet maintain the compatibility between versions is a difficult task, however,
most current software fault tolerance methods rely on this delicate balance in the specification.
The N-version method presents the possibility of various faults being generated, but successfully masked
and ignored within the system. It is important, however, to detect and correct these faults before they
become errors. First, the classification of faults applied to N-version software method: if only a single
version in an N-version system, the error is classified as a simplex fault. If M versions within an N-version
system have faults, the the fault is declared to be an M-plex fault. M-plex faults are further classified into
two classes of faults of related and independent types. Detecting, classifying, and correcting faults is an
important task in any fault tolerant system for long term correct operation.
The differences between the recovery block method and the N-version method are not too numerous,
but they are important. In traditional recovery blocks, each alternative would be executed serially until an
acceptable solution is found as determined by the adjudicator. The recovery block method has been
extended to include concurrent execution of the various alternatives. The N-version method has always
been designed to be implemented using N-way hardware concurrently. In a serial retry system, the cost
in time of trying multiple alternatives may be too expensive, especially for a real-time system. Conversely,
concurrent systems require the expense of N-way hardware and a communications network to connect
them. Another important difference in the two methods is the difference between an adjudicator and the
decider. The recovery block method requires that each module build a specific adjudicator; in the N-
version method, a single decider may be used. The recovery block method, assuming that the
programmer can create a sufficiently simple adjudicator, will create a system which is difficult to enter
into an incorrect state. The engineering tradeoffs, especially monetary costs, involved with developing
either type of system have their advantages and disadvantages, and it is important for the engineer to
explore the space to decide on what the best solution for his project is.
Self-Checking Software
Self checking software is not a rigorously described method in the literature, but rather a more ad hoc
method used in some important systems. [Lyu95] Self-checking software has been implemented in some
extremely reliable and safety-critical systems already deployed in our society, including the Lucent ESS-
5 phone switch and the Airbus A-340 airplanes. [Lyu95]
Self-checking software are the extra checks, often including some amount checkpointing and rollback
recovery methods added into fault-tolerant or safety critical systems. Other methods including separate
tasks that "walk" the heap finding and correcting data defects and the options of using degraded
performance algorithms. While self-checking may not be a rigorous methodology, it has shown to be
surprisingly effective. The obvious problem with self-checking software is its lack of rigor. Code coverage
for a fault tolerant system is unknown. Furthermore, just how reliable a system made with self-checking
software? Without the proper rigor and experiments comparing and improving self-checking software
cannot effectively be done.
Fault tolerance is defined as how to provide, by redundancy, service complying with the specification in
spite of faults having occurred or occurring. (Laprie 1996). There are some important concepts buried
within the text of this definition that should be examined. Primarily, Laprie argues that fault tolerance is
accomplished using redundancy. This argument is good for errors which are not caused by design faults,
however, replicating a design fault in multiple places will not aide in complying with a specification. It is
also important to note the emphasis placed on the specification as the final arbiter of what is an error and
what is not. Design diversity increases pressure on the specification creators to make multiple variants
of the same specification which are equivalent in order to aide the programmer in creating variations in
algorithms for the necessary redundancy. The definition itself may no longer be appropriate for the type
of problems that current fault tolerance is trying to solve, both hardware and software. Randell argues
that the difference between fault tolerance versus exception handling is that exception handling deviates
from the specification and fault tolerance attempts to provide services compliant with the specification
after detecting a fault [Lyu95], This is an important difference to realize between trying to construct robust
software versus trying to construct reliable software. Reliable software will accomplish its task under
adverse conditions while robust software will be able to indicate a failure correctly, (hopefully without the
entire system failing.)
Source: Adapted from
https://users.ece.cmu.edu/~koopman/des_s99/sw_fault_tolerance/#:~:text=Software%20fault%20tolerance%20is
%20the,in%20accordance%20with%20the%20specification.
Exception handling
Exception handling is the process of responding to the occurrence of exceptions – anomalous or
exceptional conditions requiring special processing - during the execution of a program. In general, an
exception breaks the normal flow of execution and executes a pre-registered exception handler; the
details of how this is done depend on whether it is a hardware or software exception and how the
software exception is implemented. It is provided by specialized programming language constructs,
hardware mechanisms like interrupts, or operating system (OS) inter-process communication (IPC)
facilities like signals. Some exceptions, especially hardware ones, may be handled so gracefully that
execution can resume where it was interrupted.
An alternative approach to exception handling in software is error checking, which maintains normal
program flow with later explicit checks for contingencies reported using special return values, an
auxiliary global variable such as C's errno, or floating point status flags. Input validation, which
preemptively filters exceptional cases, is also an approach.
Software exception handling and the support provided by software tools differs somewhat from what is
understood by exception handling in hardware, but similar concepts are involved. In programming language
mechanisms for exception handling, the term exception is typically used in a specific sense to denote a data
structure storing information about an exceptional condition. One mechanism to transfer control, or raise an
exception, is known as a throw. The exception is said to be thrown. Execution is transferred to a "catch".
From the point of view of the author of a routine, raising an exception is a useful way to signal that a
routine could not execute normally - for example, when an input argument is invalid (e.g. value is outside
of the domain of a function) or when a resource it relies on is unavailable (like a missing file, a hard disk
error, or out-of-memory errors), or that the routine has detected a normal condition that requires special
handling, e.g., attention, end of file. In systems without exceptions, routines would need to return some
special error code. However, this is sometimes complicated by the semipredicate problem, in which users
of the routine need to write extra code to distinguish normal return values from erroneous ones.
Programming languages differ substantially in their notion of what an exception is. Contemporary
languages can roughly be divided into two groups:
• Languages where exceptions are designed to be used as flow control structures: Ada, Java, Modula-
3, ML, OCaml, PL/I, Python, and Ruby fall in this category.
• Languages where exceptions are only used to handle abnormal, unpredictable, erroneous situations:
C++,[8] C#, Common Lisp, Eiffel, and Modula-2.
Kiniry also notes that "Language design only partially influences the use of exceptions, and consequently,
the manner in which one handles partial and total failures during system execution. The other major
influence is examples of use, typically in core libraries and code examples in technical books, magazine
articles, and online discussion forums, and in an organization’s code standards" (Kiniry, 2006).
Contemporary applications face many design challenges when considering exception handling strategies.
Particularly in modern enterprise level applications, exceptions must often cross process boundaries and
machine boundaries. Part of designing a solid exception handling strategy is recognizing when a process
has failed to the point where it cannot be economically handled by the software portion of the process.[9]
Excluding minor syntactic differences, there are only a couple of exception handling styles in use. In the
most popular style, an exception is initiated by a special statement ( throw or raise ) with an exception
object (e.g. with Java or Object Pascal) or a value of a special extendable enumerated type (e.g. with Ada or
SML). The scope for exception handlers starts with a marker clause ( try or the language's block starter
such as begin ) and ends in the start of the first handler clause ( catch , except , rescue ). Several
handler clauses can follow, and each can specify which exception types it handles and what name it uses
for the exception object.
A few languages also permit a clause ( else ) that is used in case no exception occurred before the end of
the handler's scope was reached.
More common is a related clause ( finally or ensure ) that is executed whether an exception occurred or
not, typically to release resources acquired within the body of the exception-handling block. Notably, C++
does not provide this construct, since it encourages the Resource Acquisition Is Initialization (RAII)
technique which frees resources using destructors.
In its whole, exception handling code might look like this (in Java-like pseudocode):
try {
line = console.readLine();
if (line.length() == 0) {
throw new EmptyLineException("The line read from console was empty!");
}
As a minor variation, some languages use a single handler clause, which deals with the class of the
exception internally.
The implementation of exception handling in programming languages typically involves a fair amount of
support from both a code generator and the runtime system accompanying a compiler. (It was the
addition of exception handling to C++ that ended the useful lifetime of the original C++ compiler, Cfront.)
Two schemes are most common. The first, dynamic registration, generates code that continually updates
structures about the program state in terms of exception handling. Typically, this adds a new element to
the stack frame layout that knows what handlers are available for the function or method associated with
that frame; if an exception is thrown, a pointer in the layout directs the runtime to the appropriate handler
code. This approach is compact in terms of space, but adds execution overhead on frame entry and exit.
It was commonly used in many Ada implementations, for example, where complex generation and
runtime support was already needed for many other language features. Dynamic registration, being fairly
straightforward to define, is amenable to proof of correctness.
The second scheme, and the one implemented in many production-quality C++ compilers, is a table-
driven approach. This creates static tables at compile time and link time that relate ranges of the program
counter to the program state with respect to exception handling. Then, if an exception is thrown, the
runtime system looks up the current instruction location in the tables and determines what handlers are
in play and what needs to be done. This approach minimizes executive overhead for the case where an
exception is not thrown. This happens at the cost of some space, but this space can be allocated into
read-only, special-purpose data sections that are not loaded or relocated until an exception is actually
thrown. This second approach is also superior in terms of achieving thread safety[
Other definitional and implementation schemes have been proposed as well.[For languages that
support metaprogramming, approaches that involve no overhead at all (beyond the already present
support for reflection) have been advanced (Hof et al, 2016).
Program Documentation
Many corporate or organizational standards and procedures focus on the descriptions accompanying a
collection of programs. We consider program documentation to be the set of written descriptions that
accompany programs in order to explain to a reader what the programs do and how they do it. Internal
documentation is descriptive material written directly within the programs; all other documentation is
external documentation.
Internal Documentation
The internal documentation contains information directed at someone who will be reading the source
code of our program. Thus, summary information is provided to a reader to identify the program and
describe its data structures, algorithms, and control flow. This summary information is placed at the
beginning of the program module in a set of comments called the header comment block.
Header Comment Block. Just as a good newspaper reporter must include the who, what, where, when,
why, and how in a story, you must include the following information in the header comment block:
1. What your program is
2. Who wrote the program
3. Where the program fits in the general system designs
4. When the program was written and revised
5. Why the program exists
6. How your program uses its data structures, algorithms, and control
Although the order in which the elements of the header comment block are listed can vary, it is usually
subject to any formal standards that apply to the project. No matter what the standard for your particular
project is, it is important to include all of the above information in your header comment block. Here is
how a typical header comment block for a comment block for a text processing module might look:
PROGRAM SCAN – Program to scan a line for a given character
PROGRAMMER: Beatrice Clarman (718)345-6789
CALLING SEQUENCE: CALL SCAN(LENGTH,CHAR)
where ‘LENGTH’ is the length of the line to be scanned, ‘CHAR’ is the character to be sought,
line of text passed as array ‘NTEXT’.
VERSION 1: written 1-12-89
REVISION 1.1: 2-3-90 improve searching algorithm.
PURPOSE: General-purpose scanning module to be used for each new line of text, no
matter the length.
DATE STRUCTURES: Variable LENGTH – INTEGER
Variable CHAR – CHARACTER
ARRAY NTEXT – CHARACTER array of length ‘LENGTH’
ALGORITHM: Reads array NTEXT one character at a time; if CHAR is found, posi-
tion in NTEXT returned in variable ‘LENGTH’; else variable ‘LENGTH’ set 0
Other Program Comments. The header comment block acts as an introduction to your program, much
as an introduction to a book explains its purpose. Additional comments enlighten readers as they move
through your program. If the organization of the code reflects a well-structured design, of the statements
are formatted clearly, and if the labels, variable, and data names are descriptive and easy to distinguish,
then the necessary number of additional comments is small. By following the guidelines in this chapter
for code format and structure, the code acts as a source of information about itself.
Comments have a place even in clearly structured and well-written code. Although clarity of code and
structure minimize the need for other comments, additional comments are needed wherever useful
information can be added to a program module. Comments can play other roles besides providing a line-
by-line explanation of what the program is doing. For example, comments can break a program into
phases that represents major activities. The code for an activity is usually no more than one age in length.
Then, an individual activity may be separated by comments into smaller steps, each only several lines of
code in length. Pseudocode from your program design can serve this purpose and remind you of the
functions involved.
When code is revised, programmers sometimes forget to update the comments to reflect the change. It
is essential that your comments agree with what the code is actually doing. In addition, be sure that every
comment adds new information. For example, it is of no use to write
13 – 13 + 1 ; INCREMENT 13
when you can add substantially more information by writing
13 – 13 + 1 ; SET COUNTER TO READ NEXT CASE
Ideally, the parameter names should help to explain the activity being performs:
CASE_COUNTER – CASE COUNTER + 1
Your comments should be written as you write the code itself, not afterward. By beginning with the design
and moving to the final code in stages, the design evolves to pseudocode, which in turn acts as a
framework for your final code and a basis for your comments. As you write in-line comments and explain
what the code is doing, beware of a code that is difficult to comments. If you are having problems writing
understandable comments about complex code, you may need to redesign your code in some way.
Meaningful Variable Names and Statement Labels. Choose names for your variables and statements
that reflect use or meaning. Writing
WEEKWAGE – (HRRATE * * HOURS) + (.5) * (HRRATE) * (HOURS - 40.)
Makes much more sense to the reader than
Z – (A * B) + (.5) * (A) * (B – 40.)
In fact, the first example is likely not to need in any additional comments. Also, you are less likely to
introduce errors into your program when the statements labels and variable names are meaningful.
Similarly, alphabetic statement labels should tell readers something about what the labeled section of
your program does. If the labels are numeric or incorporate numbers, they should be in ascending order
and clustered by related purpose.
Formatted to Enhance Understanding. The format of your comments can help a reader understand what
the code is doing and how. Indentation and spacing of statements can reflect the basic control structures.
Notice how unintended code like this
IF XCOORD < YCOORD
THEN RESULT – -1;
ELSE IF XCOORD – YCOORD
THEN IF SLOPE1 > SLOPE2
THEN RESULT – 0;
ELSE RESULT – 1 ;
ELSE IF SLOPE1 > SLOPE2
THEN RESULT – 2;
ELSE IF SLOPE1 < SLOPE2
THEN RESULT – 2;
ELSE RESULT – 4;
Documenting Data. One of the most difficult things for readers of a program to understand is the way in
which data are structured and used. A “map” of the data is very useful in interpreting the actions of lines
of code, especially when a system handles many files of varying types and purposes, coupled with flags
and passed parameters. Thus, internal documentation should include descriptions of the data structures
and uses. Be sure to list major variables in the header control block and any default values for each
variable. A data entry in the header control block may look like this one:
{ DATA STRUCTURES: }
{ DAMLOC contains }
( dam locations and height )
{ DEFAULT VALUES: read from tape )
{ WATERQUAL to store }
{ water quality data from sensors }
( DEFAULT WALUES: initialized to 0 }
External Documentation
Whereas internal documentation is concise and written at a level appropriate for a programmer, external
documentation is intended to be read also by those who may never look at the actual code. For instance,
system or program designers may review the external documentation when considering modifications or
enhancements to the system. In addition, in the external documentation you have a chance to explain
things more broadly than might be reasonable within your program’s comments. Of you consider the
header comment block to be an overview or summary of your program, then the external documentation
can be considered the full-blown report. It answers the same questions—who, what, why, when, where,
and how—using a system rather than a module, perspective.
Because a software system is built from interrelated modules, the external documentation often includes
an overview of the mosules comprising the system or of several groupings of system modules. Diagrams,
accompanied by narrative describing each module, show how data structures are shared and used by
one or more modules; in general, the overview describes how information is passed from one module to
another. Object classes and their inheritance hierarchy are explained here as are reasons for defining
special types or categories of data.
External program documentation is part of the overall system documentation. At the time the program is
written, much of the rationale for the program structure and flow have already been detailed in the system
and program design documents. In a sense, the program design is the skeleton of the external
documentation; the flesh is supplied by narrative discussing the particulars of the program.
Describing the Problem. In the first section of the external documentation, you explain what problem is
being addressed by the program. This section sets the stage for describing what options were considered
for solutions and why a particular solution was chosen. The problem description is not a repeat of the
requirements description that resulted from the requirements analysis. Rather, it is a general discussion
of the setting: when this program is called and why it is needed.
Describing the Algorithm. Once you make clear why the program exists, you should address the choice
of algorithms. Each algorithm used by the program is discussed in detail in a narrative form. All formulae
are included, and boundary or special conditions are discussed. When appropriate, include the derivation
of the algorithm or a reference to it in some other source (such as the program design, a journal article,
or a textbook).
If an algorithm deals with special cases, be sure to discuss the cases and explain how each special case
is derived and handled. Of certain cases are not handled because they will never be encountered, the
documentation should explain why they will not be encountered. For example, an algorithm may involve
a formula where one variable expression is derived by another. The documentation should discuss the
possibility that the denominator is zero, an explanation of how the program handles the formula and
subsequent calculations should be included; if it is impossible for the denominator to be zero, then your
document addresses why this case will never occur.
Describing the Data. In the external documentation, users or programmers can see the data flow through
the system at a program module level. Thus, data flow diagrams accompany any description of a program
design; the external documentation can refer to the design but should also describe the layout in a
narrative form. For a set of object-oriented programs, an overview of objects and classes should explain
the general interaction of objects.
Here is a real-life API example. You may be familiar with the process of searching flights online. Just like
the restaurant, you have a variety of options to choose from, including different cities, departure and
return dates, and more. Let us imagine that you’re booking you are flight on an airline website. You
choose a departure city and date, a return city and date, cabin class, as well as other variables. In order
to book your flight, you interact with the airline’s website to access their database and see if any seats
are available on those dates and what the costs might be. However, what if you are not using the airline’s
website––a channel that has direct access to the information? What if you are using an online travel
service, such as Kayak or Expedia, which aggregates information from a number of airline databases?
The travel service, in this case, interacts with the airline’s API. The API is the interface that, like your
helpful waiter, can be asked by that online travel service to get information from the airline’s database to
book seats, baggage options, etc. The API then takes the airline’s response to your request and delivers
it right back to the online travel service, which then shows you the most updated, relevant information.
API description formats like the OpenAPI/Swagger Specification have automated the documentation
process, making it easier for teams to generate and maintain them.
The third-party developer, who is your API’s main consumer, is busy solving complex programming
challenges. Your API is a means to an end for the technical user, and they want to integrate as quickly
as possible to move forward in their software development, meaning they should immediately understand
the value and usage of your API. The aggregate experience of the developer when discovering, learning
to use, and finally integrating with an API is termed as Developer Experience (DX). API documentation
is the key to a great DX.
In fact, it’s much easier to implement code, than is it to write good documentation. But this is because of
its direct impact on adoption and usage. You can have the best, functional product, but no one will use it
if they don’t know how to. Documentation is the foundation for good Developer Experience.
Improved User Adoption. Adoption patterns are already shifting towards developers in the technology
sphere. One big reason for having good API documentation is that it improves the experience for
developers using your API, which has a direct correlation on API adoption. People adopt products they
enjoy using, and the same holds true with your API. If you get your documentation right, more people will
find value in your services easily, leading to better growth and adoption.
Increased Awareness. Users beget users. The network effect is the phenomenon when a service or
product becomes more valuable when more people use it. Your satisfied consumers will be the API’s
biggest advocates. As more users adopt your APIs and reach critical mass, there will be a probable
increase in evangelism and word-of-mouth publicity by your satisfied consumers, leading to the network
effect.
Saves Support Time and Costs. In addition to driving increased awareness and adoption for your API,
good documentation also decreases the amount of time spent onboarding new users, be it internal
developers or external partners. Poor or no documentation means more frustrated users relying on your
team to understand how to work with your API. On the contrast, when you give users the ability to try out
the API before implementing it, and arm them with detailed documentation to get started, you’ll save your
team countless hours responding to support emails and calls.
Easier Maintenance. And finally, documentation leads to good product maintenance. It helps your
internal teams know the details of your resources, methods, and their associated requests and
responses, making maintenance and updates quicker.
Documentation is the key to a great experience when consuming your API. It not only enables consumer
satisfaction, but also allows your API adoption to increase. Popular open source description formats like
OpenAPI Specification and commercial platforms like SwaggerHub allow teams to automate the
documentation process and work on a great overall experience consuming APIs.
Code Review, or Peer Code Review, is the act of consciously and systematically convening with one’s
fellow programmers to check each other’s code for mistakes, and has been repeatedly shown to
accelerate and streamline the process of software development like few other practices can. There
are peer code review tools and software, but the concept itself is important to understand. Software is
written by human beings. Software is therefore often riddled with mistakes.
When done correctly, peer reviews save time, streamlining the development process upfront and
drastically reducing the amount of work required later of Quality Assurance teams. Reviews can also
save money, particularly by catching the types of bugs that might slip undetected through testing, through
production, and into the end-users’ laptops.
Work environments that encourage programmers to talk with each other about their code tend to foster
greater communication and camaraderie, distribute the sense of "ownership" for any piece of code, and
provide an invaluable educational context for junior developers—as senior colleagues demonstrate,
through real instances, better ways to write clean code, solve common problems with useful shortcuts,
and visually identify any number of potential troublespots, such as memory leaks, buffer overflows, or
scalability issues.
Pair Programming
As one of the hallmarks of Extreme Programming (XP), this approach to writing software puts developers
side by side (at least figuratively), working on the same code together and thereby checking each other’s
work as they go. It’s a good way for senior developers to mentor junior colleagues, and seems to bake
code review directly into the programming process. Yet because authors and even co-authors tend to be
too close to their own work, other methods of code review may provide more objectivity. Pair
programming can also use more resources, in terms of time and personnel, than other methods.
Over-the-Shoulder
More comfortable for most developers than XP’s pair programming, the old over-the-shoulder technique
is the easiest and most intuitive way to engage in peer code review. Once your code is ready, just find a
qualified colleague to site down at your workstation (or go to theirs) and review your code for you, as you
explain to them why you wrote it the way you did. This informal approach is certainly "lightweight," but it
can be a little too light if it lacks methods of tracking or documentation. (Hint: bring a notepad.)
Tool-Assisted
There is arguably no simpler and more efficient way to review code than through software-based code
review tools, some of which are browser-based or seamlessly integrate within a variety of standard IDE
and SCM development frameworks. Software tools solve many of the limitations of the preceding
approaches above, tracking colleagues’ comments and proposed solutions to defects in a clear and
coherent sequence (similar to tracking changes in MS Word), enabling reviews to happen
asynchronously and non-locally, issuing notifications to the original coder when new reviews come in,
and keeping the whole process moving efficiently, with no meetings and no one having to leave their
desks to contribute. Some tools also allow requirements documents to be reviewed and revised and,
significantly, can also generate key usage statistics, providing the audit trials and review metrics needed
for process improvement and compliance reporting.
Not only was it determined that Cisco’s code review process detected far more bugs, or defects, than
regular testing alone could have uncovered, but the metrics (derived from such a large sample set)
allowed the researchers to glean the following crucial insights about code review in general:
• Lines of code (LOC) under review should be less than 200, not exceeding 400, as anything larger
overwhelms reviewers and they stop uncovering defects.
• Inspection rates of less than 300 LOC/hour result in the best defect detection, and rates under 500
are still good, but expect to miss a significant percentage of defects if LOC are reviewed faster than
that.
• Authors who prepare the review with annotations and explanations have far fewer defects than those
that do not. The cause, presumably, is due to authors being forced to self-review their code.
• The total review time should be less than 60 minutes, not to exceed 90. Defect detection rates
plummet after 90 minutes of reviewing.
• Expect defect rates at around 15 per hour. This rate can only be higher with less than 175 LOC under
review.
In another case study, recorded in the same ebook, the SmartBear team reported that one customer
wanted to reduce the high cost of fielding customer support calls each year, which they determined cost
them $33 per call. Starting at 50,000 calls a year, within a few years after systematic code review
procedures were implemented to both remove software defects (because computer glitches would initiate
random calls to the customer support department) and to improve usability (to reduce the number of
bewildered customers calling tech support), the frequency of support calls had dropped down to just
20,000 per year (despite even a 200% increase in product sales)—equaling a cool $2.6 million in savings.
BOOK REFEERENCES:
• Kiniry, J. R. (2006). "Exceptions in Java and Eiffel: Two Extremes in Exception Design and
Application". Advanced Topics in Exception Handling Techniques. Lecture Notes in Computer
Science. 4119. pp. 288–300. doi:10.1007/11818502_16. ISBN 978-3-540-37443-5.
• Graham Hutton, Joel Wright, "Compiling Exceptions Correctly Archived 2014-09-11 at
the Wayback Machine". Proceedings of the 7th International Conference on Mathematics of
Program Construction, 2004.
• Schilling, Jonathan L. (August 1998). "Optimizing away C++ exception handling". SIGPLAN
Notices. 33 (8): 40–47. doi:10.1145/286385.286390. S2CID 1522664.
• M. Hof, H. Mössenböck, P. Pirkelbauer, "Zero-Overhead Exception Handling Using
Metaprogramming Archived 2016-03-03 at the Wayback Machine", Proceedings SOFSEM'97,
November 1997, Lecture Notes in Computer Science 1338, pp. 423-431.
ASSESSMENTS:
1. Translate your software design specifications into actual programmable lines of code using
appropriate programming language, appropriate coding standards, coding style/principles and
internal header/documentation. Generate a suitable application program interface (API)
document when necessary.
2. Perform code review applying appropriate technique for each of the software components
created.
3. Produce internal and external source code documents using appropriate modeling and
documentation tools.
4. Discuss what is your most significant learning in software design implementation topics and why.
8. SOFTWARE TESTING
LEARNING OBJECTIVES:
• Explain various software testing activities needed in the evaluation of a software;
• Design test cases needed for internal and external tests;
• Construct test plan and test cases for proper implementation of software testing.
• Describe other software quality assurance activities
OVERVIEW:
Testing is significant to delivering defect free-software. It is one of the software quality assurance activities
that should be performed in any software project. The testing phase focuses on identifying all defects
that may be present in the program code. Every piece of code written needs to be tested. Careful testing
can help expose most of the errors/defects existing in a program, and therefore provides a practical way
of reducing defects in a system. Testing a code involves forming test cases (set of test inputs) and
providing it to the program and then verify if the system behaves as expected for these set of inputs. At
first each module is tested in isolation and errors or defects, are removed. Next required modules are
integrated and tested again to check for any defect or failure after modules were integrated. For any type
of test, test cases are designed and executed These test cases are documented in the Test Plan.
READING MATERIALS:
Unit Testing.
Once the module is coded and reviewed, unit testing of the module in isolation is performed.
Every individual module needs to undergo unit testing procedure before they are integrated to one
another. This helps in detecting errors or bugs in the code that may result in failure of the software
product. Unit testing is referred to as testing in small.
To proceed with unit testing:
1. unit test case has to be designed.
2. test environment for the unit that would be tested needs to be developed
Driver and Stub modules. The complete environment is required to unit test an individual module. This
complete environment simply means:
• The methods of other modules that would get called by the module under unit testing.
• Non local data structure that the module under test access.
• A procedure with proper parameter to call the methods of the module under test.
All the above modules and their methods will not be available until they are ready and unit tested. So
there are two options, either wait for the other modules to get ready or provide the dummy methods and
modules to proceed with unit testing of the ready module. For this, driver and stub are designed which
provides the dummy environment to carry out the unit testing.
A stub is a dummy procedure that contains the same input output parameters that as the given procedure
in the module under unit test. Stub procedures has a very simplified behavior. For instance, stub may
use a simple table look up to produce the expected result.
A driver module contains the non-local data structures that is referred by the module under the test.
Moreover, it should also have the code to call the different functions of the module under test with
appropriate parameter value for testing.
integration Testing.
Once all the modules or at least the required modules are unit tested successfully, integration testing is
carried out. After unit testing is completed, to a large extent, it ensures that unit as a whole works
satisfactorily. In this context, the objective of integration testing is to detect the errors at the module
interfaces (call parameters). For instance, when a module invokes the functionality of the other modules,
then parameter mismatch may occur. Integration testing helps detect that no parameter mismatch occurs
in such cases. The main aim of the integration testing in software engineering is to test, check and ensure
that different modules of the program interface with each other properly. Integration is done based on
planned manner. The integration plan defines the steps and order in which the modules are combined to
create a system. After two modules are integrated, then it is tested for any error or fault. Module
dependency graph is the important factor that guides the integration plan.
The test plan for integration testing can be carried out using any of the following approaches or types of
integration testing:
1. Big bang integration approach
2. Top-down integration approach
3. Bottom-up approach
4. Mixed or sandwiched approach
Big-bang integration testing works on the logic that all the individual modules that makes up the
complete system are integrated together in a single step. This means that all the individual modules or
units are linked together in one go and then tested for any fault or errors.
Top-down integration testing begins with the top most module also called the root module. After the
top-level module is tested then the modules present at the immediate lower layer are picked up,
integrated and unit tested. Top-down integration testing approach requires the use of program stubs. A
pure top-down approach does not require any driver routine.
Mixed integration testing is also referred to as sandwiched integration. Mixed integration follows the
combination of bottom-up testing approach and top-down integration testing approach.
System Testing
It is a level of software testing where a complete and integrated software is tested. The purpose of this
test is to evaluate the system’s compliance with the specified requirements. System testing of the
software product is started once the entire modules contributing to completion of system is integrated
and thoroughly tested while integrating each module.
System test cases are designed with intention to cover entire functionalities as mentioned and agreed
upon in SRS document designed during requirement gathering and analysis phase.
Thus, we can say that system test cases are designed to validate the software product upon completion.
Reason for this is that test cases are solely designed based on SRS documented requirements thus
approach of development is not significant while designing system test cases.
The procedure adopted for system testing is same for both the OOP (Object Oriented Programming) and
POP (Procedure Oriented Programming) systems.
Performance based test cases are designed to check if the system meets non-functional requirement
for the software product that is developed. Some example for designing performance based test cases
using black box testing approach are:
• volume testing
• security testing
• stress testing
• regression testing
• usability testing
• configuration testing
• compatibility testing
Structural testing is the type of testing carried out to test the structure of code. It is also known as White
Box testing or Glass Box testing. This type of testing requires knowledge of the code, so, it is mostly done
by the developers. It is more concerned with how system does it rather than the functionality of the
system. It provides more coverage to the testing. For example, to test certain error message in an
application, we need to test the trigger condition for it, but there must be many triggers for it. It is possible
to miss out one while testing the requirements drafted in SRS. But using this testing, the trigger is most
likely to be covered since structural testing aims to cover all the nodes and paths in the structure of code.
It is complementary to Functional Testing. Using this technique, the test cases drafted according to
system requirements can be first analyzed and then more test cases can be added to increase the
coverage. It can be used on different levels such as unit testing, component testing, integration testing,
functional testing etc. Its helps in performing a thorough testing on software. The structural testing is
mostly automated. There are different criteria that are used to perform such testing. Before moving on to
those, it is important to understand some terms.
Control Flow Graph: It is a graphical representation of the program depicting all the paths that may be
transverse during the execution. It contains
• Basic Block or Node: It is a sequence of statements such that control can only have one entry
point and can exit the block only when all the statements have been executed.
• Edge:It shows the control flow.
For example following is a control flow graph:
N1, N2, N3, N4 and N5 represents Basic Blocks or Nodes and E1, E2, E3, E4 and E5 represents Edges.
We can also observe that N2, N3, N4 and N5 together represent an IF loop.
Adequacy Criterion: This term refers to the coverage provided by a test suite.
Branch Coverage: It is also known as Decision coverage testing. It aims to test all the branches or edges
at least once in the test suite or to test each branch from a decision point at least once. It provides solution
for the problem faced in Statement coverage. Branch E4 will be covered here as we saw in previous
example. Branch Testing provides a better coverage than Statement testing but it too has its
shortcomings. It doesn’t provide a good coverage from different conditions that lead from node 1 to node
2 as it covers that branch only once. Let’s try to understand it better with the help of following example.
Condition Coverage: It aims to test individual conditions with possible different combination of Boolean
input for the expression. It is modification of Decision coverage but it provides better coverage and the
problem discussed under Branch coverage can be resolved here. Notice the different combination of
inputs in the following table
S.No. A B A or B
1 0 0 0
2 0 1 1
3 1 0 1
4 1 1 1
However, when compound conditions are involved the no. of test cases may increase exponentially,
which is not desired.
Path Coverage: It aims to test the different path from entry to the exit of the program, which is a
combination of different decisions taken in the sequence. The paths can be too many to be considered
for testing, for ex, a loop can go on and on. It can be avoided using cyclomatic complexity, which help in
finding out the redundant test cases. Cyclomatic Complexity is quantitative measure of no. of linearly
independent paths through a program and is used to indicate complexity of a program. So, cyclomatic
complexity helps aiming to test all linearly independent paths in a program at least once.
Tools Required:
Some of the test tools that are used for White box or Structural Testing are as follow:
1. JBehave
2. Cucumber
3. Junit
4. Cfix
Cyclomatic Complexity is a source code complexity measurement that is being correlated to a number
of coding errors. It is calculated by developing a Control Flow Graph of the code that measures the
number of linearly-independent paths through a program module. Lower the Program's cyclomatic
complexity, lower the risk to modify and easier to understand. It can be represented using the below
formula:
Cyclomatic complexity = E - N + 2*P
where,
E = number of edges in the flow graph.
N = number of nodes in the flow graph.
P = number of nodes that have exit points
Example :
IF A = 10 THEN
IF B > C THEN
A=B
ELSE
A=C
ENDIF
ENDIF
Print A
Print B
Print C
FlowGraph:
The Cyclomatic complexity is calculated using the above control flow diagram that shows seven
nodes(shapes) and eight edges (lines), hence the cyclomatic complexity is 8 - 7 + 2 = 3.
Static Testing or Code Free Testing is a type of software testing in which software application is tested
without code execution. Manual or automated reviews of code, requirement documents and document
design are done in order to find the errors. The main objective of static testing is to improve the quality of
software applications by finding errors in early stages of software development process.
Static testing involves manual or automated reviews of the documents. This review is done during an
initial phase of testing to catch defect early. It examines work documents and provides review comments.
It is also called Non-execution testing or verification testing. Examples of Work documents-
• Requirement specifications
• Design document
• *Source Code (for code-based test)
• Test Plans
• Test Cases
• Test Scripts
• Help or User document
• Web Page content
For code-based testing, the code free or static testing is a technique performed without the execution of
code. The static testing techniques such as code walkthrough, inspection, review and static analysis are
part of code free testing.
• Review - Typically used to find and eliminate errors or ambiguities in documents
• Walkthrough - a type of review where a programmer leads the review process and the other team
members ask questions and spot possible errors against development standards
• Code inspection – examines the code for the presence of common programming errors
• Static analysis - The code written by developers are analyzed (usually by tools) for structural
defects that may lead to defects.
Code Review is a systematic examination, which can find and remove the vulnerabilities in the code
such as memory leaks and buffer overflows.
• Also called technical reviews, these are well documented and use a well-defined defect detection
process that includes peers and technical experts.
• It is ideally led by a trained moderator, who is NOT the author.
• This kind of review is usually performed as a peer review without management participation.
• Reviewers prepare for the review meeting and prepare a review report with a list of findings.
• Reviews may be quite informal or very formal and can have a number of purposes but not limited
to discussion, decision making, evaluation of alternatives, finding defects and solving technical
problems.
Code Inspection aims at examining the code for the presence of common programming error. It checks
for:
• error that creep into the code due to programmar oversight
• whether coding standard is followed while coding
Software organizations generally keeps record of the different types of error that is committed by their
programmers. They also identify the errors that are commonly committed. This kind of records serves as
checklist during code inspection to look out for common error.
Given below is the sample of some common errors that can be checked for during code inspection:
• Array indices out of bound
• Arithmetic exceptions
• Use of uninitialized variables
• Non terminating loops
• Mismatch between actual and formal parameters
• Comparison of equality of floating point values
• Jump into loops
While doing code inspection it is likely that these errors can be discovered by specifically looking for this
kind of mistakes in the code. Apart from looking and correcting for coding error this process also makes
sure that code adheres to coding standards and guidelines.
Source: https://tutorialsinhand.com/tutorials/software-engineering-tutorial/software-coding/code-inspection.aspx
Static Analysis - By Tools. Static analysis tools are generally used by developers as part of the
development and component testing process. The key aspect is that the code (or other artefact) is not
executed or run but the tool itself is executed, and the source code we are interested in is the input data
to the tool. These tools are mostly used by developers. Static analysis tools are an extension of compiler
technology – in fact some compilers do offer static analysis features. It is worth checking what is available
from existing compilers or development environments before looking at purchasing a more sophisticated
static analysis tool. Other than software code, static analysis can also be carried out on things like, static
analysis of requirements or static analysis of websites (for example, to assess for proper use of
accessibility tags or the following of HTML standards). Static analysis tools for code can help the
developers to understand the structure of the code, and can also be used to enforce coding standards.
Following are the types of defects found by the tools during static analysis:
• A variable with an undefined value
• Inconsistent interface between modules and components
• Variables that are declared but never used
• Unreachable code (or) Dead Code
• Programming standards violations
• Security vulnerabilities
• Syntax violations
• Requirement Analysis — Requirement Analysis is the first step involved in Software testing life
cycle. In this step, Quality Assurance (QA) team understands the requirement in terms of what we
will testing & figure out the testable requirements.
• Test Planning — Test Planning is the most important phase of Software testing life cycle where all
testing strategy is defined. This phase is also called as Test Strategy phase. In this phase, Test
Manager is involved to determine the effort and cost estimates for the entire project. It defines the
objective & scope of the project.
• Test Case Development — The Test case development begins once the test planning phase is
completed. This is the phase of STLC where testing team notes the detailed test cases. Along with
test cases, a testing team also prepares the test data for testing. Once the test cases are ready then
these test ases are reviewed by peer members or QA lead.
• Test Environment Setup — Setting up the test environment is a vital part of the Software Testing
Life Cycle. A testing environment is a setup of software and hardware for the testing teams to execute
test cases. It supports test execution with hardware, software and network configured.
• Test Execution — The next phase in the Software Testing Life Cycle is Test Execution. Test
execution is the process of executing the code and comparing the expected and actual results. When
test execution begins, the test analysts start executing the test scripts based on test strategy allowed
in the project.
• Test Cycle Closure — The final phase of the Software Testing Life Cycle is Test Cycle Closure. It
involves calling out the testing team member meeting & evaluating cycle completion criteria based on
Test coverage, Quality, Cost, Time, Critical Business Objectives, and Software.
Source: Adapted from https://medium.com/edureka/types-of-software-testing-d7aa29090b5b
Test Plan
A test plan is a document describing software testing scope and activities. It is the basis for formally
testing any software / product in a project. A test plan describes the scope, approach, resources and
schedule of intended test activities. It identifies amongst others test items, the features to be tested, the
testing tasks, who will do each task, degree of tester independence, the test environment, the test design
techniques and entry and exit criteria to be used, and the rationale for their choice, and any risks requiring
contingency planning. It is a record of the test planning process.
At the beginning of the project, the test plan can be a draft or with very little details. But, as the project
progresses and more information becomes available, the test plan needs to be fleshed out. Test planning
is a continuous activity and is performed throughout the product’s life cycle.
Types of Test Plans:
1. Master Test Plan: A single high-level test plan for a project / product that unifies all other test
plans.
2. Test Level Specific Plan: Test plans for each level of testing:
Unit Test Plan
Integration Test Plan
System Test Plan
Acceptance Test Plan
3. Testing Type Specific: Test plans for specific types of testing like Performance Test Plan
and Security Test Plan.
Test Plan Template. The format and content of a software test plan vary depending on the processes,
standards, and test management tools being implemented. Nevertheless, the following format, which is
based on IEEE standard for software test documentation, provides a summary of what a test plan can /
should contain.
• Test Plan Identifier: Provide a unique identifier for the document. (Adhere to the Configuration
Management System if you have one.)
• Introduction: Provide an overview of the test plan. Specify the goals / objectives. Specify any
constraints.
• References: List the related documents, with links to them if available, including the Project Plan
and Configuration Management Plan
• Test Items: List the test items (software / products) and their versions.
• Features to be Tested: List the features of the software / product to be tested. Provide references
to the requirements and/or Design specifications of the features to be tested.
• Features Not to Be Tested: List the features of the software / product which will not be tested.
Specify the reasons these features won’t be tested.
• Approach: Mention the overall approach to testing. Specify the following:
o Testing levels [if it’s a Master Test Plan],
o Testing types
o Testing methods
• Item Pass / Fail Criteria: Specify the criteria that will be used to determine whether each test
item has passed or failed testing.
• Suspension Criteria and Resumption Requirements: Specify criteria to be used to suspend
the testing activity. Specify what is required before testing can resume.
• Test Deliverables: List test deliverables, and links to them if available, including the following:
Test Plan (this document itself), Test Cases, Test Scripts, Test Data, Defect Reports, Test
Reports
• Test Environment: Specify the properties of test environment: hardware, software, network, etc.
List any testing or related tools.
• Estimate: Provide a summary of test estimates (cost or effort) and/or provide a link to the detailed
estimation.
• Schedule: Provide a summary of the schedule, specifying key test milestones, and/or provide a
link to the detailed schedule.
• Staffing and Training Needs: Specify staffing needs by role and required skills. Identify training
that is necessary to provide those skills, if not already acquired.
• Responsibilities: List the responsibilities of each team / role / individual.
• Risks: List the risks that have been identified. Specify the mitigation plan and the contingency
plan for each risk.
• Assumptions and Dependencies: List the assumptions that have been made during the
preparation of this plan. List the dependencies.
• Approvals: Specify the names and roles of all persons who must approve the plan. Provide space
for signatures and dates. (If the document is to be printed.)
Basically, test design is the act of creating and writing test suites for testing a software. Test analysis and
identifying test conditions gives us a generic idea for testing which covers quite a large range of
possibilities. But when we come to make a test case we need to be very specific. In fact now we need
the exact and detailed specific input. But just having some values to input to the system is not a test, if
you don’t know what the system is supposed to do with the inputs, you will not be able to tell that whether
your test has passed or failed. Test cases can be documented as described in the IEEE 829 Standard
for Test Documentation.
One of the most important aspects of a test is that it checks that the system does what it is supposed to
do. Copeland says ‘At its core, testing is the process of comparing “what is” with “what ought to be” ‘.
[Copeland, 2003]. If we simply put in some inputs and think that was fun, I guess the system is probably
OK because it didn’t crash, but are we actually testing it? We don’t think so. You have observed that the
system does what the system does but this is not a test. Boris Beizer refers to this as ‘kiddie
testing’ [Beizer, 1990]. We may not know what the right answer is in detail every time, and we can still
get some benefit from this approach at times, but it isn’t really testing. In order to know what the
system should do, we need to have a source of information about the correct behavior of the system –
this is called an ‘oracle’ or a test oracle.
Once a given input value has been chosen, the tester needs to determine what the expected result of
entering that input would be and document it as part of the test case. Expected results include information
displayed on a screen in response to an input. If we don’t decide on the expected results before we run
a test then there might be a chance that we will notice that there is something wildly wrong. However,
we would probably not notice small differences in calculations, or results that seemed to look OK. So we
would conclude that the test had passed, when in fact the software has not given the correct result. Small
differences in one calculation can add up to something very major later on, for example if results are
multiplied by a large factor. Hence, ideally expected results should be predicted before the test is run.
Flow Diagram:
Data Driven Testing can be best understood by the following diagram:
ASSESSMENTS:
1. Explain various software testing activities needed in the evaluation of the software.
2. Discuss the difference between structural tests and static tests.
3. Prepare a Unit Test Plan and Integration Test Plan following the IEEE standard.
4. Design test cases needed for internal and external tests.
5. Discuss what is your most significant learning in software testing topics why.
9. SOFTWARE MAINTENANCE AND CONFIGURATION MANAGEMENT
LEARNING OBJECTIVES:
• Discuss various maintenance processes applied on software development;
• Differentiate the three categories of software maintenance;
• Discuss software maintenance techniques and principles based on best practices.
• Construct a software configuration management plan for proper conduct of software
maintenance.
OVERVIEW:
Software maintenance in software engineering is the modification of a software product after delivery to
correct faults, to improve performance or other attributes. Software maintenance is a very broad activity
that includes error correction, enhancements of capabilities, deletion of obsolete capabilities, and
optimization. Any work done to change the software after it is in operation is considered to be
maintenance work. The purpose is to preserve the value of software over time. The value can be
enhanced by expanding the customer base, meeting additional requirements, becoming easier to use,
more efficient and employing newer technology. Because change is inevitable, mechanisms must be
developed for evaluation, controlling and making modifications. The essential part of software
maintenance requires preparation of an accurate plan during the development cycle.
READING MATERIALS:
There are a number of processes, activities and practices that are unique to maintainers, for example:
• Transition: a controlled and coordinated sequence of activities during which a system is transferred
progressively from the developer to the maintainer;
• Service Level Agreements (SLAs) and specialized (domain-specific) maintenance contracts
negotiated by maintainers;
• Modification Request and Problem Report Help Desk: a problem-handling process used by
maintainers to prioritize, documents and route the requests they receive;
Think Holistically
The next best practice for system administrators is to think holistically about the software stack.
Specifically, subscribe to receive notifications for newly available maintenance releases for the entire
software stack, not just a single application. Let’s consider a typical Datameer installation as an example.
Most commonly, Datameer installations include the following dependencies: operating system, Hadoop,
Java and MySQL. Each of these software elements are maintained on a different schedule and are
distributed as separate software binaries. Correcting or preventing an issue in any one of these elements
will have a positive impact on your users and deems equal attention from the system administrators.
Lastly, when monitoring for new maintenance releases, it’s also important to pay attention to any end-of-
maintenance dates for versions installed in your software stack. Versions that are no longer receiving
maintenance updates at all should trigger an upgrade project to keep your users current.
Review Urgency
As you receive notifications about the availability of new maintenance releases, make it a priority to
review the list of fixes thoroughly. Reviewing this list helps you understand the urgency for when patches
should be applied, especially if multiple system elements have maintenance patches released around
the same time. When reviewing this list, administrators should do their best to review from a user’s
perspective. Specifically, ask yourself the following two questions: what is the benefit of applying this fix?
What is the risk of not applying this fix? Fixes for issues that your users have actually reported are
commonly the most urgent to resolve. At times, there will be several maintenance fixes that are required
for the full software stack. When multiple changes are desired, it is important to rank them from a user’s
perspective so that they can be applied in this order — more on this in the next section.
Test Updates
The next best practice may seem obvious, but so many try to skip it: test the maintenance updates!
Specifically, test the maintenance updates in a non-production replica environment first. When applying
the maintenance updates, I recommend a scientific approach. By scientific, I specifically mean that we
should perform a “control” test without any maintenance updates applied. After that, apply a single
maintenance update and re-run the test suite. The tests are intended to verify two things: (1) that
behaviors that changed matched expectations; and (2) that no unintended changes were observed.
To summarize, the testing process should have three steps: (1) perform a “control” test, (2) apply one
maintenance update and (3) perform a validation test. These three steps should all be performed during
the non-production maintenance window — this allows administrators to measure the duration required
to apply the update can successfully complete during the expected time. For the most conservative
system administrators, it’s also a good practice to test reverting a maintenance update in case production
produces different results than non-production.
Replicate in Production
The final best practice that I want to share is to repeat the steps in production. Emphasis is intended on
the repetition of the steps. This step again takes a scientific approach. Specifically, we’re expecting that
if we perform the same steps in production that we did in non-production that we should get the same
results. No matter how similar the non-production and production environments are to each other, there
will always be some difference in the environment. Since there are differences, it is still recommended to
perform the following three steps: (1) perform a “control” test, (2) apply one maintenance update and (3)
perform a validation test before concluding the maintenance window.
By using these best practices, system administrators can keep users satisfied and productive with regular
maintenance updates.
According to Gartner and Forrester Research, the acronym "SCM" is also expanded as source
configuration management process and software change and configuration management. However,
"configuration" is generally understood to cover changes typically made by a system administrator.
SCM Tools
There are many available tools, beginning with systems such as Revision Control System (RCS) and
Concurrent Versions System (CVS), which have been followed by newer tools such as Subversion (SVN),
Mercurial (Hg) and Git. The basic approach is to create a software repository, usually on a network drive
or online, and then to keep a working copy of the software on your local hard drive. Software changes
are made in the working copy and then checked in to the repository. Conversely, software can
be checked out from the repository to the working copy. This basic approach supports multiple
developers, assuming that they all have access to the repository, but is useful even for a single developer
because the repository maintains a history of all software that was checked in. For example, if your latest
change introduced an error, it is easy to revert back to the previous version or to compare the current
version of the software to the previously working version. Generally, it is also possible to label, or tag, a
particular version of the software, for example, to indicate a particular release.
Another common concept is branches, which enable parallel development of different versions or
features of the software. For example, two programmers can each work on a separate branch, implement
different features, and then later merge their branches back into the main branch (sometimes
called trunk or master).
One of the most popular software configuration management packages is Git, initially released in 2005.
One reason for its popularity is the widespread use of GitHub (www.github.com), which is a code hosting
platform that is based on Git. GitHub provides users with free public repositories and many popular open-
source packages are hosted there. GitHub offers unlimited free hosting of private repositories for
research groups and, for a fee, GitHub also provides private repositories for corporate customers. Many
researchers create and use free GitHub repositories, even in cases where there is only a single
developer.
For collaborative development in large software projects, it is advantageous to have a well-defined
workflow. One popular workflow, that is based on Git and GitHub, is illustrated in Fig. 35.1. This figure
shows the scenario where an organization, org, maintains a public repository, sw_repo, on GitHub. Any
researcher can clone the repository (Step 1), thereby creating a repository (and working copy) on their
computer. For researchers who just wish to use the software, and do not plan to contribute back, this is
sufficient. However, researchers who wish to contribute to sw_repo must do so indirectly, since write
access to the primary repository is generally limited to a few trusted developers. Other researchers can
instead create a forked copy of the repository on their GitHub account and push their changes to that
repository, before issuing a pull request to the maintainers of the original repository. This mechanism
gives the maintainers a convenient way to review the proposed changes and possibly request
modifications, before merging the changes to the original repository. Some steps shown in the figure
below can be done in a different order (e.g., the repository can be forked before being cloned) and other
variations may be necessary. Note that in this workflow, the local repository has two remotes: the original
repository and the forked repository. The reason for keeping a remote to the original repository is to
enable merges from the original repository to incorporate changes that were done in parallel by other
developers.
Source:
Adapted from https://www.sciencedirect.com/topics/computer-science/software-configuration-management
BOOK/JOURNAL REFERENCES
• E. Burt Swanson, The dimensions of maintenance. Proceedings of the 2nd international
conference on Software engineering, San Francisco, 1976, pp 492 — 497".
Portal.acm.org. doi:10.1145/359511.359522. S2CID 14950091. Retrieved 2013-12-02.
• Status of 1219-1998 by IEEE Standards
• Roger S. Pressman (2009). Software Engineering: A Practitioner's Approach (7th
International ed.). New York: McGraw-Hill.
ASSESSMENTS: