Re: maths for programming C++



In article <87vepnhlrp.fsf@xxxxxxxxxxxx>,
Ben Pfaff <blp@xxxxxxxxxxxxxxx> wrote:
blmblm@xxxxxxxxxxxxx <blmblm@xxxxxxxxxxxxx> writes:

[ snip ]

More power to you. Can you elaborate a little how you explain, in
introductory classes (I'm thinking the first few semesters, not just
CS1), what you mean by correctness, and what you tell the students
about how to (try to) achieve it?

All of our project materials are freely available online, so if
you're really curious you can find out for yourself:
http://cs140.stanford.edu/projects

Very interesting -- not so much with regard to the topic of this
thread as because I sometimes teach a course on operating systems
and am in search of good programming projects. The projects for this
course sound a little like ones based on the NACHOS system from UCB -- ?

Of particular interest:

http://www.stanford.edu/class/cs140/projects/pintos/pintos_1.html#Grading
http://www.stanford.edu/class/cs140/projects/pintos/pintos_8.html

The way we try to encourage correctness is threefold. First,
write a bunch of tests that do their best to ferret out incorrect
implementations. Second, have the students submit a "design
document" along with their code that answers some specific
questions about their code and design decisions. Example:
http://www.stanford.edu/class/cs140/projects/pintos/threads.tmpl
Third, actually have the TAs skim all of the submitted code and
in addition read in detail some of the typical trouble spots.

URLs saved for future reference; thanks.

I think I had in mind a more formal-methods-oriented view of
correctness (and I was a little surprised to hear that this was
happening at Stanford, since I vaguely remember someone telling
me that the department there wasn't really interested in that sort
of thing).

But all of what you describe seems pretty sensible, if not quite
what I thought it might be. Separate design document, automated
testing, grade partly based on review of source code .... It all
sounds like it should work toward your goals. Reviewing the design
documents and students' source code sounds like something that could
easily become tedious and time-consuming (based on my experience with
similar tasks), but that's why you have TAs, maybe. Sort of a :-).

[ snip ]

--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.
.



Relevant Pages

  • Re: Conversion from UTF32 to UTF8 for review
    ... Note that this will call malloc, which will involve setting a lock, ... correctness something which contradicts your own statement. ... it is a target of opportunity to point out that you are not making sense. ... and neither of these represent an acceptable design. ...
    (microsoft.public.vc.mfc)
  • Re: PRIME1 (SPOJ)
    ... <snip lots of primes> ... the correctness of the program to all sorts of things being just right ... The auxiliary bool variable then becomes obsolete: ... Look up "single entry single exit" and you ...
    (comp.lang.c)
  • Re: Conversion from UTF32 to UTF8 for review
    ... A design based on the query of a specific customer using customer number ... much slower that a design based on using a B+ tree index. ... correctness something which contradicts your own statement. ... All of the performance improvements that you suggested ...
    (microsoft.public.vc.mfc)
  • Re: Mans Inhumanity to Man
    ... Gregg nagged me into lowering my English stirrups when I ... your weight change which affects how the saddle fits you? ... We almost achieved correctness in some shots but ...
    (rec.equestrian)
  • Re: MP arrested. Police interfere in politics
    ... but WOULD he be allowed to release the information in the chamber ... not some waffle about moral ... correctness. ...
    (uk.legal)