Be sure to look at the Blackboard Module for this week for various hand-in mechanisms!

Note: C18, C19, C21 updated on 9/29/2018.

HW #20 updated 10/6 for clarification.

C18 & C19 In Class Exercise: Quality Metrics & Version Proliferation

This is a discussion group exercise. Discuss the following questions within your group and come to the best concensus answers you can.

C21: Counter Rollover

This is a group programming assignment that should be completed in class.

Assume that you are building a system that has a real time counter installed. For reasons that are lost to history, the designers made the decision to implement that counter as a 32-bit signed value that counts in milliseconds (i.e., that counter increments once every 1 msec.) The last time someone did this they built a system an aircraft had to be rebooted every three weeks to avoid a counter overflow bug. Two possible ways to avoid the overflow bug are proposed:

If your group is an EVEN group number, do option #1. If your group is an ODD group number do option #2.
(if you get done early, we suggest you talk through the solution strategy for the other option within your group.)

Create C language functions for your option and a unit test strategy. DO NOT fix any bugs after the hand-off to unit test. The point is to get an idea of what aspects of these functions are tricky to implement. You can use any development, build, run, and unit test environment you prefer.

Sequence of steps:

  1. Write code to avoid the overflow bug according to the assigned option
  2. Potentially in parallel, write unit tests that will exercise the counter function (perhaps have some team members write code and others define unit tests)
  3. Make hand-in slides
  4. To the extent you have time, compile, run, and unit test the code. Update slides as you have time.

Hand-in format:

Homework #20: Review for Exam #1

The goal of this homework is to give you time and some guidance in studying for the mid-term exam.

20-1: (10 points). If you had ONE thing out of the entire first half of the course that you want the professor to explain or explain again in class, what would it be? Ask a clear and concise question on a specific point if at all possible. Paste in a screen grab of the relevant slide from the web version of the lectures (or other soruce) on the slide following your answer so it is right there to talk about. We'll cover as many as possible of these in class, so make your question count!

20-2. (6 points per lecture) For each lecture in Exam #1, produce a summary of the following points. For this question, your hand-in should have one slide per lecture (even if that leaves empty space on some slides). Each slide should have both the lecture number and title (e.g., "7. Code Style/Language") at the top of the slide, and then contain the bullets listed below on the rest of the slide:

Note: Only material from numbered lectures, in-class exercises, and project is eligible to be on the test, and the test will heavily emphasize numbered lectures. Also, you can skip optional material without a lecture number, such as in-class presentations from industry that did not get a lecture number on the course scheduling grid and supplemental material not discussed in class that appears in HW assignments. A number of topics in the Toyota UA lecture are not testable if they are covered in the second half of our course (e.g., SIL, MISRA Guidelines, Faults, FCRs, concurrency, use of redundant processors, single points of failure).

Homework #21: Time Bugs

21-1. For the topic assigned below, find an example of a failure or potential failure involving time or counter overflows, or other topics as described. Some categories are finding a good example of a particular failure mode (e.g., leap second), while other are finding a good example of any time-related failure in a particular domain. Many of these will be discussed in class, so if you see multiple examples on searches please try to look past the first hit and pick one that you think is the most interesting to talk about in class. Please make sure that your slides will be easily readable when displayed in class, and be ready to give a 2 or 3 minute discussion of your topic in class. Topics are assigned based on your sign-in number as below.

Topic assignments for this question are as below, based on the last digit of your student sign-in number. (For example, if your sign-in sheet number is 17 you are a "7".) If you have a strong preference not to do a particular topic such as a personal experience with a failure of this type, just let the instructor know and do either the topic before or the topic after.

21-2: (3 points total) Watch the Computerphile video on time and time zones. (about 10 minutes long). List the three most interesting facts you learned from watching this video, some of which might overlap items discussed in our course lecture (1 point each). (NOTE: This is one of the best technical rants ever!)

21-3: (3 points total) Watch the Computerphile video on internationalization. (about 8 minutes long). List the three most interesting facts you learned from watching this video (1 point each).

Supplemental Materials

Other interesting time-related problems and bugs: