1. Adding unit tests to Lab 3

Part of the Lab 3 assignment includes designing and writing unit tests to test your HeapPage solution. When designing your tests, think about the main functionality of the HeapPage as well as edge cases and robust error handling. Developing quality tests is essential to getting your implementation to be correct. Quality of tests is important, not the quanity of tests.

We give you starting point unit tests in unittest.cpp, but you will need to add more either in a new test suite or existing ones. In lab today, we will to through exercises to help you think about test design.

Today we will:

  • look briefly at this code and how to add more unit tests.

  • break you up into groups to think about how to add some additional insert testing (conceptually). Think about how to:

    • insert records until a page is full?

    • how to test that this is correct? What are the different items we should check to see that the page is indeed full and has the records we inserted?

    • what should we do with the full page to check that our error handling works?

    • what are some insert edge cases?

    • does inserting different records sizes allow you to test anything specific about insert?

  • come back together and, together, we will start implementing some of your ideas in unittest.cpp

There is more detailed information about testing off the lab webpage: Lab 3: SwatDB Heap Page


In addition to the lab assignment page, look at the Wed Lab from Week 6 page for some reminders about SwatDB, the HeapPage, and C++ programming that are particularly helpful for this lab.