Documentation is textual information within a program
that helps convey the meaning of the program to human readers
who need to understand, modify, or debug the program.
Forms of Documentation
(See also the CS101 Style
Guide.)
//
until the end of a line is considered a comment, and the
compiler ignores it.)
In CS101, we will concentrate on the first 3 forms of documentation.
You will see examples of external documentation in CS101, and may
begin writing some of your own external documentation in CS102.
All of your code in CS101 should conform to the
CS101 Style Guide.
Principles of Testing
Testing is a comprehensive organized effort to exercise all
aspects of a software system for possible failure.
if part as well as the else
part of a conditional statement.
; or
},
Note: Errors may cause the compiler to go "off course." Try
correcting the first few errors and running the compiler
again.
Correcting Run-time Errors
(Debugging)
| What you can do | When or why it's useful | How (in Symantec Cafe) |
|---|---|---|
| Start (or stop) debugging | Locate the source of an error in your program | Debug Menu (Start/Stop Debugging) F4 ![]() |
| Step through execution | Watch each step of the program as it executes to find out what went wrong | |
|
|
F8 ![]() |
|
|
F10 ![]() |
| See the value of a variable in the code at the current point in the execution | Check the state of the program against what you expect | Position the mouse cursor over the variable and the value will pop up |
| Examine the call stack | See the history of how you got where you are | Look at the call window |
| Examine the values of parameters and local variables for procedures on the call stack | Isolate the error to a particular procedure | Right click on the relevant line in the call window and select "show data" |
| Set breakpoints | Mark places in the code to stop the execution for study | Right mouse click on the line of code and select
"set/clear breakpoint", or click on the line of code and
press
|
| Go until breakpoint | Execute the program, pausing at the first breakpoint or exception encountered, or running until the program terminates normally. | ![]() |
Kenneth J. Goldman Last modified: Mon Jan 20 22:34:32 CST