Send
Close Add comments:
(status displays here)
Got it! This site "creationpie.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
Errors and changes
1. Errors and changes
The definition of an error and a desired change is very similar.
Both an
error and a
change are a difference between the observed behavior and the expected or desired behavior.
To identify an error requires a
specification and one should not use the operational code (in programming, or reality in general) as a specification.
2. Errors
Have you ever heard about "
changing" the "
error of your ways"?
An
error and a
change are both defined as a difference between the observed behavior and the expected or desired behavior.
A
warning is similar to an error except that it is not considered as important an issue as an error.
To identify an error requires a
specification and one should not use the operational code as a specification.
Inerrancy reasoning fallacy:
You cannot know that the Bible has an error unless you know what the Bible is supposed to say.
3. Perspective
Alan Kay (American computer scientist) . Talk at Creative Think seminar, 20 July 1982.
A change in perspective is worth 80 IQ points.
Perspective is worth 80 IQ points.
Point of view is worth 80 IQ points
Kay uses the example of solving problems using polar coordinates rather than Cartesian coordinates. Each works better in certain circumstances. Kay developed (invented) object-oriented and user interface ideas that changed computer science and led to the modern window interface with icons, the mouse, etc.
Principles of duality in many fields allow the same problem to be addressed from two seemingly different points of view.
4. Error types
There are many types of errors.
syntax and grammar
semantics and meaning
logical
Which error is the most difficult to detect? Choices are syntax/grammar errors, semantics/meaning errors, logical errors
Logical errors can be very difficult to detect because they are based on incorrect assumptions.
[PSU woman's basketball team]
5. Three errors puzzle
What is not there may be important?
Consider this self-referential sentence that has real issues. First, find them. Then ask yourself the following question. How easy is it to fix them?
6. Program errors
An error in a program is often called a bug.
The goal is to create a bug-free program. There is no reason that a small program should contain bugs.
In large software engineering projects, however, the goal is to have as few critical bugs as possible within the constraints of the resources available to the project.
7. Compile-time errors
Compile-time errors can be of several types.
syntax errors
semantic errors
A
syntax error is an error in punctuation, grammar, etc.
spelling errors
grammar errors
A
semantic error is an error where the syntax does not make sense.
word meaning error or confusion
8. Logical errors
Logical errors are errors based on incorrect assumptions.
Make necessary assumptions.
Make no unnecessary assumptions.
9. Wording
Rather than using the text "
Consider the following code:" and asking the student to find an error, consider using the following text.
"
Consider the following code that computes the maximum of the values in array variable called values and stores that maximum value in'' the variable called max ..."
Then ask about a possible error. Note that without a specification one may be able to identify some obvious and possible errors (e.g., array index out of bound) in the code but not how to resolve or fix that error.
10. Testing
Testing is the process of finding differences between the expected behavior of the desired system and the observed behavior of the existing system. That is,
testing is insuring that what you expect is what you get. You would like to find and fix these differences before your customers find them.
Those differences could be "
errors" to be eliminated or "
changes" to be made.
11. Program testing
Program testing can be used to show the presence of bugs, but never to show their absence! Edsger Dijkstra (computer scientist)
Dahl, O., Dijkstra, E., & Hoare, C. (1972).
Structured programming. New York: Academic Press., p. 6.
Dijkstra has said that if debugging is the process of removing bugs from a program, then programming must be the process of putting them in.
12. Change management
A "change management" system allows tracking changes to the code of software systems.
A change management system is sometimes called a "version control" system.
13. Regression testing
A "
regression testing" system allows tracking changes to the output of software systems.
14. Errors
I was eventually persuaded of the need to design programming notations so as to maximize the number of errors which cannot be made, or if made, can be reliably detected at compile time. Tony Hoare (British computer scientist)
15. End of page