introduction to software engineering - gowthamivuppala · somnuk keretho/kasetsart university...

34
Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of Computer Engineering Faculty of Engineering, Kasetsart University Email: [email protected] URL: http://www.cpe.ku.ac.th/~sk

Upload: truongtu

Post on 04-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University

Introduction to Software Engineering

Somnuk Keretho, Assistant Professor

Department of Computer Engineering

Faculty of Engineering, Kasetsart University

Email: [email protected]

URL: http://www.cpe.ku.ac.th/~sk

Page 2: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 2

Outline of this presentation

• Scope of Software Engineering

• Object-Oriented Software Development

• Software Process

• Software Life-Cycle Models

• Object Orientation

• Software Quality Assessment

Reference to Chapter 1/2/3 of “Software Engineering with JAVA”, S.R. Schach, McGraw-Hill, 1997.

Page 3: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 3

Scope of Software Engineering

• Software engineering is a discipline whose aimis the production of fault-free software, that isdelivered on time, within budget, and satisfiesthe user’s needs.

Page 4: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 4

Scope of Software Engineering

• Historical Aspects:– 1967, a NATO group coined the term “Software

Engineering”

– 1968 NATO Software Engineering Conferenceconcurred that “Software production should be anengineering-like activity”.

– Using philosophies and paradigms of establishedengineering disciplines to solve “Software Crisis: thatthe quality of software was generally unacceptably lowand that deadlines and cost limits were not being met”.

Page 5: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 5

Scope of Software Engineering

• Economic Aspects– Software Engineering v.s. Computer Science

• The computer scientist investigates several ways to producesoftware, some good and some bad.

• But the software engineer is interested in only those techniquesthat make sound economic sense.

For example: A coding technique that can execute veryefficiently but with higher maintenance cost may not be a goodchoice.

Page 6: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 6

Scope of Software Engineering

• Maintenance Aspects– Software Life Cycle / Software Process

• Requirements Phase

• Specification (Analysis) Phase

• Planning Phase

• Design Phase

• Implementation Phase

• Integration Phase

• Maintenance Phase (highest cost among all these phases)– Corrective, Perfective, and Adaptive Maintenance

• Retirement

Page 7: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 7

Scope of Software Engineering

Requirement 2%Specification 4%Planning 1%Design 6%Module Coding 5%Module Testing 7%Integration 8%Maintenance 76%

Maintenance67%

Approximate relative costs of the phases of the software life cycle.

Maintenance is so important, a major aspect of software engineeringconsists of techniques, tools, and practices that lead to a reduction inmaintenance cost.

Page 8: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 8

Scope of Software Engineering

• Specification and Design Aspects– Software professionals are humans, and humans can

make error.

– The fact that so many faults are introduced early in thesoftware life cycle, highlights another important aspectsof software engineering, namely, techniques that yieldbetter specifications and designs.

• For example, reducing specification and design faults by 10%will reduce the overall number of faults by 6-7%.

Page 9: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 9

Scope of Software Engineering

• Team Programming Aspects– Most software being developed and maintained by a

team of software engineers

– Scope of software engineering must also includetechniques for ensuring that teams are properlyorganized and managed.

• For example, team programming leads to interface problemsamong code components and communication problems amongteam members.

Page 10: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 10

Scope of Software Engineering

• Several techniques have been suggested to help solve thesoftware crisis.– ~1975-1985: Structured Paradigm

• Structured Systems Analysis, Composite/Structured Design, StructuredProgramming, Structured Testing

• Lead to major improvements for software industry.

• But only good for small programs (say, 5,000-50,000 lines of codes)

• Not scale well with today larger programs (say, 500.000-5,000,000 LOC)

• Not so good in software maintenance aspects, (for instance, because of theseparation of action-oriented and data-oriented in structured paradigm).

– Object-Oriented Paradigm• An object is a unified software component that incorporates both data and

actions that operate of those data.

Page 11: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 11

Scope of Software Engineering

Structured Paradigm• Requirement Phase

• Specification (Analysis) Phase

• Planning Phase

• Design Phase

• Implementation Phase

• Integration Phase

• Maintenance Phase

• Retirement

Object-Oriented Paradigm• Requirement Phase

• Object-Oriented AnalysisPhase

• Planning Phase

• Object-Oriented Design Phase

• Object-OrientedProgramming Phase

• Integration Phase

• Maintenance Phase

• Retirement

Comparison of life cycles of structures paradigm and object-oriented paradigm.

Page 12: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 12

Object-Oriented Software Development

• Three key words.– Software

– Development

– Object Orientation

• Let us look at each in turn

Page 13: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 13

Software

• Programs

• Documentation during the development ofprograms (e.g. specification)

• Primary aids for running the programs (e.g.user manuals)

• Secondary aids for running the programs (e.g.key boards overlays)

Software is not just programs!

Page 14: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 14

Software Life Cycle

• Software is like humans.

• It has a life cycle.

• Software in a system is conceptualized first.

• It becomes obsolescent at the end.

• The period in between is called the software lifecycle.

Page 15: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 15

Software Life Cycle Models

• Build-and-Fix Model

• Waterfall Model

• Rapid prototyping model

• Incremental Model

• Spiral Model

• Concurrent Development Model

• Formal Methods Model

For the first four items, please refer to Chapter 3 of “Software Engineering with JAVA”, S.R. Schach, McGraw-Hill, 1997.

Page 16: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 16

Built-and-Fix Model

• Unfortunately, many s/w products aredeveloped with built-and-fix model.

• Without specification or any attempt in design,just build a product, and reworked as manytimes needed to satisfy the customer.

• Unsatisfactory for any size of s/w development,we better specify the various phases of softwareprocess.

Page 17: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 17

Why use a life cycle model?

• Life cycle model breaks down the developmentprocess into phases or stages.

• This is because software development iscomplex.

• Breaking down the development process makesit easier to manage.

• Each phase can be performed in various ways.

Page 18: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 18

Waterfall ModelRequirement Verify

Implementation Testing

Planning Verify

Retirement

Design Verify

Integration Testing

Operation Mode

Specification Verify

Development

Maintenance

Changed Requirements verify

Page 19: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 19

Rapid Prototyping Model

• A rapid prototype is a working model that isfunctionally equivalent to a subset of the product(internal structure is not concerned yet).

• The sole use of rapid prototyping is to determine whatthe client’s real needs are, construct the rapidprototype as rapidly as possible to speed up the s/wdevelopment process.

Page 20: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 20

Rapid Prototyping ModelRapid Prototype Verify

Implementation Testing

Planning Verify

Retirement

Design Verify

Integration Testing

Operation Mode

Specification Verify

Development

Maintenance

Changed Requirements verify

Page 21: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 21

Incremental Model

• The s/w product is designed, implemented,integrated, and tested as a series of incrementalbuilds, where a build consists of code piecesfrom various modules interacting to provide aspecific functional capability.

• It is sometimes necessary to re-specify,re-design, re-code, or at worst, throw awaywhat has already been completed and startagain.

Page 22: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 22

Incremental ModelRequirement Verify

Planning Verify

Retirement

Architectural Design Verify

Operation Mode

Specification Verify

Development

Maintenance

For each build: Perform detailed design, implementation, and integration. Test.

Deliver to client.

Page 23: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 23

Spiral Model

• The idea of minimizing risk via the use ofprototypes and other means is the conceptunderlying the spiral model.

• A simplified spiral model is as a waterfallmodel with each phase preceded by riskanalysis.– Before commencing each phase, an attempt is made to

control (resolve) the risks. If it is impossible to resolveall the significant risks at a stage, then the project isimmediately terminated.

Page 24: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 24

Full Spiral Model [Boehm, IEEE 1998]

ReviewCommitment

Partition

Determineobjectives, alternatives,constraints

Progressthrough steps

Cumulativecost

Plan next phase

Develop, verifynext-level product

Evaluate alternatives,identify, resolve risks

RiskAnalysis

Concept ofOperation

Requirement planlife-cycle plan

Prototype 1 Prototype 2 Prototype 3OperationalPrototype

RiskAnalysis

RiskAnalysis

RiskAnalysis

Simulations, models, benchmarks

SoftwareRequirements

SoftwareProductDesign

DetailedDesign

Development Plan

Integration and TestPlan

ImplementationAcceptanceTest

IntegrationTest

UnitTest

CodeRequirementValidation

Design validationand verification

Page 25: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 25

Software Development

• Software is developed using a life cycle model.

• Just a life cycle model is insufficient fordevelopment.

• We need:– A broad philosophy

– A set of tools which support the philosophy.

– A language which supports the philosophy.

Page 26: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 26

Software Development Paradigm

• A paradigm provides a general approach towork during each phase of the life cycle model.

• A paradigm is a broad philosophy.

• A paradigm is not a specific model.

Page 27: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 27

Some Software Development Paradigms

• Functional Composition

• Logic Programming

• Structured Development

• Object Orientation

Page 28: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 28

Functional Development

• A problem is expressed in termed of a set ofmathematical functions.– e.g. Double(x) = Add(x, x).

• An algorithm is not specified.

• Language such as Miranda, Gofer, Haskellsupport this paradigm.

• Poor execution speed.

Page 29: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 29

Logic Programming

• Consists of a problem description only.– e.g. Factorial(0) = 1.

Factorial(N) = N x Factorial(N -1).

• Doesn’t describe how to solve the problem.

• Languages Prolog & Lisp support thisparadigm.

Page 30: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 30

Structured Development

• Also called SASD, SADT & FunctionalDecomposition.

• Breaks the system into processes & decomposesthem.

• Languages C, Fortran, Pascal, Cobol, Basicand a lot more support this paradigm.

• By far the most popular paradigm.

Page 31: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 31

Object Orientation

• Most recent paradigm.

• Treats a problem as a collection of objects.

• Becoming very popular now.

• More and more languages support thisparadigm now.

Page 32: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 32

Tools for OO

• Rambaugh (OMT)

• Coad-Yourdon

• Booch

• UML

Page 33: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 33

Languages for OO

• C++

• Smalltalk

• Eiffel

• Object C

• Object Pascal

• Java

Page 34: Introduction to Software Engineering - gowthamivuppala · Somnuk Keretho/Kasetsart University Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of

Somnuk Keretho/Kasetsart University 34

Software Quality Assessment

• CMM by SEI

• ISO 9000