This week's project is to use test-driven development (TDD) to finish the PlayList project for our company. To do so, you are to use TDD to test and build the following methods:
You are to use test-driven development for this project; for each method:
You are also to design and build an application that provides a textual, menu-driven user-interface that runs in a console or Terminal window that your boss can use to interact with a playlist. This application should let your boss search the playlist by song title, artist, and/or year, add a song to the playlist, remove a song from the playlist, and save the playlist. For example, your application might display:
Welcome to the PlayList Manager!
Please enter:
1 - to search the playlist for songs by a given artist
2 - to search the playlist for songs from a given year
3 - to search the playlist for songs with a given phrase in their title
4 - to add a new song to the playlist
// ... other options ...
0 - to quit
--->
Alternatively, you might have the user enter characters
for the menu choices (i.e., a, b, c, ...) instead of numbers.
Your program should use a loop that displays the menu,
reads the user's choice, and performs the corresponding function,
until the user chooses to quit.
As in the lab exercise, you should design this application using an object-oriented approach. (Hint: the word application is a noun, so you should build a class for it.)
Each file should contain opening documentation providing the who, where, when, what, and why information for that file. Your should use good programming style and make your code self-documenting in terms of identifier names, vertical and horizontal white space, etc.
Finally, each non-test-method you write should be preceded by a comment that explains what the method does, and lists its parameters, return values, any preconditions (what must be true when it begins), and postconditions (what is true when it finishes). Use the documentation from the lab exercise methods as a model.
In general, constructors and void methods should include a postcondition that indicates what is true when the method terminates. Non-void methods should indicate what value(s) they return. Some methods may need to specify both a postcondition and what they return.
One reason we do this is because tools like Doxygen (for C/C++) and JavaDoc (for Java) can process such comments and automatically generate HTML documentation pages like the C++ API. Think of this as practice for when you start using such tools.
Create a script file, in which you: (i) use the ls command to list the files of your project (all .h, .cpp, and .txt files), (ii) use the cat command to show the contents of each file, (iii) show that they compile and link correctly, and (iv) show that they run and solve the project-problem completely and correctly. Make certain that this script file is inside your Eclipse project folder, so that that folder contains all files related to this project.