unit tests for chapter 4 with db hack