6. Peer review and unit testing
In this assignment, you will be working with the anonymized code that was submitted by one of your fellow students for assignment 4. For simplicity, you will only see their I/O routine module.
You will "git clone" their code on the Teach cluster as follows:
$ git clone /scinet/course/phy1610/submission/NUMwhere NUM is a specific two-digit number that will be send to you by email. Note that while it would have been good to see their full repo with their previous commit messages, these are too hard to anonymize, so you'll see just one commit in this repo that added just their I/O code.
After cloning, your task is to:
- Write a short code review (3 pages max.) that addresses:
- the code's structure, comments, documentation, logic, potential performance issues, readability and maintainability;
- whether these functions could be used in your antsontable code (and if not, why?),
- techniques in the code that you liked and might use in your own code.
- suggestions for improvements (but do not implement them yourself),
Use theScientific Software Development Lessonsdocument as a guide for what to look for.
Keep your criticism constructive and try to strike a professional, colleagial tone.
Add the review to the repo. The review can be in plain text, markdown, latex, or pdf. -
Next, write units test for this modules, with at least one unit test for every function defined in the header file(s). Do not start a different git repo, rather, work with the
cloned one. For unit tests, use one of the following frameworks:
catch2, Boost.Test, or googletest. All three are available as modules
on the Teach cluster ("module load catch boost googletest", though
boost requires gcc to be loaded). Catch2 is perhaps the simplest to
get started with, but the lecture slides on software testing
have examples for Boost.Test.
Implement and run unit tests for all the functions defined in the I/O module interface. Do not use the same data as in the full antsontable code, rather, use some simpler small table to write out and read in.
Use a makefile and git throughout your assignment, i.e.
- Whenever you write a test, create a target for it in the Makefile, such that "make TARGETTEST" runs the test called TARGETTEST. Also create an overall "test" target that runs all of tests. Enable automation of running all the tests with the single command "make test".
- We expect to see several meaningful git commits.
- Do not commit any data that is produced!
- Make sure to commit all necessary files to run the code and its tests.
Submit the git repo as in previous assignments, i.e., by using the git2zip command on the Teach cluster, and uploading the resulting zip file to the website. The due date for submission is Friday March 5, 2021, at 5:00 PM EST.