Quality Douglas Crockford Yahoo! .
-
Upload
virgil-bailey -
Category
Documents
-
view
214 -
download
0
Transcript of Quality Douglas Crockford Yahoo! .
![Page 1: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/1.jpg)
QualityDouglas Crockford
Yahoo!
http://www.crockford.com/codecamp/quality.ppt
![Page 2: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/2.jpg)
The Software Crisis
The topic dominated the computer industry trade press
for about a decade.
![Page 3: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/3.jpg)
The Software Crisis
• Over budget
• Over time
• Unreliable
• Requirements not fully met
• Unmaintainable
• Failure
• Insecure (New!)
![Page 4: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/4.jpg)
Software Crisis
• Year 48
• It is old news, so no one talks about it
• In other news, the Sun will exhaust its supply of Hydrogen
![Page 5: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/5.jpg)
Craft v Engineering
![Page 6: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/6.jpg)
Computer Science has not taught us how to manage
software projects
![Page 7: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/7.jpg)
Software Construction
• In some ways like any other sort of construction.
• In some ways radically different.
![Page 8: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/8.jpg)
The Nature of Software
• Software is powerful and malleable
• That is its blessing
• That is its curse
![Page 9: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/9.jpg)
Programming is Difficult
Software is the most complicated stuff that
humans make
![Page 10: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/10.jpg)
Lack of metrics
Measure of quality or completeness
![Page 11: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/11.jpg)
Lines of Code
• Not an indicator of quality
• Not an effective measure of completeness
• Estimation is difficult
![Page 12: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/12.jpg)
Programmers are optimists
They wouldn't be able to do this work if they were not
![Page 13: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/13.jpg)
Programmers do not understand how they
spend their time
• They think they mostly are typing programs
• Mostly they are in meetings or technical conversations
• Or staring at the screen saying "My God. What have I done?"
![Page 14: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/14.jpg)
Programmers do not understand how they
spend their time
• Programmers tend to be skeptical of process improvements that might require more keystrokes.
• First Rule of Optimization: Optimize the process that is taking the most time.
![Page 15: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/15.jpg)
Programming is a social activity
Solo projects are the exception
![Page 16: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/16.jpg)
Cost of Innovation
• Doing what has been done before
v
• Doing what has not been done before
![Page 17: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/17.jpg)
Legacy
• In other industries, the wealth of practice and tradition
• In software, past accomplishments are considered a liability
• The age at which programs become legacy is getting younger and younger
• Some programs become legacy before they are finished
![Page 18: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/18.jpg)
Leaps
• Software is not governed by Moore's Law
• Software is governed by Murphy's Law
• Software leaps tend to come at 20 year intervals, not 2 year intervals
• Cycle of software generation closely related to cycle of human generation.
![Page 19: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/19.jpg)
Leaps
• Leaps make it possible to implement projects of greater complexity.
• Adoption of leaping software technologies tends to be very slow.
• Controversy.
• Reluctance.
![Page 20: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/20.jpg)
Leaps
• Plugboards
![Page 21: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/21.jpg)
Leaps
![Page 22: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/22.jpg)
Leaps
• Plugboards
• Machine Code
![Page 23: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/23.jpg)
Leaps
• Plugboards
• Machine Code
• High Level Languages
![Page 24: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/24.jpg)
Leaps
• Plugboards
• Machine Code
• High Level Languages
• Structured Programming
![Page 25: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/25.jpg)
Leaps
• Plugboards
• Machine Code
• High Level Languages
• Structured Programming
• Object Oriented Programming
![Page 26: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/26.jpg)
Object Oriented Programming
• 1967 Simula
• 1972 Kay begins Smalltalk
• 1980 Smalltalk released
• 1985 C++ Programming Language
• 1995 The Java Programming Language
• 2004 PHP 5
![Page 27: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/27.jpg)
Leaps
• Plugboards
• Machine Code
• High Level Languages
• Structured Programming
• Object Oriented Programming
• Distributed Programming
![Page 28: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/28.jpg)
Failed Leaps
• Artificial Intelligence
• Fifth Generation Languages
• Computer Aided Software Engineering
• Subjective-oriented, etc.
![Page 29: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/29.jpg)
Software does not have enough self awareness
to be afraid of bugs.That's why it works as well as it does.
![Page 30: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/30.jpg)
Bugs
• Mr Edison, I was informed, had been up the two previous nights discovering a bug in his phonograph.
Pall Mall Gazette, 1889-03-11
![Page 31: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/31.jpg)
Grace Hopper's Bug
![Page 32: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/32.jpg)
Snake Oil
Silver Bullets
![Page 33: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/33.jpg)
Mythical Man Month (1975)
• Fredrick Brooks
• "Adding manpower to a late software project makes it later."
• Second System Effect
• Prototyping (software is like waffles)
• "A project becomes a year late one day at a time."
![Page 34: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/34.jpg)
Literate Programming
• Donald Knuth
• Programs are designed to be read.
• The program is the specification and documentation.
![Page 35: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/35.jpg)
Incrementalism
![Page 36: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/36.jpg)
Beta
Perpetually unfinished
![Page 37: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/37.jpg)
Winchester House
![Page 38: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/38.jpg)
Winchester House
![Page 39: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/39.jpg)
Winchester House
![Page 40: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/40.jpg)
Application Triad
• Skill
Training and experience
• Technology
Work with technology providers and standards bodies
• Requirements
Better understanding of the impact of requirements determination and crisis
![Page 41: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/41.jpg)
![Page 42: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/42.jpg)
Mr Blandings Builds His Dream House (1948)
• Best movie ever about project management
• Blandings's problems:
• Lack of knowledge of technology
• Poor control over requirements
![Page 43: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/43.jpg)
Feature Cost
• Development Time
• Deployment Cost
• Maintenance Cost (bloat, cruft)
• Download Time
• User Confusion/Training
• Bug Delivery
![Page 44: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/44.jpg)
Code Value
• A significant fraction of our valuation is the state of our codebase.
• A low quality codebase is a liability.
![Page 45: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/45.jpg)
Code Quality
• Microview: Coding Conventions
• Macroview: Program Architecture
![Page 46: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/46.jpg)
The simplest thing we can do to enhance the value of our
codebase is to make our programs readable.
![Page 47: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/47.jpg)
Distinguish Invocations
return(value);
if(blah)
foo (wah)
function(){}
return value;
if (blah)
foo(wah)
function () {}
![Page 48: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/48.jpg)
Programs are a medium of intentional communication
• Communicating detailed instructions with the machine
• Communicating with your development community
• Communicating with yourself
![Page 49: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/49.jpg)
Good architecture is necessary to give programs enough structure to be able
to grow large without collapsing into a puddle of
confusion
![Page 50: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/50.jpg)
Changing a correct program into another correct program.
![Page 51: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/51.jpg)
Cruft
Software Scar Tissue
![Page 52: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/52.jpg)
Causes of Cruft
• Premature optimization
• Inexperience
• Misread source
• Feature enhancement
• Death March
![Page 53: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/53.jpg)
Bloat
Software Obesity
![Page 54: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/54.jpg)
Insecurity
Marginal security
![Page 55: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/55.jpg)
Good secure programming is good programming.
![Page 56: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/56.jpg)
It is not unusual for the purpose or use or scope of software to change
over its life.
Rarely are the security properties of software systems reexamined in the context of new or evolving missions.
This leads to insecure systems.
![Page 57: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/57.jpg)
As cruft accumulates, complexity grows,
progess slows.
Eventually, the codebase itself becomes a huge source
of friction
![Page 58: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/58.jpg)
Refactoring
• The process of code refinement.
• Correction of formatting.
• Insertion of documentation.
• Removal of cruft and bloat.
• Restructuring.
![Page 59: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/59.jpg)
Plant and harvest your crops for six years,
but let the land rest and lie fallow
during the seventh year
Exodus 23:10-11
![Page 60: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/60.jpg)
Sometimes the best course is to start over
![Page 61: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/61.jpg)
The Pain of the Crash
Loss of a week's work, a day's work, an hour's work, is
unbearable.
![Page 62: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/62.jpg)
The illusion of completion
"It's in the can."
![Page 63: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/63.jpg)
An experienced team can cross that ground again
very quickly.
Focus must be on simplicity to avoid the second system
effect.
![Page 64: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/64.jpg)
Have regular code readings.
• Don’t wait until release to do code reviews.
• Do team code reading regularly during development.
• Problems can be discovered early.
• Good techniques can be shared early.
• Experienced developers can lead by example.
• Novice developers learn from the group.
![Page 65: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/65.jpg)
Have regular code readings.
• Frequent.
• Helpful.
• Respectful.
![Page 66: Quality Douglas Crockford Yahoo! .](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697c0251a28abf838cd52c9/html5/thumbnails/66.jpg)
Conclusion
• Quality First. Quality Last.
• Readable Code. Code Reading.
• Invest in the quality of your code base.
• Invest in your programmers and managers.
• Quality is the most important feature.