Nptel Week1
Nptel Week1
Nptel Week1
1
About Myself
• RAJIB MALL
2
What is Software Engineering?
• Engineering approach to develop software.
–Building Construction Analogy.
• Systematic collection of past experience:
–Techniques,
–Methodologies,
–Guidelines.
3
IEEE Definition
• “Software engineering is the application of
a systematic, disciplined, quantifiable
approach to the development, operation,
and maintenance of software; that is, the
application of engineering to software.”
4
Software Crisis
• It is often the case that software products:
–Fail to meet user requirements.
–Expensive.
–Difficult to alter, debug, and enhance.
–Often delivered late.
–Use resources non-optimally.
5
Software Crisis (cont.)
Laptop or Desktop =
Rs.45,000/-
Rational suite node locked =
Hw cost Rs.3,14,600/-
Sw cost
Rational suite floating license=
Rs.6,03,200/-
6
Then why not have entirely hardware systems?...
• A virtue of software:
– Relatively easy and faster to develop and to change…
– Consumes no space, weight, or power…
– Otherwise all might as well be hardware.
• The more is the complexity of software, the harder
it is to change--why?
– Further, the more the changes made to a program,
the greater becomes its complexity.
7
Standish Group Report
28% Successful
49% Delayed or
cost overrun
23% Cancelled
8
Which Factors are Contributing to the Software
Crisis?
• Larger problems,
9
Programming: an Art or
Engineering?
Esoteric Past Engineering Technology
Experience
Development Pattern
Technology
Craft
Systematic Use of Past
Experience and Scientific Basis
Unorganized Use of
Past Experience
Art Time
10
Programming
• Heavy use of past experience:
an Art or
–Past experience is systematically arranged. Engineering?
• Theoretical basis and quantitative techniques
provided.
• Many are just thumb rules.
• Tradeoff between alternatives.
• Pragmatic approach to cost-effectiveness.
11
• Early programmers used exploratory What is
(also called build and fix) style. Exploratory
Software
– A `dirty' program is quickly developed. Development?
– The bugs are fixed as and when they are
noticed.
– Similar to how a junior
student develops programs…
12
Exploratory Style
Fix
Initial
Test
Coding Do Until
Done
Does not work for nontrivial projects… Why?...
13
What is Wrong with the Exploratory Style?
• Can successfully be used for developing only very small (toy)
programs. Software
Exploratory Engineering
Effort, time,
cost Machine
Program Size
14
What is Wrong with the Exploratory Style?
Cont…
15
What is Wrong with the Exploratory Style? Cont…
16
An Interpretation Based on Human
Cognition Mechanism
17
• Suppose I ask: “It is 10:10AM now, Human Cognition
Mechanism
how many hours are remaining today?"
– 10AM would be stored in the short-term memory.
18
Schematic Representation of
Brain
Short Term Memory
Processing Center
Brain
19
• An item stored in the short term memory can get lost:
– Either due to decay with time or Short Term
– Displacement by newer information. Memory
• This restricts the time for which an item is stored in short
term memory:
– Typically few tens of seconds.
– However, an item can be retained longer in the short term
memory by recycling.
20
• An item is any set of related information.
What is an
– A character such as `a' or a digit such as `5'.
Item?
– A word, a sentence, a story, or even a picture.
• Each item normally occupies one place in memory.
• When you are able to relate several different items together
(chunking):
– The information that should normally occupy several places,
takes only one place in memory.
21
Chunking
• If I ask you to remember the number 110010101001
– It may prove very hard for you to understand and
remember.
– But, the octal form of 6251 (110)(010)(101)(001) would
be easier.
– You have managed to create chunks of three items each.
22
• In many of our day-to-day experiences:
Evidence of Short
– Short term memory is evident. Term Memory
• Suppose, you look up a number from
the telephone directory and start dialling it.
– If you find the number is busy, you can dial the number again after a
few seconds without having to look up the number from directory.
• But, after several days:
– You may not remember the number at all
– Would need to consult the directory again.
23
• If a person deals with seven or less number of items:
– These would be accommodated in the short term
memory. The Magical Number 7
– So, he can easily understand it.
• As the number of new information increases beyond
seven:
– It becomes exceedingly difficult to understand it.
24
What is the Implication in Program Development?
• A small program having just a few variables:
– Is within easy grasp of an individual.
25
Implication in Program Development
• Instead of a human, if a machine could be writing (generating) a
program,
– The slope of the curve would be linear.
26
Which Principles are Deployed by Software Engineering
Techniques to Overcome Human Cognitive Limitations?
27
Two Fundamental
Techniques to Handle
Complexity
28
What is Abstraction?
• Simplify a problem by omitting unnecessary
details.
– Focus attention on only one aspect of the problem
and ignore other aspects and irrelevant details.
– Also called model building.
29
• Suppose you are asked to develop an overall
understanding of some country. Abstraction
Example
– Would you:
• Meet all the citizens of the country, visit every house, and
examine every tree of the country?
– You would possibly refer to various types of maps for that
country only.
30
You would study an Abstraction…
• A map is:
– An abstract
representation of
a country.
– Various types of
maps
(abstractions)
possible.
31
Does every Problem have a single Abstraction?
32
• For complex problems: Abstractions of
Complex Problems
– A single level of abstraction is inadequate.
– A hierarchy of abstractions may have to be constructed.
• Hierarchy of models:
– A model in one layer is an abstraction
of the lower layer model.
– An implementation of the model at the higher layer.
33
Abstraction of Complex Problems -- An Example
• Suppose you are asked to understand all life forms that
inhabit the earth.
• Would you start examining each living organism?
– You will almost never complete it.
– Also, get thoroughly confused.
34
Animalia Plantae Fungae Kingdom
Living
Organisms
Mollusca Chordata Ascomycota Zygomycota
Phyllum
35
Quiz
• What is a model?
36
Decomposition
• Decompose a problem into many small independent parts.
– The small parts are then taken up one by one and solved
separately.
– The idea is that each small part would be easy to grasp and
therefore can be easily solved.
– The full problem is solved when all the parts are solved.
37
Decomposition
• A popular example of decomposition principle:
– Try to break a bunch of sticks tied
together versus breaking them individually.
38
Decomposition: Another Example
• Example use of decomposition principle:
– You understand a book better when the contents are
organized into independent chapters.
39
Why Study Software Engineering? (1)
40
Why Study Software Engineering? (2)
• Learn systematic techniques of:
41
Why Study Software Engineering? (3)
42
Uncertainty
Routine of outcome Jobs versus
Projects
Jobs – repetition of very well-defined and well understood tasks with very
little uncertainty
Exploration – The outcome is very uncertain, e.g. finding a cure for cancer.
Projects – in the middle! Has challenge as well as routine…
43
• Two types of software projects:
–Products (Generic software) Types of Software
Projects
–Services (custom software)
44
Horizontal market
software—meets
needs of many
Packaged software — companies
prewritten software available for
purchase Vertical market
software—designed
for particular
Custom software — industry
software developed at some
user’s requests-Usually developer
tailors some generic solution Types of Software
45
Types of Software Projects
46
Software Services
• Software service is an umbrella term, includes:
– Software customization
CP
– Software maintenance
– Software testing
– Also contract programmers (CP) carrying out coding or
any other assigned activities.
47
Factors responsible for accelerated growth of services…
• Now lots of code is available in a company:
– New software can be developed by modifying the closest.
48
Contribution of the
IT sector to India’s
GDP rose to
approximately 9.5%
in 2015 from 1.2%
in 98
49
Scenario of Indian Software Companies
50
A Few Changes in Software Project Characteristics over Last 40 Years
• 40 years back, very few software existed
– Every project started from scratch
– Projects were multi year long
• The programming languages that were used earlier hardly provided
any scope for reuse:
– FORTRAN, PASCAL, COBOL, BASIC
• No application was GUI-based:
– Mostly command selection from displayed text menu items.
51
Traditional versus Modern Projects
• Projects are increasingly becoming services:
– Either tailor some existing software or reuse pre-built libraries.
• Facilitate and accommodate client feedbacks
• Facilitate customer participation in project development work
• Incremental software delivery with evolving functionalities.
• No software is being developed from scratch --- Significant
reuse is being made…
52
Computer Systems Engineering
• Many products require development of software as well as
specific hardware to run it:
– a coffee vending machine,
–a robotic toy,
–A new health band product, etc.
• Computer systems engineering:
–encompasses software engineering.
53
Computer Systems Engineering
• The high-level problem:
–Deciding which tasks are to be solved by software.
–Which ones by hardware.
54
Computer Systems Engineering (CONT.)
• Typically, hardware and software are developed together:
55
Computer Systems Engineering (CONT.)
Feasibility
Study
Requirements
Analysis and
Specification Hardware
Development
Hardware
Software
Partitioning Software
Development
Integration
and Testing
Project Management
56
Emergence of Software
Engineering Techniques
57
Emergence of Software Engineering Techniques
58
Early Computer Programming (50s)
59
High-Level Language Programming (Early 60s)
• High-level languages such as FORTRAN, ALGOL, and
COBOL were introduced:
Why reduces?
60
High-Level Language Programming (Early 60s)
61
Control Flow-Based Design (late 60s)
• Size and complexity of programs increased further:
–Exploratory programming style proved to be insufficient.
• Programmers found:
–Very difficult to write cost-effective and correct
programs.
62
Control Flow-Based Design (late 60s)
• Programmers found it very difficult:
–To understand and maintain programs written by
others.
• To cope up with this problem, experienced
programmers advised---”Pay particular attention to the
design of the program's control structure.'’
63
Control Flow-Based Design (late 60s)
• What is a program's control structure?
– The sequence in which the program's
instructions are executed.
• To help design programs having good
control structure:
–Flow charting technique was developed.
64
Control Flow-Based Design (late 60s)
• Using flow charting technique:
–One can represent and design a
program's control structure.
–When asked to understand a program:
•One would mentally trace the program's
execution sequence.
65
Control Flow-Based Design
• A program having a messy flow chart
representation:
–Difficult to understand and debug.
66
Spaghetti Code Structure
67
Control Flow-Based Design (Late 60s)
• What causes program complexity?
–GO TO statements makes control
structure of a program messy.
68
addi $a0, $0, 1
Control Flow-Based Design (Late 60s) j next
• Many programmers had extensively next:
j skip1
add $a0, $a0, $a0
used assembly languages. skip1:
j skip2
add $a0, $a0, $a0
–JUMP instructions are frequently used for add $a0, $a0, $a0
skip2:
program branching in assembly languages. j skip3
loop:
–Programmers considered use of GO TO add $a0, $a0, $a0
add $a0, $a0, $a0
statements inevitable. add $a0, $a0, $a0
skip3:
j loop
69
Control-flow Based Design (Late 60s)
70
Control Flow-Based Design (Late 60s)
71
Control Flow-Based Design (Late 60s)
• It soon was conclusively proved:
–Only three programming constructs are sufficient to
express any programming logic:
•sequence (a=0;b=5;)
•selection (if(c==true) k=5 else m=5;)
•iteration (while(k>0) k=j-k;)
72
Control-flow Based Design (Late 60s)
• Everyone accepted:
–It is possible to solve any programming problem without
using GO TO statements.
–This formed the basis of Structured Programming
methodology.
73
Structured Programming
• A program is called structured:
–When it uses only the following types of constructs:
•sequence,
•selection,
•iteration
–Consists of modules.
74
Structured Programs
• Sometimes, violations to structured
programming are permitted:
o Due to practical considerations such as:
75
Advantages of Structured programming
• Structured programs are:
–Easier to read and understand,
–Easier to maintain,
–Require less effort and time for development.
–Less buggy
76
Structured Programming
• Research experience shows:
–Programmers commit less number of errors:
•While using structured if-then-else and do-while
statements.
•Compared to test-and-branch (GOTO) constructs.
77
Data Structure-Oriented Design (Early 70s)
78
Data Structure-Oriented Design (Early 70s)
• Techniques which emphasize designing the data
structure:
–Derive program structure from it:
79
Data Structure Oriented Design (Early 70s)
• An example of data structure-oriented design
technique:
80
Data Structure Oriented Design (Early 70s)
• JSP technique:
Program code structure should correspond to the
data structure.
81
JSP methodology: A Data Structure Oriented Design
(Early 70s)
82
Data Structure Oriented Design (Early 70s)
83
Data Flow-Oriented Design (Late 70s)
84
Data Flow-Oriented Design (Late 70s)
85
Data Flow-Oriented Design (Late 70s)
• Data flow technique is a generic technique:
–Can be used to model the working of any system.
• not just software systems.
86
Data Flow Model of a Car Assembly Unit
Partly
Chassis with
Assembled
Engine
Fit
Car Fit Paint and Car
Fit
Engine Doors Wheels Assembled Test
Car
87
Object-Oriented Design (80s)
• Object-oriented technique:
–An intuitively appealing design approach:
88
Object-Oriented Design (80s)
• Relationships among objects:
–Such as composition, reference, and inheritance are
determined.
89
• Object-Oriented Techniques have gained wide acceptance:
– Simplicity Object-Oriented
– Increased Reuse possibilities Design (80s)
– Lower development time and cost
– Easy maintenance
90
Aspect- Component- Service-
oriented based oriented
Object-Oriented
Object-Oriented
Data flow-based
Data structure-
based
Evolution of
Control flow- Design Techniques
based
Ad hoc
91
Evolution of Other Software Engineering Techniques
92
• Life cycle models,
• Specification techniques,
• Project management techniques, Evolution of Other
Software Engineering
• Testing techniques, Techniques
• Debugging techniques,
• Quality assurance techniques,
• Metrics,
• CASE tools, etc.
93
• Use of Life Cycle Models
94
Differences between the exploratory style and
modern software development practices
• Emphasis has shifted
– from error correction to error prevention.
95
Differences between the exploratory style and
modern software development practices (CONT.)
• In exploratory style,
–errors are detected only during testing,
• Now:
– Focus is on detecting as many errors as possible in each
phase of development.
96
Differences between the exploratory style and
modern software development practices (CONT.)
• In exploratory style:
–coding is synonymous with program development.
• Now:
–coding is considered only a small part of program
development effort.
97
Differences between the exploratory style and
modern software development practices (CONT.)
98
Differences between the exploratory style and
modern software development practices (CONT.)
• During all stages of development process:
–Periodic reviews are being carried out
99
Differences between the exploratory style and modern software
development practices (CONT.)
• There is better visibility of design and code:
– In the past, very little attention was being given to producing good quality
and consistent documents.
100
Differences between the exploratory style and
modern software development practices (CONT.)
• Because of good documentation:
–fault diagnosis and maintenance are smoother now.
101
Differences between the exploratory style and
modern software development practices (CONT.)
102
Review Questions
• What is structured programming?
• What problems may appear if a large program is
developed without using structured
programming techniques?
103
Life Cycle Models
104
Conceptualize
Software
Specify Life Cycle
Retire
Design
Maintain
Deliver Code
Test
105
Life Cycle Model
• A software life cycle model (also process model or SDLC):
–A descriptive and diagrammatic model of software life
cycle:
–Identifies all the activities undertaken during product development,
106
Life Cycle Model (CONT.)
107
Why Model Life Cycle?
• A graphical and written description:
–Helps common understanding of activities among the software
developers.
108
Life Cycle Model (CONT.)
109
Life Cycle Model (CONT.)
– CodeTest Design
Initial
Coding
Test
– CodeDesign Test Change Code Do Until
Done
110
Life Cycle Model (CONT.)
111
Life Cycle Model (CONT.)
112
Phase Entry and Exit Criteria
113
Life Cycle Model (CONT.)
114
Life Cycle Model: Milestones
• Milestones help software project managers:
–Track the progress of the project.
–Phase entry and exit are
important milestones.
115
Life Cycle and Project Management
• When a life cycle model is followed:
–The project manager can at any time fairly
accurately tell,
•At which stage (e.g., design, code, test, etc.) the
project is.
116
Project Management Without Life Cycle Model
• It becomes very difficult to track the progress of the project.
–The project manager would have to depend on the guesses
of the team members.
• This usually leads to a problem:
–known as the 99% complete syndrome.
117
Project Deliverables: Myth and Reality
Myth:
The only deliverable for a successful project is the working
program.
Reality:
Documentation of all aspects of software development are
needed to help in operation and maintenance.
118
• Many life cycle models have been proposed.
• We confine our attention to only a few commonly used models.
–Waterfall
–V model, Life Cycle Model (CONT.)
119
• Software life cycle (or software process):
–Series of identifiable stages that a software product
undergoes during its life time:
• Feasibility study
• Requirements analysis and specification,
• Design,
• Coding,
• Testing
Software Life Cycle
• Maintenance.
120
Classical Waterfall Model
• Classical waterfall model divides life cycle into following phases:
– Feasibility study,
– Requirements analysis and specification,
Conceptualize
– Maintenance. Test
121
Feasibility Study Classical Waterfall Model
Req. Analysis
Testing
Maintenance
122
Relative Effort for Phases
• Phases between feasibility study and
60
testing
50
– Called development phases. 40
Relative Effort
• Among all life cycle phases 30
20
– Maintenance phase consumes maximum
10
effort.
0
Maintnce
• Among development phases,
Coding
Design
Test
Req. Sp
– Testing phase consumes the maximum effort.
• Most organizations usually define:
– Standards on the outputs (deliverables) produced at the end of every phase
– Entry and exit criteria for every phase.
• They also prescribe methodologies for:
– Specification,
Process Model
– Design,
– Testing,
– Project management, etc.
Classical Waterfall Model (CONT.)
• The guidelines and methodologies of an organization:
–Called the organization's software development methodology.
• Software development organizations:
– Expect fresh engineers to master the organization's
software development methodology.
125
Feasibility Study Economic
feasibility
(also called
cost/benefit
feasibility)
126
• Main aim of feasibility study: determine whether developing the
software is:
– Financially worthwhile
Feasibility Study
– Technically feasible.
• Roughly understand what customer wants: First Step
– Data which would be input to the system,
– Processing needed on these data,
– Output data to be produced by the system,
– Various constraints on the behavior of the system.
127
• SPF Scheme for CFL
• CFL has a large number of employees, exceeding 50,000.
• Majority of these are casual labourers
• Mining being a risky profession:
– Casualties are high Case Study
• Though there is a PF:
– But settlement time is high
• There is a need of SPF:
– For faster disbursement of benefits
128
Feasibility: Case Study
• Manager visits main office, finds out the main
functionalities required
• Visits mine site, finds out the data to be input
• Suggests alternate solutions
• Determines the best solution
• Presents to the CFL Officials
• Go/No-Go Decision
129
Activities During Feasibility Study
• Work out an overall understanding of the problem.
• Formulate different solution strategies.
• Examine alternate solution strategies in terms of:
•resources required,
•cost of development, and
•development time.
130
• Perform a cost/benefit analysis:
–Determine which solution is the best.
–May also find that none of the solutions is
feasible due to: Activities during Feasibility Study
• high cost,
• resource constraints,
• technical reasons.
131
Cost benefit analysis (CBA)
• Need to identify all costs --- these could be:
– Development costs
– Set-up
– Operational costs
• Identify the value of benefits
132
The business case
• Benefits of delivered project
must outweigh costs
Benefits
• Costs include:
Costs - Development
- Operation
Rs • Benefits:
Rs
– Quantifiable
– Non-quantifiable
133
Rajib Mall
CSE Department 134