1 / 14

Murphy’s Laws

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.

edolie
Download Presentation

Murphy’s Laws

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Murphy’s Laws

  2. 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.

  3. Callahan’s Corollary to Murphy’s Laws • Murphy was an Optimist !

  4. 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();

  5. 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;

  6. 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.

  7. 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.

  8. 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”.)

  9. Moreinfo

  10. 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

  11. Maintenance • Maintenance occurs whenever we modify or change a program. • Three types of maintenance: • Corrective • Adaptive • Perfective

More Related