C Grading FAQ

CS3410 Spring 2015

Q1: What is a binary?
A binary is also known as a program, application, or executable. The binary is the file created when you run gcc code.c -o output. In this example, code.c is your textual C program (also known as source code) and output is the binary. Both must be submitted to the CMS. We will accept Windows and Mac binaries but it is in your best interests to submit a Linux binary (read on to find out why).
Q2: What do you do with the code and binary?
We copy your code to an Ubuntu Linux machine and test it for compile and link errors. If the program builds successfully, then we run regression tests on the built binary. Submitting compilable code is very important. There is a heavy penalty for code that doesn't compile. Even if you can't finish the assignment, you should at least submit a compilable program.
Q3. How do I prepare my code to pass the regression tests?
First, you should make sure it compiles cleanly and runs cleanly with memory checkers. Clean means no errors and no warnings. For example, gcc -g -Wall -std=c99 code.c -o output -lmcheck ; valgrind -q ./output.

Second, you should test your code with all possible inputs. Being creative about choosing good test cases is part of good programming. Try large inputs and inputs that exercise every branch of your program.

Q4. How difficult are the regression tests?
If your program can handle the simple and reasonable tests then you will receive almost full credit. We will typically take off only one point for failing the difficult tests.