CIS 163 |
Simple Date |
Summer 2020 |
Complete this Optional survey for extra credit.
GitHub Classroom URL: classroom.github.com/a/gw-Ues5y
Objectives:
- Review CS 162 topics
- Expand upon the use of class (i.e.,
static
) data and methods - Introduce enumerations
- Introduce unit testing with JUnit
- Provide experience developing challenging algorithms
Due Dates:
- Demonstrate project is configured properly: Friday, 8 May 2020, 8:00 am
- Submit test cases: Monday, 11 May 2020, 8:00 am
- Final submission: Monday, 18 May 2020, 8:00 am
Problem Statement
You will implement and thoroughly test a class that stores and analyzes calendar dates
Workflow
- Begin by following this link and cloning the resulting git repository. The key files include:
src/Date163.java
: This is the class you will be writing. To help you get started, I've provided shells for the methods you need to write.test/Date163Test.java
: This will be your test class. I have provided a few sample tests to help you get started.instructorTests.jar
: This file is used by the auto-grader. Don't touch it.lib/junit-platform-console-standalone-1.6.2.jar
: This contains the JUnit library. Your IDE probably provides it; but, the autograder needs a copy in the repo.
- Write a thorough set of "black box" unit tests for each method in
Date163
. The javadoc header on each method explains what each method should do.- Submit these tests by Monday, 11 May 2020, 8:00 am
- To submit your tests, use git to commit your changes with "
[Tests]
" in the commit message, then push.
- Implement the methods in the order they appear in
Date163.java
. (They are listed from easiest to hardest.) Each time you complete a method, run your unit tests and watch the number of failures decrease. - When your code passes all of your tests, review your tests from a "white box" perspective and add more tests if necessary.
- Use git to commit and push your code. When you push your code, my tests will run automatically.
- If the automated tests all pass, congratulations! Submit your project following the instructions below.
- If an automated test fails, then you are missing a test case in your own test suite. Add tests until one fails, fix the broken method, and submit again.
Rules:
- You must implement the algorithms yourself. You may not use
GregorianCalendar
or any other calendar library. - You must use GitHub / GitHub Classroom and use standard git tools to clone the repository and push your code. Important: It is important that you use standard git tools to clone this repository. Do not simply download the individual files from the GitHub website. More importantly: Use standard git tools to submit your work. Do not submit your code by using the GitHub website to upload files individually. Every semester students permanently loose work because the upload/download code incorrectly.
- I will not grade your code until it passes my tests.
- Attempting to modify, decompile, or otherwise gain access to the contents of
instructorTests.jar
(or any other file not intended for student use) is a violation of the Academic Honesty Policy. - The "two-digit-year" features are not tested automatically. (In other words, just because your automated build passes does not mean that this feature works correctly.)
- Your code must follow good coding style and practice including:
- inner explanatory comments where appropriate,
- use of descriptive variable and method names,
- use of constants (i.e.,
static final
variables) where appropriate (such asMIN_YEAR
), and - use of private "helper" methods where necessary to avoid duplicate
code (for example, have the instance method
isLeapYear()
call the class methodisLeapYear(int)
).
Submitting your Project
To submit your project:
- Double check that your "two digit year" features have been thoroughly tested. (Remember, the auto-grader does not check these features.)
- Clean up your code (check for proper indention, long lines, etc.)
- Make sure your code meets the standards given at the end of the "Rules" section above.
- Fill out
checklist.txt
and add it to your repository. - Commit/push with "[Grade me]" in the commit message.
Grading Rubric
Category | Points |
---|---|
Timeliness | 70 |
Two digit year | 10 |
Coding style | 20 |
Note: Points will be deducted for insufficient testing and/or not following a TDD workflow as discussed in class.
Timeliness is based on when your code passes the automated tests:
Day | Points |
---|---|
Two days early | 74 |
One day early | 72 |
On time | 70 |
Late | -3 points per day |
Quick Git Reference
- Cloning
- To clone a repo (i.e., download it to begin using it):
- Go to your repos main GitHub web page.
- Click the green button labeled "Clone or Download"
- Make sure the box says "Clone with SSH"
- Copy the URL to the clipboard. (The URL should begin with "
git@github.com:
") - From the command line, run
git clone the_url_you_copied
- Committing / Pushing
- To commit changes and push them to your repo:
- From the root of your repo, run
git add .
. - Then run
git commit -m "your_message_here"
. The main purpose of the message is so you can look back on the commits and know what additional work was done for each commit. I also use commit messages to know when you are ready for me to look at your work. - Finally, run
git push
.
- From the root of your repo, run
- Pulling
- If changes were made to your repository from another location, be sure to run
git pull
before doing additional work. There are several ways external changes can happen. For example,- You may be working on two different machines (e.g, a desktop and a laptop). To switch from the desktop to the laptop, you would push the changes on the desktop , then pull those changes onto the laptop.
- I may make changes to your code, either when providing feedback, or in response to a request for help.
Updated Thursday, 14 May 2020, 9:29 AM