CSE 163, Spring 2019: Homework 2: Part 2

Overview

In this part of the assignment, you will write tests for your solutions in Part 0 and Part 1.

Like in Homework 1, we have provided a function called assert_equals that takes an expected value and the value returned by your function, and compares them: if they don't match, the function will crash the program and tell you what was wrong. You can see more instructions an example for tests from the Homework 1 - Part 1 to see examples of how to call the tests.

One thing that is different from the last homework is the assert_equals lives in a file called cse163_utils.py. We imported the function in hw2_test.py in a special way so this shouldn't change how you call assert_equals. You should not modify anything in cse163_utils.py.

Grading

For full credit, your hw2_test.py must satisfy all of the following conditions:

  • Uses the main method pattern shown in class (the starter file will use it).
  • Has a function to test each of the functions in the hw2_manual.py and hw2_pandas.py that you were asked to write. It's okay to merge the test functions for the same problem in the different parts of the homework since their outputs are the same. There might be some redundancy in your tests which is expected since it's hard to factor out the different function calls and input types. You do not need a test for the parse function in Part 1.
  • For each function you need to test, you should include a test that tests the example from the spec and one additional test that is different from what is shown in the spec. A single test is considered a call on assert_equals.
  • Each of these test functions should have a descriptive name that indicates which function is being tested (e.g. test_funky_sum)
  • Each of the test functions must be called from main.
  • Turn in any test CSV files you generate.