ud494 »

Test Driven Development Project

Overview

After Project 1, Lauren was so happy with the AverageSentenceLength application that she decided to hire your team again for another project. For this new project, your team 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 such as 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. Specifically, this project will consist of three deliverables:

Deliverable 1

Provided

  • Story/task cards
  • Junit test cases

Expected

  • Code that makes the test cases pass

Deliverable 2

Provided

  • Story cards
  • Task cards

Expected

  • Junit test cases

Deliverable 3

Provided

  • Test cases (yours from Part 2)

Expected

  • Code that makes the test cases pass

Deliverable 1 Details

For this deliverable, 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

Data

  • 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.

Instructions

  • Keeping in mind the story card and the corresponding tasks, write code that makes the provided test cases pass. (Important: you cannot modify the provided test cases; that is, you cannot modify class GradesDBTest.)
  • To access the spreadsheet use the Apache POI library.
  • All the materials needed for the assignment are available in your team repository, under the directory 6300Sum14Project3/GradesTool:
    • JUnit test cases (directory "test")
    • Apache POI, JUnit, and other necessary libraries (directory "libs")--you should not need any other non-standard libraries
    • GradesDatabase6300.xlsx spreadsheet (directory "DB")
  • Directory GradesTool is already configured as an Eclipse project, so you should be able to directly import the project from git under Eclipse.

Deliverable 1 Submission

  • Write the code that makes the provided test cases pass in package edu.gatech under directory "src" (you should already have the right directory structure).
  • Commit and push your code.
  • Paste the commit ID for your submission on T-Square.

Deliverable 2 Details

Preamble

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, from which another team in your company extracted a set of task cards. Being extremely good at drawing, they also provided a sketch of the GUI they envision for the tool.

Instructions

  1. Carefully read the story and task cards presented below.
  2. Extend the list of task cards in case you believe you may need additional classes to realize the provided story cards.
  3. Write a set of JUnit test cases that cover the additional functionality in the system.
  4. Use your judgment and the guidelines provided in the video lessons to decide when the set of test cases is adequate.
  5. 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.
  6. You do not need to supply any JUnit test cases for the GUI, but you may create tests for it, if you want to, for extra points (up to 10% of your grade).
  7. Submit your test cases (and possibly additional task cards) by the due date. Note that, since your new tests will cover functionality that is not yet implemented, not only they will not pass, but they won't even compile. We strongly recommend that you write skeleton code (i.e., classes and methods without a body) for the classes so that the tests compile, which is a useful check and will force you to think a bit more about the interface. (Note that Eclipse can add such skeleton code for you after you have defined your set of test cases.)

Important notes:

  • You should NOT write the code that implements the functionality described in the story (and task) cards, but just the JUnit tests for that code! (And possibly the skeleton code needed to make the tests compile, as described above.)
  • You still cannot modify class GradesDBTest. If you need to add test cases for class GradesDB, make sure to create a new test class for it (e.g., GradesDBTest2).

Deliverable 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:

gui.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) and saved in the current directory (i.e., the directory from which the tool is run).

Deliverable 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 Teams class to hold information about all teams in a class. The class should contain a constructor that takes a reference to a GradesDB instance as input and constructs (and stores) the Team objects based on the information in that instance. The class should also provide a method that refreshes the list of teams.

Task 3

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

Task 4

Create a Projects class to hold information about all projects for a class. The class should contain a constructor that takes a reference to a GradesDB instance as input and constructs (and stores) the Project objects based on the information in that instance. The class should also provide a method that refreshes the list of projects.

Task 5

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

Task 6

Expand the GradesDB class by creating a method that outputs all information for a student, which can be either written to a text file or in the text box in the GUI.

Task 7

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

Deliverable 2 Submission

  • Add your JUnit test cases in package edu.gatech under directory "test" (where the other test cases are).
  • If you create the skeleton code to make the provided test cases compile, add it to package edu.gatech under directory "src" (where your other code is).
  • If you create additional task cards, add them in a file called "extra_task_cards_D2.md" or "extra_task_cards_D2.txt" (depending on the format you decide to use, markdown or textual) in the root directory of your project.
  • Commit and push your code.
  • Paste the commit ID for your submission on T-Square.

Deliverable 3 Details

Coming in due time.