ud494 »

Test Driven Development Assignment


To find the due date and see where this fits in the course overall, see the schedule.


In this set of three assignments, you must develop a simple tool (GradesTool) that, given a database with various data about the students in a class, allows the instructors to get information about the students and their performance. You will develop the GradesTool application by following a test-driven development approach like the one we saw in P4L4, in which development happens in iterations and according to the following cycle: (1) select story cards to implement, (2) define task cards for the selected story cards, (3) write test cases for the classes in the task cards, (4) write code that makes the test cases pass.

Part 1


  • Story/task cards
  • Junit test cases


  • Code that makes the test cases pass

Part 2


  • Story cards
  • Task cards


  • Junit test cases

Part 3


  • Test cases (yours from Part 2)


  • Code that makes the test cases pass

Part 1 Details

For this first part of the assignment, we will assume to be in the first iteration of the process and that somebody has already done the steps from (1) through (3) described in the overview. You will be provided with a story card, two task cards derived from it, and a set of corresponding test cases, and your job will be to perform step (4): writing code that makes the test cases pass.

Story Card

"The instructor (or the TA) launches the GradesTool application to get information about the students and the class. The application prints the number of students and information about each student: name, GT ID, e-mail, and attendance. It also prints the number of assignments and projects given so far. After that, it asks the user if (s)he wants to continue or exit. In the former case, it prints the latest information again.”

Example "screenshot"

Important note: you don’t have to build this front-end. It is provided just to better clarify the requirements.

Screen Shot 2013-12-30 at 4.16.35 PM.png


  • All data is stored in an Excel file called GradesDatabase6300.xlsx (to access the file, see instructions below).

Task Cards

  • Task 1: Develop a class (Student) that holds the information about a student, such as name and GT ID.
  • Task 2: Develop a class (GradesDB) that encapsulates most of the system functionality and provides an intuitive interface towards the information in the spreadsheet.


  • Keeping in mind the story card and the corresponding tasks, write code that makes the provided test cases pass.
  • To access the spreadsheet use the Apache POI library.
  • All the materials needed for the assignment are available in a zip file available here. Specifically, the file contains:
    • JUnit test cases (src directory)--also available in the Udacity quiz where you will submit your code
    • Apache POI, JUnit, and other necessary libraries (libs directory) — you should not need any other non-standard libraries
    • GradesDatabase6300.xlsx spreadsheet
  • You are welcome to use the Udacity IDE to develop your code, but we believe that Eclipse or another development environment will be more conducive to both coding and debugging. Just make sure to go back to the quiz to submit your code when you are done.

Part 1 Submission

The Udacity quiz can be found here.

Part 2 Details


The customers loved the first delivery so much that they decided to expand the project by

  • Adding functionality
  • Adding a GUI

To this end, they provided the teams with additional story cards that describe the additional requirements.

Being extremely good at drawing, they also provided a sketch of the GUI they envision for the tool.

They also provided task cards for clarity.


  1. Carefully read the story and task cards presented below.
  2. Write a set of JUnit test cases that cover the additional functionality.
    • Use your judgment and the guidelines provided in the videos to decide when the set of test cases is adequate
    • The set of test cases should include (1) tests for all relevant methods of the new classes, and (2) tests that target the new or modified functionality in existing classes
    • You do not need to supply any JUnit test cases for the GUI, but you may if you wish.
  3. By the due date, go to the Udacity quiz to submit your test cases.  Note that since your new tests will cover functionality that is not yet implemented, they will not pass, but you may write skeleton code/stubs for the classes so that the tests compile if you wish. You can do this in your local environment (Eclipse does that for you, for instance), but this code does not have to be submitted.

Remember, you should NOT write the code to implement the functionality described in these cards, just the JUnit tests for that code!

Part 2 Story Cards

Story Card 1

Instructors and TAs use the GradesTool application to get information about the students’ performance. They can pick the name of a student from a list, and the application shows the student information. A possible GUI for the tool is the following:

Screen Shot 2013-12-31 at 2.49.57 PM.png

Story Card 2

Using the tool, users can see a student’s name, GT ID, e-mail address, project information, and assignment information. Project information includes, for each project, the student’s team grades, the average grade across teams, and the average contribution received by the student from his/her team members. Analogously, assignment information includes, for each assignment, the student grade and the average grade for the class.

Story Card 3

The users of the tool can select a student and save his/her information in a file named after the student (e.g., LaraineSmith.txt)

Part 2 Task Cards

Task 1

Create a Team class to hold information about a particular team, including team number, list of Student names, team grade, and list of average contribution ratings.

Task 2

Create a Project class to hold information about a particular project, including project number, project description, list of Teams, and average project grade

Task 3

Create an Assignment class to hold information about a particular assignment, including assignment number, assignment description, list of Student grades, and average grade

Task 4

Expand the Student class to hold additional information about the student, including email address, and each Team the student was on.

Task 5

Expand the GradesDB class to hold a list of Projects, accessible by project number, and a list of Assignments, accessible by assignment number. Also, create a method to output all information for a student, which can be either written to a text file or the the text box in the GUI

Task 6

Create a GradesToolGUI class with a title bar to display the application name, combo box to display a list of Students, text box to display information about the selected Student, and a save button to save the Student information to a text file

Part 2 Submission

Remember, to submit, go to the Udacity quiz.

Part 3 Details

Write code that fulfills the story and task cards presented in Part 2, taking care to make the set of test cases you wrote for Part 2 pass.

Ideally, the test cases you submitted for Part 2 should not change in this submission. In practice, however, we understand that it is possible to make mistakes when writing tests before the code, so we will allow some flexibility there. So the bottom line is: if you did a good job writing meaningful and mostly correct test cases, we will be lenient if you need to make some small change to a couple of tests in this final assignment.

Part 3 Submission

For this part, rather than requiring you to copy/paste all your code into the Udacity editor, we've decided to use GitHub for submission.  You should have been automatically assigned a repo for this purpose.  It does not have any starter code in it, go ahead and populate it with your part 2 submission and work from there.

Once you have completed the project, make sure your final submission is pushed to the repo and go to the Udacity quiz to submit the output of git show (or just the commit SHA if you prefer) after you've committed the code for part 3.