Friday, October 25, 2013

week 9


Have a nice week with full credits of three quizzes. Project 3 Allocator was also due this Thursday.
Allocator is different from previous projects that there is no online judge for us to see if our code work or not. We only implement header file and the correctness of code will heavily rely on our own unit tests. Maybe in previous projects we can pass the online judge and then complete the unit test, during which we will be very confident. This time, we have no idea about how our code performs. We need to design every possible corner and edge test cases ourselves. Only doing in this way could help us to make sure that we are in a safe environment. In fact, we did find many potential bugs with our test cases. The bug is not so obvious to fail every test. It occurred in some cases. Finding such bugs made me feel great and more confident about our work.
I also want to say some about the test review session. I failed to attend Monday’s session. Since I lost 20 points in multiple choices and 9 points in short answer, and I knew one short answer problem that I made a mistake, I just thought the review session had little meaning to me. However, after seeing my exam on Friday, I found more mistakes than I expected. Some of the problem is just so tricky such as comparing the size of array a and &a[0]. I took it for granted that they are different, just like what we discussed in the class. However, this time size of array a from the second element is 8 bytes, which is the same with the size of an pointer. It reminds me to be more careful during doing these problems.
I also liked the lectures that systematically introduced 6 kinds of variables about their numbers, allocation, initialization, score, and lifetime. Comparison between them will make the knowledge much more clear than ever before. Adding static to local variable changes everything except scope, while adding it to global variable changes nothing but scope. It is such a great sentence to help us memorize the concepts about static, local and global.
Keep fighting in next week!

No comments:

Post a Comment