Project 1

Due date: Tuesday, September 9 (FIRM)

This is an individual project

Objectives

Installation of required course software, through Android Studio, and creation of a Bitbucket account:

  • Ensure you have a functioning Android Studio development environment. 
  • Ensure you can access the course examples from Bitbucket.
  • Ensure you understand the basics of Java programs and Test-Driven Development (TDD)

An initial understanding of Bitbucket and Android Studio plus Test-Driven Development (TDD)

  • Installing required course software
  • Using course software
    • Using Bitbucket to “clone” (copy) an existing Java Mercurial project
    • Sharing the cloned project with the instructor and TA
    • Using Android Studio to update the cloned project
    • Updating the cloned project by committing it in Bitbucket
  • Using TDD
    • Running the project tests in Android Studio and understanding the results
    • Applying TDD by modifying the project source code so the tests pass
  • Java coding
    • Understanding why the project tests fail and how to modify the program to fix it

Description

In this project, you will clone an existing Java Mercurial project in Bitbucket, download it into Android Studio on your PC, run its single failing test, update the project source to fix the program, and commit your changes to Bitbucket. Your cloned project will be shared with the instructor and TA for grading.

Functional requirements

Start with this code skeleton: https://bitbucket.org/loyolachicagocs_comp313/hello-java. The functional requirements are embodied in the JUnit tests in the test folder; instructions for running the test are included in the README file. When your code passes all the tests, you will have fulfilled the functional requirements for grading purposes. If some of the tests do not pass, you will receive partial credit.

Nonfunctional requirements

Specifically, fix the code in the Java source file within the src folder, using the test cases as your guide. Be sure to push your changes continually! 

Create a doc folder within your local project root folder. Include your screenshot called project1.png in the doc folder.

Notify the instructor and TA when the project is ready to be graded by Submitting a note on Sakai in the Project 1 Assignment.

Grading

  • 1 point – submission via Bitbucket repo (should still show the history before clone)
  • 1 point – fix the getYear method to make the tests pass 
  • 1 point – screenshot showing the fixed getYear method and the tests passing 

3 points total

Detailed Instructions

To do Project 1, follow these steps carefully; note that they may be updated as we get feedback about any problems that students encounter:

  1. Install the first 5 sets of "Required Software": http://laufer.cs.luc.edu/teaching/313/software, Java SDK through Android Studio. Either Java 7 or 8 is OK; the current default is Java 8.

    Note: after you install Android Studio, check for updates and install any that are available. Also be sure to install Android SDKs (not needed for Project 1).
    • On Windows you may need to modify System Environment variables PATH, CLASSPATH, and JAVA_HOME to include the path to the javac and java commands. Ask me or our TA on Piazza how to do that if you need to and don't know how.
    • On Mac OS X or Linux you may have to modify just the PATH Environment Variable in your .profile or .bashrc file. Again, ask if you need to do that, and don't know how.
    • Information about how to set these variables is in the attached file.
    • And, of course, ask us if you need help with any installation.

  2. Now go to http://bitbucket.org and create an account using your Loyola email (if you already have such an account, just use it). Bitbucket is a cloud-based system that hosts so-called repositories in Version Control Systems (VCSs) Git and Mercurial. We'll be using Mercurial in this class. Using your Loyola email allows you to create an unlimited number of repositories.

    • You'll be asked if you want to create a repository or import one - choose import and then change Source to Mercurial and Language to Java
    • Set the URL field in the Import existing code window to: https://bitbucket.org/loyolachicagocs_comp313/hello-java
      This is the Bitbucket location of the Android Studio repository for Project 1. Bitbucket will fill in the name hello-java in the Name field. Instead, change that name to cs313f14p1 (this is the required name for the repository – the p1 part refers to Project 1).
    • Next, click Import repository and open your cs313f14p1 repository by clicking on that name if it is not already open. In the Overview section click in the field to the right of HTTPS and copy the URL there - that is the Bitbucket URL to your copy of the hello-java Android Studio project.
    • Now click Share toward the top and share your repository with me at ryacobellis313@msn.com and with our TA at jdelacruz2@luc.edu - share your repository with us with admin access (I'll let you know the TA's email later).
    • Finally, paste or type the URL you copied above into the Android Studio field shown in the YouTube video in step 3 (not the comp313 URL that's shown in the video!).

  3. Once you have installed everything and created a Bitbucket account, watch this video showing how to use Android Studio to download an Android Console project hosted in Bitbucket from a Mercurial repository.
  4. To finish Project 1 you must change file HelloWorld.java in hello-java so that the tests all pass and then commit that change in Mercurial (see the above video for information about running the tests and the fix that you have to do). You will also need to upload a screenshot of the successfully-run tests from that project into the project’s new doc directory/folder on your PC, add it to your local Mercurial repository, commit that change as well, and finally push both changes to your Bitbucket repository in the cloud.

Note: there are instructions for connecting to Mercurial on Bitbucket using SSH so that you don’t have to enter your Bitbucket password every time you do a commit – follow this URL: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Mercurial. Some students have had problems using these instructions in the past, so you may have to fall back on entering your password each time …

How to submit

To finish Project 1 you must change file HelloWorld.java in hello-java so that the tests all pass and then commit that change in Mercurial (see the above video for information about running the tests and the fix that you have to do). You will also need to upload a screenshot of the successfully-run tests from that project into the project’s new doc directory/folder on your PC, add it to your local Mercurial repository, commit that change as well, and finally push both changes to your Bitbucket repository in the cloud.

As the first step in working on this project, you will push the code skeleton to a private Bitbucket repository shared with your instructor and the TA. The name of the repository is cs313f14p1, where the p1 part refers to Project 1. When your work is ready to be graded, please notify your instructor and TA via both Piazza and by Submitting the assignment in Sakai, and add a completion note in the comments box.

Comments