+ All Categories
Home > Documents > Murphy’s Laws

Murphy’s Laws

Date post: 21-Jan-2016
Category:
Upload: edolie
View: 36 times
Download: 0 times
Share this document with a friend
Description:
Murphy’s Laws. Murphy’s Laws. Things are more complex than they seem to be. Things take longer than expected. Things cost more than expected. If something can go wrong, it will. Callahan’s Corollary to Murphy’s Laws. Murphy was an Optimist !. Programming Errors. - PowerPoint PPT Presentation
Popular Tags:
14
Murphy’s Laws
Transcript
Page 1: Murphy’s Laws

Murphy’s Laws

Page 2: Murphy’s Laws

Murphy’s Laws

• Things are more complex than they seem to be.

• Things take longer than expected.

• Things cost more than expected.

• If something can go wrong, it will.

Page 3: Murphy’s Laws
Page 4: Murphy’s Laws
Page 5: Murphy’s Laws
Page 6: Murphy’s Laws

Callahan’s Corollary to Murphy’s Laws

• Murphy was an Optimist !

Page 7: Murphy’s Laws

Programming Errors• Lexical errors – occur whenever

Karel reads a word that is not in his vocabulary.

Example in English: We are giving directions on how to get to Portland and we write:

“fadt jdhpy hqngrps ggssi sgr ghhgh grmplhms?”

In English these are spelling errors.

Example for Karel: We want Karel to turn left and we write TurnToTheLeft();

Page 8: Murphy’s Laws

• Syntactic error – when we use incorrect grammar or inaccurate punctuation.

Example in English: Suppose we are giving instructions to a lost motorist and we say “for keep hundred just miles going eight.” These errors are grammatical errors in English.

Example in Karel: Suppose we wish Karel to turn left and we write ()TurnLeft;

Page 9: Murphy’s Laws

• Execution errors – This is caused in a Karel program when Karel is unable to execute an instruction successfully and is forced to perform an error shutoff.

For example, we ask Karel to move and he is facing a wall.

Page 10: Murphy’s Laws

• Logic (or Intent) errors – This happens when Karel performs a different task than his assigned task. This means that the program is incorrect for the task, but not so incorrect that Karel can discover the error.

For example, we wish for Karel to go get his newspaper and come back to bed. However, we forget to issue a PickBeeper() command so when he gets back to bed, he has not completed his assigned task.

Page 11: Murphy’s Laws

All types of errors are known as bugs.

Debugging is the name that programmers give to the activity of removing errors from a

program.

(Origin of the term “debugging”.)

Page 12: Murphy’s Laws

More info

Page 13: Murphy’s Laws

Good Programming Style• A program that works perfectly is not

considered a good program; it is simply a working program. To write a good robot program you must follow these guidelines: – a program must be easy to read and

understand – a program must be easy to debug – a program must be easy to modify to solve a

variation of the original task

Page 14: Murphy’s Laws

Maintenance

• Maintenance occurs whenever we modify or change a program.

• Three types of maintenance:– Corrective– Adaptive– Perfective


Recommended