CS 3 (Spring 2023) Practicum - Code Quality

This document describes the code quality portion of the course-long, solo assignment you will be expected to complete in CS 3.

Adam has written a file name searching program, (their masterpiece!) but, though “working correctly”, it suffers from many code quality problems akin to what might be discussed in a code review. It will be your job to modify the code to fix these problems throughout the term. For ideas about how to get started, feel free to consult these guidelines. Note that we are not expecting you to modify the functionality of the code - only the quality.

Due Dates and Grading

There will be five checkpoints throughout the term, one every two weeks, in which you will be allowed to submit up to four new fixes to the codebase. Before the deadline, you should fill out the Gradescope form, outlining the fixes you have made and why you think they make the code better. This document will be half of your grade for each issue; the other half will be a verification that your new code actually fixes the issues you identified. We will be grading for two issues each week, but you are welcome to submit up to four. At the end, your total score will be the cumulative number of points you have received, out of the expected number of points if you successfully fixed ten issues (grades will not exceed 100%).

Please note that any formatting fixes, including the issues specified in the “Formatting” section of the code quality guidelines, will not result in credit in any week. Additionally, fixing the same issue multiple times will not result in credit for subsequent fixes.

The due dates for the five checkpoints are specified on the course calendar.

Files

You will at some point modify the following files in your fixes.

Restrictions

To facilitate testing, we have the following requirements:

The smoke_main and smoke_regex tests should check for these issues. If you fail either of the smoke_ tests and cannot figure out why, please request office hours from a member of course staff. Additionally, the main tests and mainreplacedcode tests should always pass.

Testing Your Code

You can run make test at any time to test your changes’ functionality, and it should always pass (unless you are working on the regex portion and add regex tests that might fail - see regex document). You can check if your code compiles, or create an executable to run custom arguments with, with the command make main. It is recommended you play around with compiling and executing the program as part of figuring out how it works.

An important note - print statements in your code will cause many of our tests to break. If you want to print and test simultaneously, we suggest you use fprintf - e.g. fprintf(stderr, "statement")