[Skip to Body]
Primary:
[Front Door]
[Schedule]
-
[Academic Honesty]
[Instructions]
Current:
[Outline]
[EBoard]
[Reading]
-
[Assignment]
Groupings:
[EBoards]
[Examples]
[Handouts]
[Outlines]
[Readings]
Related Courses:
[CSC223 2007F (Davis)]
[CSC223 2004F (Rebelsky)]
Misc:
[SamR]
Back to Design Principles. On to The OOA&D Lifecycle.
This outline is also available in PDF.
Held: Tuesday, April 20, 2010
Summary: We return to the issue of testing, considering kinds of testing one might employ. We also visit two views of handling errors, programming by contract and defensive programming.
Related Pages:
Notes:
Overview:
An example of non-defensive programming in C.
int
main (int argc, char **argv)
{
int i;
FILE *outfile = fopen ("/tmp/params");
for (i = 0; i < argc; i++)
{
fprintf (outfile, "%d: %s\n", i, argv[i]);
}
fclose (outfile);
exit (0);
} /* main */
How might you make it defensive?
Back to Design Principles. On to The OOA&D Lifecycle.
[Skip to Body]
Primary:
[Front Door]
[Schedule]
-
[Academic Honesty]
[Instructions]
Current:
[Outline]
[EBoard]
[Reading]
-
[Assignment]
Groupings:
[EBoards]
[Examples]
[Handouts]
[Outlines]
[Readings]
Related Courses:
[CSC223 2007F (Davis)]
[CSC223 2004F (Rebelsky)]
Misc:
[SamR]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 11 12:40:55 2010.
The source to the document was last modified on Mon Jan 25 20:52:44 2010.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC323/2010S/Outlines/outline.21.html.
You may wish to
validate this document's HTML
;
;
http://creativecommons.org/licenses/by-nc/2.5/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.