1.1 Software Engineering
1.1 Software Engineering
Dr. Sobin C C
Associate Professor
Dept. of CSE
SRM AP
1
What is Software ?
• A program is set of instructions
2
• Write a program to print your name
(any language)
3
Simple Program
#include <stdio.h>
void main()
{
char name [20];
printf(“Enter your name”);
scanf(“%s”, &name);
printf(“your name is: %s”, name);
}
4
Software
• Documentation manuals:
■ Requirement Analysis
⬥ Formal specification, context-diagram, DFD
■ Software Design
⬥ Flow charts, ER
■ Implementation
⬥ Source code, Cross Reference listing
■ Testing
⬥ Test data, Test results
• Operation Manuals :
■ User manuals
■ System overview, Beginners user tutorial, reference guide,
reference guide
■ Operation manuals
■ Installation guide, System administration guide
5
WELL-KNOWN
SOFTWAREENGINEERING FAILURES
• On 4 June 1996 the maiden
flight of the Ariane 5 launcher
ended in a failure. Only about
40 seconds after initiation of
the flight sequence, at an
altitude of about 3700 m, the
launcher diverted off its flight
path, broke up and exploded
6
Reason for Failure -Ariane 5 Rocket
• Integer Over flow
■ An integer overflow occurs when
an arithmetic operation attempts
to create a numeric value that is
outside of the range that can be
represented with a given number
of digits – either higher than the
maximum or lower than the
minimum representable value
■ E.g x= 2147483647 + 1
7
Y2K (1999-2000)
• Cost–$500,000,000,000
• Cause
■ To save computer storage space, old software
systems often stored the years as two-digit numbers
■ The software interpreted “00” to mean 1900 rather 8
Software Product Vs Process
9
Software Process
• Reasons why it is difficult to improve
the process
■ No enough time
■ Lack of knowledge
■ Wrong motivations
■ Insufficient commitment
10
Software Process
11
Hardware vs. Software
Hardware Software
12
Manufacturing vs. Development
• Once a hardware product has been manufactured, it
is difficult or impossible to modify. In contrast,
software products are routinely modified and
upgraded.
• In hardware, hiring more people allows you to
accomplish more work, but the same does not
necessarily hold true in software engineering.
• Unlike hardware, software costs are concentrated in
design rather than production.
13
Failure curve for Hardware
14
Failure curve for Software
19
Software Applications – New
• Open world computing—pervasive, distributed
computing
• Ubiquitous computing—wireless networks
• Netsourcing—the Web as a computing engine
• Open source—”free” source code open to the
computing community (a blessing, but also a
potential curse!)
• And also …
• Data mining
• Grid computing
• Cognitive machines
• Software for nanotechnologies 20
Engineering
• “The systematic and regular application of scientific and
mathematical knowledge to the design, construction, and
operation of machines, systems, and so on of practical use
and, hence, of economic value.
21
Engineering
22
Software Engineering
• Engineering is the use of scientific principles to
design and build machines, structures, and other
items, including bridges, tunnels, roads, vehicles, and
buildings.
25
26
Breakout
Software Process
28
Software Engineering: A
Layered Technology
29
Layered Technology
A quality Focus
• Every organization is rest on its commitment to quality.
• Total Quality Management, Six Sigma, or similar continuous
improvement culture and it is this culture ultimately leads to
development of increasingly more effective approaches to
software engineering.
• The bedrock that supports software engineering is a quality
focus.
Process:
• It is a foundation layer for software engineering.
• It defines framework for a set of Key Process Areas for
effectively manage and deliver quality software in a
cost-effective manner
• The processes define the tasks to be performed and the order
in which they are to be performed 30
Layered Technology
Methods:
• It provides the technical how-to's for building software.
• Methods encompass a broad array of tasks that include
requirements analysis, design, program construction, testing, and
support.
• There could be more than one technique to perform a task and
different techniques could be used in different situations.
Tools:
• Provide automated or semi-automated support for the process,
methods and quality control.
• When tools are integrated so that information created by one tool
can be used by another, a system for the support of software
development, called Computer-Aided Software Engineering (CASE)
A Generic Software Process Model
A software process – as
a framework for the tasks
that are required to build
high-quality software.
32
Process framework
Why process :
• A process defines who is doing what, when and how
to reach a certain goal.
•Each framework
activities is populated
by a set for software
engineering actions – a
collection of related
tasks.
• Each action has
individual work task.
34
Generic Process Framework Activities
1. Communication:
■ Heavy communication with customers, stakeholders,
team members
2. Planning:
■ Workflow that is to follow
■ Software project plan- describe technical task, likely
risk, resources will require, work products to be
produced and a work schedule.
35
Generic Process Framework Activities
3. Modeling:
■ Help developer and customer to understand
requirements (analysis of requirements) & design of
software
4. Construction:
■ Code generation: either manual or automated or both
■ Testing – to uncover error in the code
5. Deployment:
■ Delivery to the customer for evaluation
■ Customer provide feedback
36
Umbrella Activities
39
Process Flow (Contd.)
• Linear process flow executes each of the five
activities in sequence.
40
Process Flow (Contd.)
• An evolutionary process flow executes the activities in a
circular manner. Each circuit leads to a more complete
version of the software.
41
Identifying a Task Set
• Before proceeding with the process model: what
actions are appropriate for a framework activity
given the nature of the problem, the characteristics
of the people and the stakeholders?
• A task set defines the actual work to be done to
accomplish the objectives of a software engineering
action.
■ A list of the task to be accomplished
43
Example of a Task Set
• The task sets for requirements gathering action for a
simple project may include:
■ Make a list of stakeholders for the project.
■ Invite all stakeholders to an informal meeting.
■ Ask each stakeholder to make a list of features and
functions required.
■ Discuss requirements and build a final list.
■ Prioritize requirements.
■ Note areas of uncertainty.
44
Example of a Task Set
• The task sets for requirements gathering action for a
big project may include:
1. Make a list of stakeholders for the project.
2. Interview each stakeholder separately to determine
overall wants and needs.
3. Build a preliminary list of functions and features based
on stakeholder input.
4. Schedule a series of facilitated application specification
meetings.
5. Conduct meetings.
6. Produce informal user scenarios as part of each meeting.
45
Example of a Task Set
7. Refine user scenarios based on stakeholder feedback.
8. Build a revised list of stakeholder requirements.
9. Use quality function deployment techniques to prioritize
requirements.
10. Package requirements so that they can be delivered
incrementally.
11. Note constraints and restrictions that will be placed on
the system.
12. Discuss methods for validating the system.
46
Project Activity -1
• Make a list of stakeholders for the
project.
48
Process Patterns
• A process pattern:
■ describes a process-related problem that is
encountered during software engineering work,
50
Process Assessment & Improvement
51
Process Assessment and Improvement
• Maintenance is high.
Prescriptive Model
• Prescriptive process models advocate an orderly
approach to software engineering
■ Organize framework activities in a certain order
■ Planning
■ Modeling
■ Construction
■ Deployment
The Waterfall Model
60
Waterfall Model (contd.)
• Requirement Analysis and Definition: systems
services, constraints and goals are defined by
customers with system users.
• Scheduling tracking:
■ Assessing progress against the project plan.
■ Require action to maintain schedule.
C- Communication
P - Planning
M – Modeling
C - Construction
D - Deployment
■ Spiral Model
Quick
plan
communicatio
n
Modeling
Quick design
Deployment Constructio
delivery & n
feedback Constructio
of prototype
n
of prototype
74
Prototyping cohesive
• Best approach when:
79
Spiral Model
• Combines iterative nature of prototyping with the
controlled and systematic aspects of the linear
sequential model.
request User
Transaction requests
Bank
Database display
Balance ATM
Informatio
n
receipt
Printer
Account data
Informatio
n
request
User
Database
A level 0 DFD
Printer/dis
Bank Customer’s play
Database Card
details Rejection
message
1.0
Validate
Customer 2.0
access Reject
transaction
Access \and end session
PI
map
N
Access
authorizatio Network
n
directory
Rejection
Access
custome 3.0
permissions
message
r Obtain
Details of
transaction
select 4.0
Validate
options transaction
Transactio
n
request
User
Database
A level 1 DFD
Card Customer’s
Card
Reader details Cannot
1.1
Read
Read card
Details
From
card Card Printer/dis
data play
Encoded
pin
1.2
Check
Expiry date
custom PIN
1.3
And bank group
Request
er Pin
And match Card
Max 3 attempts Validation
data
Access
map
Invalid
pin
Access
authorizatio Network
n User directory
Database
Context Diagram
• Shows the context into which the
business process fits
• Shows the overall business process as
just one process
• Shows all the outside entities that
receive information from or contribute
information to the system
Slide 94
Level 0 Diagram
• Shows all the processes that comprise
the overall system
• Shows how information moves from and
to each process
• Adds data stores
Level 1 Diagrams
• Shows all the processes that comprise a
single process on the level 0 diagram
• Shows how information moves from and to
each of these processes
• Shows in more detail the content of higher
level process
• Level 1 diagrams may not be needed for all
level 0 processes
Slide 96
Level 2 Diagrams
Slide 98
Decomposition Diagram
Class Work
✧ https://www.visual-paradigm.com/tutorials/data-flow-diag
ram-example-cs-system.jsp
100
More Process Models
Concurrent Development Model
• It represented schematically as series of major
technical activities, tasks, and their associated states.
103
Concurrent Development Model
• All activities exist concurrently but reside in different
states.
■ The analysis activity (existed in the none state while
initial customer communication was completed) now
makes a transition into the under-development state.
105
Component Based Development
2. Architecture-centric
Use case
driv influenc
e e
System
architecture
III. Iterative and Incremental
• Iteration: Steps in the workflow (mini-project)
119
UP Phases
120
Inception Phase
• Encompasses both customer communication and
planning activities of the generic process
• Business requirements for the software are identified
• A rough architecture for the system is proposed
• A plan is created for an incremental, iterative
development
• Fundamental business requirements are described
through preliminary use cases
■ A use case describes a sequence of actions that are
performed by a user 121
Elaboration Phase
• Encompasses both the planning and modelling activities
of the generic process
• Refines and expands the preliminary use cases
122
Construction Phase
• Encompasses the construction activity of the generic
process
• Uses the architectural model from the elaboration phase
as input
• Develops or acquires the software components that
make each use-case operational
• Analysis and design models from the previous phase are
completed to reflect the final version of the increment
• Use cases are used to derive a set of acceptance tests
that are executed prior to the next phase
123
Transition Phase
• Encompasses the last part of the construction activity
and the first part of the deployment activity of the
generic process
125
UP strengths
• Based on sound Software Engineering principles.
131
What is “Agility”?
• Motivation for Agile—modern economy requirements
• Agile combines a philosophy and set of development
guidelines.
■ The philosophy encourages customer satisfaction and
early incremental delivery of software; small, highly
motivated project teams; informal methods; minimal
software engineering work products; and overall
development simplicity.
■ The development guidelines stress delivery over
analysis and design (although these activities are not
discouraged), and active and continuous
communication between developers and customers
132
What is “Agility”?
• Effective (rapid and adaptive) response to change
• Effective communication among all stakeholders
• Drawing the customer onto the team
• Organizing a team so that it is in control of the work
performed
• Yielding …
• Rapid, incremental delivery of software
133
What is “Agility”?
• Increase Quality
• Simplify Releases
135
WATERFALL vs AGILE
136
WATERFALL vs AGILE
137
Agile Vs Traditional Methods
138
Agility and the Cost of Change
139
An Agile Process
• Is driven by customer descriptions of what
is required (scenarios)
140
Agility Principles - I
1. Our highest priority is to satisfy the customer through early
and continuous delivery of valuable software.
2. Welcome changing requirements, even late in development.
Agile processes harness change for the customer's
competitive advantage.
3. Deliver working software frequently, from a couple of
weeks to a couple of months, with a preference to the
shorter timescale.
4. Business people and developers must work together daily
throughout the project.
5. Build projects around motivated individuals. Give them the
environment and support they need, and trust them to get
the job done.
6. The most efficient and effective method of conveying
information to and within a development team is
face–to–face conversation. 141
Agility Principles - II
7. Working software is the primary measure of progress.
8. Agile processes promote sustainable development. The
sponsors, developers, and users should be able to
maintain a constant pace indefinitely.
9. Continuous attention to technical excellence and good
design enhances agility.
10. Simplicity – the art of maximizing the amount of work
not done – is essential.
11. The best architectures, requirements, and designs emerge
from self–organizing teams.
12. At regular intervals, the team reflects on how to become
more effective, then tunes and adjusts its behavior
accordingly.
142
Agile Methods
• Scrum
• Extreme Programming (XP)
• Adaptive Software Development (ASD)
• Dynamic System Development Method (DSDM)
• Agile modeling
• Agile Unified Process (AUP)
• Crystal Clear Methods
• Disciplined agile delivery
• Feature-driven development (FDD)
• Lean software development
• Kanban (development)
143
Extreme Programming (XP)
144
Extreme Programming (XP)
• The most widely used agile process, originally proposed
by Kent Beck
1. XP Planning
■ Begins with the creation of “user stories”
145
Extreme Programming (XP)
2. XP Design
■ Follows the K.I.S (Keep It Simple) principle
■ Encourage the use of CRC cards (Class Responsibility Collaborator)
■ For difficult design problems, suggests the creation of “spike
solutions”—a design prototype
■ Encourages “refactoring”—an iterative refinement of the internal
program design
3. XP Coding
■ Recommends the construction of a unit test for a store before coding
commences
■ Encourages “pair programming”
4. XP Testing
■ All unit tests are executed daily
■ “Acceptance tests” are defined by the customer and executed to
assess customer visible functionality
146
Core Values of XP
• Communication
• Simplicity
• Feedback
• Courage
• Respect
147
XP Values: Communication
• Poor communication in software teams is one
of the root causes of failure of a project
• Stress on good communication between all
stakeholders--customers, team members,
project managers
• Customer representative always on site
• Paired programming
148
XP Values: Simplicity
• ‘Do the Simplest Thing That Could Possibly
Work’
■ Implement a new capability in the simplest
possible way
■ Refactor the system to be the simplest possible
code with the current feature set
• ‘You Aren’t Going to Need It’
■ Never implement a feature you don’t need now
• Developers strive to write simple code
bringing more value to a product, as it saves
time and effort.
149
XP Values: Feedback
• Always a running system that delivers
information about itself in a reliable way
• The system and the code provides feedback
on the state of development
• Catalyst for change and an indicator of
progress
150
XP Values
• Courage. Programmers objectively evaluate their
own results without making excuses and are
always ready to respond to changes.
151
Agile Model- Advantages
• Speedy and continuous delivery of the software ensures
customer satisfaction.
• All the stakeholders (customers, developers, and testers)
are involved in the process which leads to technical
excellence and good design.
• It facilitates close interaction between business people and
developers.
• Its flexibility ensures the adaptation to changing
circumstances. Changes added at the last moment or at a
later stage of development can be incorporated without
any problem.
152
Agile Model- Disadvantages
• The development team should be highly professional and
client-oriented.
• New requirement may be a conflict with the existing
architecture.
• With further correction and change, there may be chances
that the project will cross the expected time.
• There may be difficult to estimate the final cost of the
project due to constant iteration.
• A defined requirement is absent.
153
154
Quiz 4
Breakout
XP Practices
(Source: http://www.xprogramming.com/xpmag/whatisxp.htm)
157
XP Practices: Planning Game
• Planning for the upcoming iteration
• Uses stories provided by the customer
• Technical persons determine schedules,
estimates, costs, etc
• A result of collaboration between the
customer and the developers
• Advantages
■ Reduction in time wasted on useless features
■ Greater customer appreciation of the cost of a
feature
■ Less guesswork in planning
• Disadvantages
■ Customer availability
158
■ Is planning this often necessary?
XP Practices: Planning Game
• XP Release Planning
■ Customer presents required features
■ Programmers estimate difficulty
■ Imprecise but revised regularly
• XP Iteration Planning
■ Two week iterations
■ Customer presents features required
■ Programmers break features down into tasks
■ Team members sign up for tasks
■ Running software at end of each iteration
159
XP Practices: Small Releases
• Small in terms of functionality
• Team releases running, tested software every iteration
• The Customer can evaluate or in turn, release to end users,
and provide feedback
• Important thing is that the software is visible and given to
the Customer at the end of every iteration
• Advantages
■ Frequent feedback
■ Tracking
■ Reduce chance of overall project slippage
• Disadvantages
■ Not easy for all projects
■ Versioning issues
160
XP Practices: Metaphor
• The oral architecture of the system
• XP Teams develop a common vision of the
system
• Define common system of names
• Ensure everyone understands how the
system works, where to look for functionality,
or where to add functionality
• Advantages
■ Encourages a common set of terms for the system
■ A quick and easy way to explain the system 161
XP Practices: Simple Design
• Build software to a simple design
• Through programmer, testing and design improvement, keep
the software simple and the design suited to current
functionality
• Not a one-time thing nor an up-front thing
• Design steps in release planning and iteration planning
• Teams design and revise design through refactoring, through
the course of the project
• Advantages
■ Easier to understand what is going on
162
XP Practices: Pair Programming
• Two Developers, One monitor, One Keyboard
• One “drives” and the other thinks
• Switch roles as needed
• Research into pair programming shows that
pairing produces better code in the same time
as programmers working singly
• Pairing also communicates knowledge
throughout the team
163
XP Practices: Test-Driven
Development
• Teams practice TDD by working in short
cycles of adding a test, and then making it
work
• Easy to produce code with 100 percent test
coverage
• These programmer tests or unit tests are all
collected together
• Each time a pair releases code to the
repository, every test must run correctly
164
XP Practices: Design
Improvement/ Refactoring
• Continuous design improvement process called
‘refactoring’:
■ Removal of duplication
■ Increase cohesion
■ Reduce coupling
• Refactoring is supported by comprehensive
testing--customer tests and programmer tests
• Prompts developers to proactively improve the
product as a whole
• Increases developer knowledge of the system
165
XP Practices: Continuous Integration
• New features and changes are worked
into the system immediately
• Teams keep the system fully integrated
at all times
• Daily, or multiple times a day builds
• Avoid ‘integration hell’
• Avoid code freezes
166
XP Practices: Collective Code
Ownership
• Any pair of programmers can improve any
code at any time
• No ‘secure workspaces’
• All code gets the benefit of many people’s
attention
• Avoid duplication
• Programmer tests catch mistakes
• Pair with expert when working on unfamiliar
code
167
XP Practices: Coding Standard
• Use common coding standard
• All code in the system must look as
though written by an individual
• Code must look familiar, to support
collective code ownership
168
XP Practices: Sustainable
Pace/40-Hour Week
• The work week should be limited to 40
hours
• Team will produce high quality product
when not overly exerted
• ‘Death march’ projects are unproductive
and do not produce quality software
• Work at a pace that can be sustained
indefinitely
169
XP Practices: Whole Team
• All contributors to an XP project are one team
• Must include a business representative--the
‘Customer’
■ Provides requirements
■ Sets priorities
■ Steers project
• Team members are programmers, testers,
analysts, coach, manager
• Best XP teams have no specialists
170
XP Practices: Customer
Tests/Testing
• The Customer defines one or more
automated acceptance tests for a feature
• Team builds these tests to verify that a
feature is implemented correctly
• Once the test runs, the team ensures that
it keeps running correctly thereafter
• System always improves, never backslides
• Unit testing
• Test-first design
• All automated 171