38
Software Engineering: Theory and Practice David Hyland-Wood [email protected], [email protected] 1

Umw Software Engineering Guest Lecture 05 Sep2007

Embed Size (px)

Citation preview

Page 1: Umw Software Engineering Guest Lecture 05 Sep2007

Software Engineering:Theory and Practice

David [email protected], [email protected]

1

Page 2: Umw Software Engineering Guest Lecture 05 Sep2007

Agenda

Theory

Practice

Understanding before doing

Beautiful code

Guessing the future

2

Page 3: Umw Software Engineering Guest Lecture 05 Sep2007

Theory

3

Page 4: Umw Software Engineering Guest Lecture 05 Sep2007

Lost in Terminology

Software metric primitives are non-isomorphic:

“defect”

“resource”

“programmer”

“time”

4

Page 5: Umw Software Engineering Guest Lecture 05 Sep2007

Lost in Terminology

Entailment?I need help *FINDING*

my tail!

http://www.flickr.com/photos/efleming/237379205/

5

Page 6: Umw Software Engineering Guest Lecture 05 Sep2007

60/60 Rule

Cost of softwareover entire lifecycle

6

Page 7: Umw Software Engineering Guest Lecture 05 Sep2007

Understanding and Bugs

Causes of bugs:The greatest number of bugs

occur in requirements specification and design

Cost of repair:The greatest cost is incurred in correcting requirements bugs

7

Page 8: Umw Software Engineering Guest Lecture 05 Sep2007

Three Fallacies

The Fallacy of Perfect Knowledge:It is possible to capture complete, non-conflicting requirements with sufficient attention to detail.

8

Page 9: Umw Software Engineering Guest Lecture 05 Sep2007

Three Fallacies

The Fallacy of Perfect Knowledge:It is possible to capture complete, non-conflicting requirements with sufficient attention to detail.

Users generally do not know what is possible, do not agree among themselves and may not understand all aspects of their system.

9

Page 10: Umw Software Engineering Guest Lecture 05 Sep2007

Three Fallacies

The Fallacy of the Big Round Ball:Requirements don’t change appreciably after delivery or can be controlled.

10

Page 11: Umw Software Engineering Guest Lecture 05 Sep2007

Three Fallacies

The Fallacy of the Big Round Ball:Requirements don’t change appreciably after delivery or can be controlled.

Requirements change continuously as software ages. This should be seen as a benefit.

11

Page 12: Umw Software Engineering Guest Lecture 05 Sep2007

Three Fallacies

The Fallacy of Perfect Execution:It is possible to create flawless code with sufficient attention to detail.

12

Page 13: Umw Software Engineering Guest Lecture 05 Sep2007

Three Fallacies

The Fallacy of Perfect Execution:It is possible to create flawless code with sufficient attention to detail.

We need to admit that arbitrary logic is hard to verify in the general case, hard or impossible to fully test and, combined with inconsistent or changing requirements, hard to trace programmer intent.

13

Page 14: Umw Software Engineering Guest Lecture 05 Sep2007

Practice

14

Page 15: Umw Software Engineering Guest Lecture 05 Sep2007

(With apologies to S. Gross)

The Real World isSoft and Mushy

15

Page 16: Umw Software Engineering Guest Lecture 05 Sep2007

A History of Silos

1970s 1980s 1990s

$ cat foo.txt | grep blah | sort

A neat little package Client-Server The Early Web

16

Page 17: Umw Software Engineering Guest Lecture 05 Sep2007

The Next Great Leap

Web of Data

Extending theUniversal Client

Expanding theUniversal Connection

Providing theUniversal Database

Explaining the Logic

Ubiquitous,reusable applications

17

Page 18: Umw Software Engineering Guest Lecture 05 Sep2007

Examples

18

Page 19: Umw Software Engineering Guest Lecture 05 Sep2007

New Applications

19

Page 20: Umw Software Engineering Guest Lecture 05 Sep2007

And More....

20

Page 21: Umw Software Engineering Guest Lecture 05 Sep2007

Understanding Before Doing

Some material adapted from Kurt Akeley,General Manager, Microsoft Research Asia, 21 July 2006

21

Page 22: Umw Software Engineering Guest Lecture 05 Sep2007

The Cost of Failure

“If you can’t code something, it is because you don’t understand it” -- Jon Butler

Sadly, the reverse is not true.

22

Page 23: Umw Software Engineering Guest Lecture 05 Sep2007

Writing Facilitates Understanding

The process of writing is the process of refining one’s thoughts.

Refinement of thought applies to writing both words and code.

23

Page 24: Umw Software Engineering Guest Lecture 05 Sep2007

“This, surely, is the secret of Lincoln’s eloquence. He not only read aloud, to think his way into sounds, but wrote as a way of ordering his thought.”

— Garry WellsIn Lincoln at GettysburgSimon & Shuster, 1992

24

Page 25: Umw Software Engineering Guest Lecture 05 Sep2007

“Don’t worry if you don’t understand this book completely on the first reading. We didn’t understand it all on the first writing!”

— Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (aka The Gang of Four)In Design Patterns, Addison Wesley, 1995

25

Page 26: Umw Software Engineering Guest Lecture 05 Sep2007

Write Up

ResultsDone?

Research &

Develop

Yes

No

Stop

?

Write First

26

Page 27: Umw Software Engineering Guest Lecture 05 Sep2007

Beautiful Code

27

Page 28: Umw Software Engineering Guest Lecture 05 Sep2007

What Does Your CodeLook Like?

28

Page 29: Umw Software Engineering Guest Lecture 05 Sep2007

A Hardware Analogy

29

Page 30: Umw Software Engineering Guest Lecture 05 Sep2007

Another Hardware Analogy

30

Page 31: Umw Software Engineering Guest Lecture 05 Sep2007

“Higher-level programming ... allows good programmers to write more beautiful code, and bad programmers to write stuff that's even uglier than it used to be.”

— Andy Oram & Greg Wilson (eds.)Beautiful Code, O’Reilly, 2007

31

Page 32: Umw Software Engineering Guest Lecture 05 Sep2007

Creating Beautiful Code

Beauty counts“Omit needless words!” -- Strunk and WhiteDevelop a habit of refactoring for both

design and maintenanceThe art changes; keep up

32

Page 33: Umw Software Engineering Guest Lecture 05 Sep2007

Guessing the Future

33

Page 34: Umw Software Engineering Guest Lecture 05 Sep2007

Writing Business Applications

1970s 1980s 1990s 2000s

Code written

Dataformatted

34

Page 35: Umw Software Engineering Guest Lecture 05 Sep2007

Same Data, Different Forms

HumanReadable

MachineReadable

35

Page 36: Umw Software Engineering Guest Lecture 05 Sep2007

Getting to the Web 2.0+ Enterprise

Thanks to CBS Paramount Television. TM & Copyright © 2007 CBS Studios Inc.

36

Page 37: Umw Software Engineering Guest Lecture 05 Sep2007

2000 3B

2001 6B

2002 12B

200324B

40,000 BCEcave paintings

bone tools

writingpaper

printing

electricity, telephone

transistorcomputing

Internet(DARPA) The web

GIGABYTES

2000 rich contentSource: UC Berkeley School of Information Management and Systems,Robert Steele, CEO OSS, Inc.

The Information Economy

37

Page 38: Umw Software Engineering Guest Lecture 05 Sep2007

Don’t Focus on Code

Solve problems insteadStart thinking about information spacesNavigating

Creating

Extracting From

Extending

Abstraction, abstraction, abstraction

38