Collatz


Due: Thu, 30 Jan 2014, 10pm
80 pts, 8% of total grade.


Specification


Write a program, individually, to solve The 3n+1 Problem in Python:

For all projects, the minimum requirement for getting a non-zero grade is to write standard-compliant Python (2.7 or 3.2.3), to satisfy all of the requirements in the table below, including the precise naming of all the files, and to fill out the Google Form.

For this project, the additional minimum requirement for getting a non-zero grade is that Sphere accept your solution to 4073 (PYTH 2.7 or 3.2.3) and that you design and implement some form of cache to make it efficient.

You can earn 5 bonus pts, if Sphere accepts your solution to 4765 (PYTH 2.7 or 3.2.3).

Bonus pts will not increase the total score beyond the max score.

Analysis


These are additional descriptions of the underlying math:

Tools


Guides


Requirements


Points Description Files
1 5 pts A private Git repository at GitHub, named cs327e-collatz, with the grader invited as collaborator and at least 5 commits, one for each bug or feature.
If you cannot describe your changes in a sentence, you are not committing often enough. Meaningful commit messages identifying the corresponding issue in the issue tracker (below). See here.
A log of the commits, named Collatz.log.
cs327e-collatz
Collatz.log
2 5 pts A GitHub issue tracker with an issue for each of the requirements in this table and at least 10 more issues, one for each bug or feature, both open and closed with a good description and a label.
3 20 pts An average of at least 3 unit tests for each function, in the files TestCollatz.py and TestCollatz.out, that tests corner cases and failure cases.
A copy of your unit tests in the files <cs-username>-TestCollatz.py and <cs-username>-TestCollatz.out in the public test repo.
TestCollatz.py
TestCollatz.out
4 20 pts At least 1000 lines of acceptance tests, in the files RunCollatz.in and RunCollatz.out, that tests corner cases and failure cases.
A clone of the public test repo with a copy of your acceptance tests in the files <cs-username>-RunCollatz.in and <cs-username>-RunCollatz.out.
RunCollatz.py
RunCollatz.in
RunCollatz.out
5 20 pts A standard-compliant Python (2.7 or 3.2.3) program in the file Collatz.py, with assertions that check pre-conditions, post-conditions, argument validity, and return-value validity, that runs as fast as possible and uses as little memory as possible. Collatz.py
6 10 pts HTML documentation in the file Collatz.html, that documents the interfaces to your functions.
Inline comments if you need to explain the why of a particular implementation.
A consistent coding convention with good variable names, good indentation, blank lines, and blank spaces.
Collatz.html
7 A file that combines Collatz.py and RunCollatz.py in the file SphereCollatz.py. SphereCollatz.py
8 A make file in the file makefile. makefile.cs327e.py
9 A ZIP file in the file Collatz.zip. Collatz.zip
10 A submission to Turnin.
11 A Google Form.

Grader


Name GitHub ID GitHub Test Repository Turnin ID Turnin Project Folder Google Form
Aizhuldyz Gabbassova aizhuldyz collatz-tests aizhuli cs327epj1 Google Form

Checklist


  1. Get an educational account with 5 private repos at GitHub.
  2. Create a private Git repository at GitHub, named cs327e-collatz.
  3. Add all of the requirements (above) to the issue tracker at GitHub.
  4. Clone your private Collatz repo onto your local directory.
  5. Invite the grader to your private Collatz repo.
  6. Confirm that the grader has invited you back to the public test repo.
  7. Clone the public test repo onto your local directory. It is critical that you clone the public test repo into a different directory than the one you're using for your private Collatz repo.
  8. Clone the public class repo onto your local directory. It is critical that you clone the public class repo into a different directory than the one you're using for your private Collatz repo.
  9. Copy the Collatz files from the clone of the public class repo to the clone of the private Collatz repo.
  10. Run RunCollatz.py and TestCollatz.py, confirm the expected failures, and add, commit, and push to the private Collatz repo.
  11. Write more unit tests in TestCollatz.py until you have an average of 3 tests for each function, confirm the expected failures, and add, commit, and push to the private Collatz repo.
  12. Implement and debug the simplest possible solution in collatz_eval() in Collatz.py until all tests pass and add, commit, and push to the private Collatz repo.
  13. Combine Collatz.py and RunCollatz.py into SphereCollatz.py (don't forget to remove import).
  14. Create an account on Sphere.
  15. Submit SphereCollatz.py to Sphere and confirm the likely result of time exceeded or wrong answer.
  16. Further debug the code, add the two quiz optimizations until it's accepted by Sphere, and add, commit, and push to the private Collatz repo.
  17. Create 1000 lines of acceptance tests and add, commit, and push to the private Collatz repo.
  18. Copy your unit tests and your acceptance tests to your clone of the public test repo, rename the files, do a git pull to synchronize your clone, and then add, commit and push to the public test repo.
  19. Implement and debug the simplest possible cache until all tests pass and add, commit, and push to the private Collatz repo.
  20. Submit and debug until accepted by Sphere and add, commit, and push to the private Collatz repo.
  21. Run pydoc on Collatz.py.
  22. Create a log of your commits.
  23. Create and submit the ZIP file to Turnin.
  24. Fill in the Google Form.
  25. It is your responsibility to protect your code from the rest of the students in the class. If your code gets out, you are as guilty as the recipient of academic dishonesty.

Submission


Submit a single ZIP file, named Collatz.zip, to the grader's Turnin account, with the following files, order doesn't matter:

  1. makefile
  2. Collatz.html
  3. Collatz.log
  4. Collatz.py
  5. RunCollatz.in
  6. RunCollatz.out
  7. RunCollatz.py
  8. SphereCollatz.py
  9. TestCollatz.out
  10. TestCollatz.py