CS 5959-001 - Writing Solid Code - spring 2014

T,H / 12:25 PM - 1:45 PM WEB 2470

Instructor: John Regehr

Prereqs: a decent grade in CS 4400 and a strong desire to learn
software craftsmanship

This course is about the art and science of writing code that actually
does what we want it to do and what we think it does. In contrast, if
you are familiar with the frequent updates that are pushed out to
basically every application and operating system, then you are used to
the idea that our code commonly does not do exactly what we
wanted. Avoiding bugs in code comes down to rigorous application of a
few special skills:

- Testing. How do we know what test cases to write? How do we know the
  right answers for the test cases that we do write? How can we tell
  when we've done enough testing? This could easily be its own class
  but I'll try to compress it down to the essentials. A good tester
  wants to make code fail, which explains why it is hard to test our
  own code -- subconsciously we usually want it not to fail.

- Debugging. Here I'm not talking about using gdb but rather about the
  more general skill of reasoning about failures and narrowing down
  their causes. Here are some more details about my view of debugging:
  http://blog.regehr.org/archives/199

- Code reviews. If your code is solid, then you can stand up and
  explain how it works to a group of people whose job it is to find
  problems in your code. On the other side, you can read a piece of
  code or be a participant in a code review, and offer constructive
  criticism to the code's author.

- Specifications. A specification is an independent statement of what
  the code is supposed to do. This can be an English document, a piece
  of mathematics, or something else. Assertions and loop invariants
  are simple examples of specifications. We will look at the use of
  assertions, invariants, and other kinds of specifications, some of
  which are supported by tools that ensure that the code matches the
  specification.

Programming assignments for this class will be fairly small and will
be in C. The format will be interactive and I will not just be
standing there lecturing every day. We'll be doing a lot of code
reviews. There will be some friendly competitions where you try to
break other people's code and they try to break yours. Enrollment is
by instructor permission. If you want to enroll, send me a mail
indicating that you have read this description and also tell me the
grade you received in CS 4400.

Textbooks will be:

http://www.amazon.com/Writing-Solid-Code-20th-Anniversary/dp/1570740550/
http://www.amazon.com/Debugging-Indispensable-Software-Hardware-Problems/dp/0814474578/