slide 1.1 object-oriented and classical software...

29
Slide 1.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach [email protected]

Upload: others

Post on 25-May-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.1

© The McGraw-Hill Companies, 2002

Object-Oriented and Classical Software

Engineering

Fifth Edition, WCB/McGraw-Hill, 2002

Stephen R. [email protected]

Page 2: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.2

© The McGraw-Hill Companies, 2002

CHAPTER 1

SCOPE OFSOFTWARE ENGINEERING

Page 3: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.3

© The McGraw-Hill Companies, 2002

Outline

Historical aspectsEconomic aspectsMaintenance aspectsSpecification and design aspectsTeam programming aspectsThe object-oriented paradigmTerminology

Page 4: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.4

© The McGraw-Hill Companies, 2002

Scope of Software Engineering

Historical Aspects– 1968 NATO Conference, Garmisch– Aim: to solve the “Software Crisis”– Software is delivered

» Late» Over budget» With residual faults

Page 5: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.5

© The McGraw-Hill Companies, 2002

Scope of Software Engineering (contd)

Why cannot bridge-building techniques be used to build operating systems? – Attitude to collapse– Imperfect engineering– Complexity– Maintenance

Page 6: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.6

© The McGraw-Hill Companies, 2002

Conclusion

Software Engineering is not “Engineering”

Page 7: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.7

© The McGraw-Hill Companies, 2002

Economic Aspects

Economically viable techniquesCoding method CMnew is 10% faster than currently used method CMold. Should it be used?– Common sense answer

» Of course!

– Software Engineering answer » Consider the effect of CMnew on maintenance

Page 8: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.8

© The McGraw-Hill Companies, 2002

Maintenance Aspects

Software Life Cycle– The way we produce software, including

» The life-cycle model» The individuals» CASE tools

Page 9: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.9

© The McGraw-Hill Companies, 2002

Life-cycle model

1. Requirements phase2. Specification phase3. Design phase4. Implementation phase5. Integration phase (in parallel with 4)6. Maintenance phase7. Retirement

Page 10: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.10

© The McGraw-Hill Companies, 2002

Approximate Relative Cost of Each Phase

1976–1981 dataMaintenance constitutes 67% of total cost

Page 11: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.11

© The McGraw-Hill Companies, 2002

Comparative Relative Cost of Each Phase

Page 12: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.12

© The McGraw-Hill Companies, 2002

Good and Bad Software

Good software is maintained—bad software is discardedDifferent types of maintenance– Corrective maintenance [about 20%]– Enhancement

» Perfective maintenance [about 60%]» Adaptive maintenance [about 20%]

Effect of CMnew on maintenance

Page 13: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.13

© The McGraw-Hill Companies, 2002

Specification and Maintenance Faults

60 to 70 percent of faults are specification and design faultsData of Kelly, Sherif, and Hops [1992]– 1.9 faults per page of specification– 0.9 faults per page of design– 0.3 faults per page of code

Data of Bhandari et al. [1994]

Page 14: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.14

© The McGraw-Hill Companies, 2002

Specification and Maintenance Faults (contd)

Faults at end of the design phase of the new version of the product– 13% of faults from previous version of product– 16% of faults in new specifications– 71% of faults in new design

Page 15: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.15

© The McGraw-Hill Companies, 2002

Cost to Detect and Correct a Fault

Page 16: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.16

© The McGraw-Hill Companies, 2002

Team Programming Aspects

Hardware is cheap– We can build products that are too large to be written

by one person in the available timeTeams– Interface problems– Meetings

Page 17: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.17

© The McGraw-Hill Companies, 2002

The Object-Oriented Paradigm

The structured paradigm had great successes initially– It started to fail with larger products (> 50,000 LOC)

Maintenance problems (today, up to 80% of effort)Reason: structured methods are – Action oriented (finite state machines, data flow

diagrams); or – Data oriented (entity-relationship diagrams,

Jackson’s method);– But not both

Page 18: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.18

© The McGraw-Hill Companies, 2002

The Object-Oriented Paradigm (contd)

Both data and actions are of equal importanceObject: – Software component that incorporates both data

and the actions that are performed on that dataExample:– Bank account

» Data: account balance» Actions: deposit, withdraw, determine balance

Page 19: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.19

© The McGraw-Hill Companies, 2002

Structured versus Object-Oriented Paradigm

Information hiding Responsibility-driven designImpact on maintenance, development

Page 20: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.20

© The McGraw-Hill Companies, 2002

Key Aspects of Object-Oriented Solution

Conceptual independence– Encapsulation

Physical independence – Information hiding

Impact on development– Physical counterpart

Impact on maintenance– Independence effects

Page 21: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.21

© The McGraw-Hill Companies, 2002

Responsibility-Driven Design

Also called “Design by Contract”Send flowers to your aunt in Iowa City– Call 1-800-FLOWERS– Where is 1-800-FLOWERS?– Which Iowa City florist does the delivery?– Information hiding

Object-oriented paradigm– “Send a message to a method [action] of an object“

Page 22: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.22

© The McGraw-Hill Companies, 2002

Transition From Analysis to Design

Structured paradigm:– Jolt between analysis (what) and design (how)

Object-oriented paradigm:– Objects enter from very beginning

Page 23: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.23

© The McGraw-Hill Companies, 2002

Analysis/Design “Hump”

Systems analysis– Determine what has to be done

Design– Determine how to do it– Architectural design—determine modules– Detailed design—design each module

Page 24: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.24

© The McGraw-Hill Companies, 2002

Removing the “Hump”

Object-oriented analysis– Determine what has to be done– Determine the objects

Object-oriented design– Determine how to do it– Design the objects

Page 25: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.25

© The McGraw-Hill Companies, 2002

In More Detail

Objects enter here

Page 26: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.26

© The McGraw-Hill Companies, 2002

Warning

Do not use the object-paradigm to enhance a product developed using the structured paradigm– Water and oil do not mix

Exception: if the new part is totally disjoint– Example: adding a GUI (graphical user interface)

Page 27: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.27

© The McGraw-Hill Companies, 2002

Terminology

QualityProgram, system, productMethodology, paradigmMethod and techniqueClient, developer, userBug – “A bug crept into the code”

instead of

– “I made a mistake”

Page 28: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.28

© The McGraw-Hill Companies, 2002

Object-Oriented Terminology

Data component of an object– State variable– Instance variable (Java)– Field (C++)– Attribute (generic)

Action component of an object– Member function (C++)– Method (generic)

Page 29: Slide 1.1 Object-Oriented and Classical Software Engineeringrepository.binus.ac.id/content/t0123/t012312686.pdf · The Object-Oriented Paradigm (contd) zBoth data and actions are

Slide 1.29

© The McGraw-Hill Companies, 2002

Object-Oriented Terminology (contd)

C++: A member is either an– Attribute (“field”), or a– Method (“member function”)

Java: A field is either an– Attribute (“instance variable”), or a– Method