software engineering-i module-i introduction to s/w development lecture-1
DESCRIPTION
Software Engineering-I Shahbaz Ahmed 3 An Introduction to Software EngineeringTRANSCRIPT
Software Engineering-I
Module-I
Introduction to S/W Development Lecture-1
Software Engineering-I Shahbaz Ahmed 2
Reference Books “Software Engineering” by Ian Somerville 7th Edition
“Software Engineering Theory and Practice” by Shari, Lawrance & Pfleeger 2nd Edition
“Fundamentals of Object Oriented Design in UML” by Miler Page-Jones
Software Engineering-I Shahbaz Ahmed 3
An Introduction to Software Engineering
Software Engineering-I Shahbaz Ahmed 4
Requirements for this Class You are proficient in a programming
language, but you have no experience in analysis or design of a system
You want to learn more about the technical aspects of analysis and design of complex software systems
Software Engineering-I Shahbaz Ahmed 5
Objectives To introduce software engineering and to
explain its importance To set out the answers to key questions
about software engineering To introduce ethical and professional
issues and to explain why they are of concern to software engineers
Software Engineering-I Shahbaz Ahmed 6
Objectives cont… Appreciate Software Engineering:
• Build complex software systems in the context of frequent change
Understand how to • produce a high quality software system within time• while dealing with complexity and change
Acquire technical knowledge (main emphasis) Acquire managerial knowledge
Software Engineering-I Shahbaz Ahmed 7
Understand the Software Lifecycle• Process vs Product• Learn about different software lifecycles• Greenfield Engineering, Interface Engineering,
Reengineering
Acquire Managerial Knowledge
Software Engineering-I Shahbaz Ahmed 8
What is an Engineering System? Engineering system = capability for the
development of systems, hardware, or software Components:
• People• Process• Technology• Knowledge
Interfaces:• Internal (among components)• External (to stakeholders and customers)
Software Engineering-I Shahbaz Ahmed 9
Primary Relationship Diagram
People
Process
Technology
Knowledge
EngineeringSystem
(Components of an engineering system)
Software Engineering-I Shahbaz Ahmed 10
What do these terms mean? People: the people who are part of the engineering system
• Engineers• Infrastructure support personnel• Managers
Process: the processes used by the people or technology to accomplish the functions of the engineering system
Technology: the tools and mechanisms of the engineering system
Knowledge: value-added contextual information necessary to the development and operation of the engineering system
Software Engineering-I Shahbaz Ahmed 11
Engineering System Capability
People
Process
Technology
Knowledge
EngineeringSystemPeople
Process
Technology
Knowledge
EngineeringSystem
Resourcesand
Requirements
Systems,Software, &HardwareProducts
….Time….
Software Engineering-I Shahbaz Ahmed 12
Why Software Engineering? Software development is hard ! Important to distinguish “easy” systems (one
developer, one user, experimental use only) from “hard” systems (multiple developers, multiple users, products)
Experience with “easy” systems is misleading• One person techniques do not scale up
Analogy with bridge building:• Over a stream = easy, one person job• Over River Severn … ? (the techniques do not scale)
Software Engineering-I Shahbaz Ahmed 13
Why Software Engineering ? The problem is complexity Many sources, but size is key:
• UNIX contains 4 million lines of code• Windows 2000 contains 108 lines of code
Software engineering is about managing this complexity.
Software Engineering-I Shahbaz Ahmed 14
FAQs about software engineering
What is • software?• software process?• software engineering?• software process model?
What is software engineering? What is the differenceWhat is the difference
• between between software engineering and computer science?• betweenbetween software engineering and system engineering?
Software Engineering-I Shahbaz Ahmed 15
FAQs about software engineering What are the costs of software engineering? What are software engineering methods? What is CASE (Computer-Aided Software
Engineering) What are the attributes of good software? What are the key challenges facing software
engineering?
Software Engineering-I Shahbaz Ahmed 16
Software engineering (Criticality)
The economies of ALL developed nations are dependent on software.
More and more systems are software controlled Software engineering is concerned with
theories, methods and tools for professional software development.
Expenditure on software represents a significant fraction of GNP in all developed countries.
Software Engineering-I Shahbaz Ahmed 17
Software costs Software costs often dominate computer
system costs. The costs of software on a PC are often greater than the hardware cost.
Software costs more to maintain than it does to develop. For systems with a long life, maintenance costs may be several times development costs.
Software engineering is concerned with cost-effective software development.
Software Engineering-I Shahbaz Ahmed 18
Introduction Software engineering is an interesting subject.
In order to understand this subject we will need to look at a number of examples and case studies. And we will need to see how we can develop good software and how it could be improved in different scenarios?
Before we move on to software engineering we need to understand what software actually is.
Software Engineering-I Shahbaz Ahmed 19
What is software? Computer programs and associated documentation
+ data
Software products may be developed for a particular customer or may be developed for a general market
Software products may be• Generic - developed to be sold to a range of different customers• Specific (custom) - developed for a single customer according to
their specification
Software Engineering-I Shahbaz Ahmed 20
Why software is important? Used in
• Business decision-making• Modern scientific investigation and engineering problem solving• Games• Embedded systems
Similarly in many other fields like • education, • office automation, • Internet applications etc, software is being used.
Due to its central importance and massive use in many fields it is contributing a lot in terms of economic activity started by the software products. • Billions and trillions of dollars are being invested in this field
throughout the world every year.
Software Engineering-I Shahbaz Ahmed 21
What is software engineering?Software engineering is an engineering discipline
which is concerned with all aspects of software production
Software engineers should • adopt a systematic and organised approach to their work • use appropriate tools and techniques depending on
• the problem to be solved, • the development constraints and • the resources available
• New software can be created by developing new programs, configuring generic software systems or reusing existing software.
Software Engineering-I Shahbaz Ahmed 22
Software Engineering as defined by IEEE IEEE defines Software Engineering as
• “The application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software; that is, the application of engineering to software.”
Software Engineering is defined by Ian Somerville as• “A field concerned with all aspects of software
production’ Software engineering is not just concerned with the technical processes of software development but also with activities such as software project management and with the development of tools, methods and theories to support software production”.
Software Engineering-I Shahbaz Ahmed 23
What is the difference between software engineering and computer science? Computer science is concerned with theory and
fundamentals; software engineering is concerned with the practicalities of developing and delivering useful software.
Computer science theories are still insufficient to act as a complete underpinning for software engineering (unlike e.g. physics and electrical engineering).
This sums up software Engineering as• ”SE is the process of utilizing our knowledge of
computer science in effective production of software systems.”
Software Engineering-I Shahbaz Ahmed 24
What is the difference between software engineering and system engineering?
Software engineering is part of System engineering System engineering is concerned with all aspects of
computer-based systems development including • hardware, • software and • process engineering
System engineers are involved in system specification, architectural design, integration and deployment
Software Engineering-I Shahbaz Ahmed 25
What is a software process?
A set of activities whose goal is the development or evolution of software
Generic activities in all software processes are:• Specification - what the system should do and its
development constraints• Development - production of the software system• Validation - checking that the software is what the
customer wants• Evolution - changing the software in response to
changing demands
Software Engineering-I Shahbaz Ahmed 26
Software Crisis in 1960 which lead to SE Lets imagine a person who use to live in a village and who have constructed a hut for
him to live. Definitely he should have face some problems in the beginning but was managed to build a hurt for him. Now if you ask him to construct another hut, he may be able to construct one more easily and in a better way. This new hut may be better than the first one and he may construct it in a relatively less time. But if you ask him to construct concrete and iron houses then ?
Evolution is the name of the game in IT industry In most of the cases that software which was tried to be build
using those old tools and techniques were not complete. Most of the times it was delivered too late. Most of the projects were over-budgeted. And in most of the case systems build using these techniques
were not reliable – meaning that they were not be able to do what they were expected to do.
This lead to realization that only coding is not enough
Software Engineering-I Shahbaz Ahmed 27
What is a software process model?A simplified representation of a software process,presented from a specific perspective
Examples of process perspectives: Workflow perspective represents inputs, outputs and dependencies Data-flow perspective represents data transformation activities Role/action perspective represents the roles/activities of the
people involved in software process Generic process models
• Waterfall• Evolutionary development• Formal transformation• Integration from reusable components
Software Engineering-I Shahbaz Ahmed 28
The costs of software engineering?
Roughly 60% of costs are development costs, 40% are testing costs. For custom software, evolution costs often exceed development costs
Costs vary depending on the type of system being developed and the requirements of system attributes such as performance and system reliability
Distribution of costs depends on the development model that is used
Software Engineering-I Shahbaz Ahmed 29
Product development costs
Specification Development System testing
25 50 75 1000
Software Engineering-I Shahbaz Ahmed 30
What is CASE ? (Computer-Aided Software Engineering)
Upper-CASE• Tools to support the early process
activities of requirements and design Lower-CASE
• Tools to support later activities such as programming, debugging and testing
Software systems which are intended to provide automated support for software process activities, such as requirements analysis, system modelling, debugging and testing
Software Engineering-I Shahbaz Ahmed 31
What are the attributes of good software? The software should deliver the required functionality and
performance to the user and should be maintainable, dependable and acceptable.
Maintainability• Software must evolve to meet changing needs;
Dependability• Software must be trustworthy;
Efficiency• Software should not make wasteful use of system resources;
Acceptability• Software must accepted by the users for which it was designed. This means it
must be understandable, usable and compatible with other systems.
Software Engineering-I Shahbaz Ahmed 32
What are the key challenges facing software engineering? Heterogeneity, delivery and trust. Heterogeneity
• Developing techniques for building software that can cope with heterogeneous platforms and execution environments;
Delivery• Developing techniques that lead to faster delivery of
software; Trust
• Developing techniques that demonstrate that software can be trusted by its users.
Software Engineering-I Shahbaz Ahmed 33
What are the key challenges facing software engineering?
Software engineering in the 21st century faces three key challenges:
Legacy systems• Old, valuable systems must be maintained and updated
Heterogeneity• Systems are distributed and include a mix of hardware and
software Delivery
• There is increasing pressure for faster delivery of software
Software Engineering-I Shahbaz Ahmed 34
Professional and ethical responsibility of s/w engineers Software engineering involves wider
responsibilities than simply the application of technical skills.
Software engineers must behave in an honest and ethically responsible way if they are to be respected as professionals.
Ethical behaviour is more than simply upholding the law.
Software Engineering-I Shahbaz Ahmed 35
Issues of professional responsibility Confidentiality
• Engineers should normally respect the confidentiality of their employers or clients irrespective of whether or not a formal confidentiality agreement has been signed.
Competence • Engineers should not misrepresent their level of
competence. They should not knowingly accept work which is outwith their competence.
Software Engineering-I Shahbaz Ahmed 36
Issues of professional responsibility Intellectual property rights
• Engineers should be aware of local laws governing the use of intellectual property such as patents, copyright, etc. They should be careful to ensure that the intellectual property of employers and clients is protected.
Computer misuse • Software engineers should not use their technical skills
to misuse other people’s computers. Computer misuse ranges from relatively trivial (game playing on an employer’s machine, say) to extremely serious (dissemination of viruses).
Software Engineering-I Shahbaz Ahmed 37
Some General Discussion that will
demonize Software Engineering
in your hearts
Software Engineering-I Shahbaz Ahmed 38
Can you develop this?
Software Engineering-I Shahbaz Ahmed 39
Requirements
Software
Limitations of Non-engineered Software
Software Engineering-I Shahbaz Ahmed 40
Software Production has a Poor Track Record Example: Space Shuttle Software Cost: $10 Billion, millions of dollars more than planned Time: 3 years late Quality: First launch of Columbia was cancelled because of a
synchronization problem with the Shuttle's 5 onboard computers. • Error was traced back to a change made 2 years earlier when a
programmer changed a delay factor in an interrupt handler from 50 to 80 milliseconds.
• The likelihood of the error was small enough, that the error caused no harm during thousands of hours of testing.
Substantial errors still exist.• Astronauts are supplied with a book of known software problems
"Program Notes and Waivers".
Software Engineering-I Shahbaz Ahmed 41
Quality of today’s software…. The average software product released on the market is not error free.
QuickTime™ and aCinepak decompressor
are needed to see this picture.
Software Engineering-I Shahbaz Ahmed 42
Software Engineering: A Problem Solving Activity Analysis: Understand the nature of the problem and break the
problem into pieces Synthesis: Put the pieces together into a large structure
For problem solving we use Techniques (methods):
• Formal procedures for producing results using some well-defined notation
Methodologies: • Collection of techniques applied across software development and
unified by a philosophical approach Tools:
• Instrument or automated systems to accomplish a technique
Software Engineering-I Shahbaz Ahmed 43 20
Software Engineering: DefinitionSoftware Engineering is a collection of techniques,
methodologies and tools that help with the production of
a high quality software system with a given budget before a given deadline while change occurs.
Software Engineering-I Shahbaz Ahmed 44
Scientist vs Engineer Computer Scientist
• Proves theorems about algorithms, designs languages, defines knowledge representation schemes
• Has infinite time… Engineer
• Develops a solution for an application-specific problem for a client• Uses computers & languages, tools, techniques and methods
Software Engineer• Works in multiple application domains• Has only 3 months...• …while changes occurs in requirements and available technology
Software Engineering-I Shahbaz Ahmed 45
Factors affecting the quality of a software system Complexity:
• The system is so complex that no single programmer can understand it anymore
• The introduction of one bug fix causes another bug
Change: • The “Entropy” of a software system increases with each change: Each
implemented change erodes the structure of the system which makes the next change even more expensive (“Second Law of Software Dynamics”).
• As time goes on, the cost to implement a change will be too high, and the system will then be unable to support its intended task. This is true of all systems, independent of their application domain or technological base.
Software Engineering-I Shahbaz Ahmed 46
Why are software systems so complex? The problem domain is difficult The development process is very difficult to
manage Software offers extreme flexibility Software is a discrete system
• Continuous systems have no hidden surprises (Parnas)
• Discrete systems have!
Software Engineering-I Shahbaz Ahmed 47
Dealing with Complexity1. Abstraction 2. Decomposition3. Hierarchy
Software Engineering-I Shahbaz Ahmed 48
What is this?
Software Engineering-I Shahbaz Ahmed 49
1. Abstraction Inherent human limitation to deal with
complexity• The 7 +- 2 phenomena
Chunking: Group collection of objects Ignore unessential details: => Models
Software Engineering-I Shahbaz Ahmed 50
Models are used to provide abstractions System Model:
• Object Model: What is the structure of the system? What are the objects and how are they related?
• Functional model: What are the functions of the system? How is data flowing through the system?
• Dynamic model: How does the system react to external events? How is the event flow in the system ?
Task Model:• PERT Chart: What are the dependencies between the tasks?• Schedule: How can this be done within the time limit?• Org Chart: What are the roles in the project or organization?
Issues Model:• What are the open and closed issues? What constraints were posed
by the client? What resolutions were made?
Software Engineering-I Shahbaz Ahmed 51
Interdependencies of the Models
System Model (Structure, Functionality, Dynamic Behavior)
Issue Model(Proposals,Arguments,Resolutions)
Task Model(Organization,ActivitiesSchedule)
Software Engineering-I Shahbaz Ahmed 53
Example of an Issue: Galileo vs the Church What is the center of the Universe?
• Church: The earth is the center of the universe. Why? Aristotle says so.
• Galileo: The sun is the center of the universe. Why? Copernicus says so. Also, the Jupiter’s moons rotate round Jupiter, not around Earth.
Software Engineering-I Shahbaz Ahmed 54
Issue-ModelingIssue:
What is the Center of the
Universe?
Proposal1: The earth!
Proposal2:The sun!
Pro: Copernicus
says so.
Pro: Aristotlesays so.
Pro: Change will disturb
the people.
Con: Jupiter’s moons rotate
around Jupiter, not around Earth.
Resolution (1615):The church
decides proposal 1is right
Resolution (1998): The church declares
proposal 1 was wrong
Software Engineering-I Shahbaz Ahmed 55
2. Decomposition A technique used to master complexity (“divide and conquer”) Functional decomposition
• The system is decomposed into modules• Each module is a major processing step (function) in the application
domain• Modules can be decomposed into smaller modules
Object-oriented decomposition• The system is decomposed into classes (“objects”) • Each class is a major abstraction in the application domain• Classes can be decomposed into smaller classes
Software Engineering-I Shahbaz Ahmed 56
Functional DecompositionTop Level functions
Level 1 functions
Level 2 functions
Machine Instructions
System Function
Load R10 Add R1, R10
Read Input Transform ProduceOutput
Transform ProduceOutputRead Input
Software Engineering-I Shahbaz Ahmed 57
Functional Decomposition Functionality is spread all over the system Maintainer must understand the whole system to make
a single change to the system Consequence:
• Codes are hard to understand• Code that is complex and impossible to maintain• User interface is often awkward and non-intuitive
Example: Microsoft Powerpoint’s Autoshapes
Software Engineering-I Shahbaz Ahmed 58
Autoshape
Functional Decomposition: Autoshape
DrawRectangle
DrawOval
DrawCircle
DrawChangeMouseclick
ChangeRectangle
ChangeOval
ChangeCircle
Software Engineering-I Shahbaz Ahmed 59
What is This?
Software Engineering-I Shahbaz Ahmed 60
Model of an Eskimo
EskimoSize
Dress()Smile()Sleep()
ShoeSizeColorType
Wear()
* CoatSizeColorType
Wear()
Software Engineering-I Shahbaz Ahmed 61
Iterative Modeling then leads to ....
EskimoSize
Dress()Smile()Sleep()
CaveLightingEnter()Leave()
lives in
but is it the right model?
Entrance*
OutsideTemperature
LightSeasonHunt()
Organize()
moves around
WindholeDiameter
MainEntranceSize
Software Engineering-I Shahbaz Ahmed 62
Alternative Model: The Head of an Indian
IndianHair
Dress()Smile()Sleep()
MouthNrOfTeethsSizeopen()speak()
*EarSizelisten()
FaceNosesmile()close_eye()
Software Engineering-I Shahbaz Ahmed 63
Class Identification Class identification is crucial to object-oriented modeling Basic assumption:
1. We can find the classes for a new software system: We call this Greenfield Engineering
2. We can identify the classes in an existing system: We call this Reengineering
3. We can create a class-based interface to any system: We call this Interface Engineering
Why can we do this? Philosophy, science, experimental evidence What are the limitations? Depending on the purpose of the system
different objects might be found• How can we identify the purpose of a system?
Software Engineering-I Shahbaz Ahmed 64
What is this Thing?
Software Engineering-I Shahbaz Ahmed 65
Modeling a Briefcase
BriefCase
Capacity: IntegerWeight: Integer
Open()Close()Carry()
Software Engineering-I Shahbaz Ahmed 66
A new Use for a Briefcase
BriefCase
Capacity: IntegerWeight: Integer
Open()Close()Carry()
SitOnIt()
Software Engineering-I Shahbaz Ahmed 67
Questions
Why did we model the thing as “Briefcase”? Why did we not model it as a chair? What do we do if the SitOnIt() operation is the most
frequently used operation? The briefcase is only used for sitting on it. It is never
opened nor closed. • Is it a “Chair”or a “Briefcase”?
How long shall we live with our modeling mistake?
Software Engineering-I Shahbaz Ahmed 68
3. Hierarchy We got abstractions and decomposition
• This leads us to chunks (classes, objects) which we view with object model
Another way to deal with complexity is to provide simple relationships between the chunks
One of the most important relationships is hierarchy 2 important hierarchies
• "Part of" hierarchy• "Is-kind-of" hierarchy
Software Engineering-I Shahbaz Ahmed 69
Part of HierarchyComputer
I/O Devices CPU Memory
Cache ALU Program Counter
Software Engineering-I Shahbaz Ahmed 70
Is-Kind-of Hierarchy (Taxonomy)
Cell
Muscle Cell Blood Cell Nerve Cell
Striate Smooth Red White Cortical Pyramidal
Software Engineering-I Shahbaz Ahmed 71
So where are we right now? Three ways to deal with complexity:
• Abstraction • Decomposition• Hierarchy
Object-oriented decomposition is a good methodology• Unfortunately, depending on the purpose of the system, different objects
can be found How can we do it right?
• Many different possibilities• Our current approach: Start with a description of the functionality (Use
case model), then proceed to the object model• This leads us to the software lifecycle
Software Engineering-I Shahbaz Ahmed 72
Software Lifecycle Activities
Subsystems
Structured By
class...class...class...
SourceCode
Implemented By
Solution Domain Objects
Realized By
SystemDesign
ObjectDesign
Implemen-tation Testing
Application
Domain Objects
Expressed in Terms Of
Test Cases
?
Verified By
class.... ?
RequirementsElicitation
Use CaseModel
Analysis
...and their models
Software Engineering-I Shahbaz Ahmed 73
Software Lifecycle Definition Software lifecycle:
• Set of activities and their relationships to each other to support the development of a software system
Typical Lifecycle questions:• Which activities should I select for the software
project?• What are the dependencies between activities? • How should I schedule the activities?
Software Engineering-I Shahbaz Ahmed 74
Reusability A good software design solves a specific problem but is general
enough to address future problems (for example, changing requirements)
Experts do not solve every problem from first principles• They reuse solutions that have worked for them in the past
Goal for the software engineer:• Design the software to be reusable across application domains and
designs How?
• Use design patterns and frameworks whenever possible
Software Engineering-I Shahbaz Ahmed 75
And oh yes one more thing Always remember the law of diminishing
returns.• “Your tea will get sweater up to a certain level
only and the excess sugar will produce no effect”
• Same is the case with software engineering Moral
• Efficient resource Utilization
Software Engineering-I Shahbaz Ahmed 76
Key points
Software engineering is an engineering discipline that is concerned with all aspects of software production.
Software products consist of developed programs and associated documentation. Essential product attributes are maintainability, dependability, efficiency and usability.
The software process consists of activities that are involved in developing software products. Basic activities are software specification, development, validation and evolution.
Methods are organised ways of producing software. They include suggestions for the process to be followed, the notations to be used, rules governing the system descriptions which are produced and design guidelines.
Software Engineering-I Shahbaz Ahmed 77
Key points CASE tools are software systems which are designed
to support routine activities in the software process such as editing design diagrams, checking diagram consistency and keeping track of program tests which have been run.
Software engineers have responsibilities to the engineering profession and society. They should not simply be concerned with technical issues.
Professional societies publish codes of conduct which set out the standards of behaviour expected of their members.