# Introduction

In this lab you will get to make a test suite for a linked list class.

Today, it is your job to play testing engineer. You will be writing tests that use the List class the way it’s intended to work. Then, you’ll run your tests to see if the List actually works.

You may be wondering:

• Wait… does List work correctly?
• Is it supposed to do this?
• Are my tests broken?

I dunno, dude! That’s your job to figure out. Good thing you know how to automate your testing.

# Problem 0: Clean up after yourself

You know the drill.

Create a .gitignore file and add stuff you want to ignore.

You will lose points…

1. If you don’t have a .gitignore.
2. If you commit compiled files, editor droppings, or other junk.

# Problem 1: Makefile

Create a Makefile with (at least) the following targets:

1. main which compiles main.cpp
2. test which compiles and runs a test suite
3. coverage which compiles the test suite and runs gcov to determine code coverage
4. clean which cleans up all generated output files

Feel free to borrow from the example Makefile.

# Problem 2: Tests

You should write unit tests to verify that the List class in project/ works like a linked list. If you find that the List doesn’t work as it should, be sure to repair it.

• Use list.h as your documentation. Write some tests that use the List type and verify that the results are sane.
• Your tests should use a test fixture, since you’ll need to create quite a few list objects.
• You should have unit tests for everything in the List class except the destructor and iterator().
• Don’t worry about testing Cell; it’ll get tested when you test List.
• For an example of how to iterate over a list, look in main.cpp.

Some other tips:

• If you have any question as to how List should work, be sure to ask!
• Your tests might be failing because the List code is wrong
• Don’t assume the List is wrong just because your test fails. Make sure your tests is right, too!

# Epilogue

• The layout of your project. You will lose points if…
• …files are not named as specified.
• …files or directories are not present in the expected locations documented at the bottom of this write-up.
• The presence of a useful .gitignore and absence of junk files.
• Your Makefile for the project
• Does it have the requested targets?
• Do those targets work as described?
• Your test suite in project
• Use proper C++ style.
• We will run your test suite to ensure that it works and that your tests pass.
• Your tests should be comprehensive. Make sure to check your coverage!

## Submissions

As always, your git repo on http://git-classes.mst.edu is your submission. Don’t forget to commit and push all relevant files. Make sure you see everything you expect on GitLab!

We expect to see the following files on your master branch:

• .gitignore
• README.md
• examples/
• Makefile
• assertions.cpp
• basic.cpp
• exceptions.cpp
• funcs.cpp
• funcs.h
• main.cpp
• test_funcs.cpp
• test_main.cpp
• test_vector.cpp
• vector.h
• vector.hpp
• project/
• Makefile
• list.h
• list.hpp
• main.cpp
• test_list.cpp
• test_main.cpp

Notice that your repository has a subdirectory! You have the option to put one .gitignore file at the root of your repo, or individual .gitignore files in each directory if you prefer.