Untitled

This guide will walk you through the process of setting up your homework repository and importing it into Eclipse.

<aside> <img src="/icons/preview_gray.svg" alt="/icons/preview_gray.svg" width="40px" /> A past TA has recorded a super helpful walkthrough if you prefer a video of these steps! You may need to login with your USF username and password for access.

</aside>

One-Time Setup

Before you begin, you need to make sure to go through the other setup guides first:

You may also want to complete the Importing Eclipse Projects from GitHub with the lecture code before trying to setup your first homework assignment.

Per-Homework Setup

For every homework assignment, you will need to repeat these steps:

  1. Setup your GitHub repository.

    1. Find the homework assignment on Canvas. For example, go to the FileStemmer assignment on Canvas for the first homework of the semester.
    2. Click the GitHub Classroom invitation link and follow the instructions.
    3. If this is your first time using GitHub Classroom, you will be prompted to select your USF username from the list. This makes sure we can associate your GitHub username with your grades in Canvas. You only need to complete this step once.

    This process will create a private GitHub repository with the homework starter code that only you, the teacher assistants, and the instructor can access.

  2. Setup your Eclipse project.

    Once your repository is setup, you must import the homework as a Java Maven Project in Eclipse. See the Importing Eclipse Projects from GitHub guide for detailed steps.

    When done, the “Package Explorer” view of your homework should look something like this:

    Eclipse screenshot of “Package Explorer” view with important items highlighted in blue.

    Eclipse screenshot of “Package Explorer” view with important items highlighted in blue.

    Make sure the correct Java version is showing up and that you are in the “Java” perspective before moving on. This perspective allows you to run Java code. The “Git” perspective lets you view, but not run, Java code.

  3. Verify you can run the JUnit tests on Eclipse locally.

    The tests will be in the src » test » java subfolder. Right-click the test file and select “Run As” » “JUnit Test” from the menu.

    If you are prompted for a test to run, choose the top-level option that has the same name as the homework assignment and click the “OK” button.

    Eclipse screenshot of the “Test Selection” dialog.

    Eclipse screenshot of the “Test Selection” dialog.

    That should open up the “JUnit” view automatically, which will look similar to this:

    Eclipse screenshot of the “JUnit” view.

    Eclipse screenshot of the “JUnit” view.

    These are the tests you will need to pass for the homework. Most of the tests will fail until you begin addressing the TODO comments in the code.

  4. Commit and push changes to GitHub.

    In Eclipse, make a minor change and commit and push that change to GitHub.

    I recommend placing the Git Staging View somewhere on your Eclipse layout to make this process more convenient. You can access that view via the “Window” » “Show View” » “Other…” option in the menu. Open the “Git” folder to find the “Git Staging View” option to add it to your layout:

    Eclipse screenshot of the “Show View” dialog.

    Eclipse screenshot of the “Show View” dialog.

    Make sure to drag files from the “Unstaged” to the “Staged” box and add a commit message. Sometimes, you need to click the “Refresh” button in the upper right corner of the view to update. For example:

    Eclipse screenshot of the “Git Staging” view.

    Eclipse screenshot of the “Git Staging” view.

    Click “Commit and Push” to make a checkpoint and push that checkpoint to GitHub. If you click “Commit” you only make a local checkpoint on your system.

  5. Verify the Autograder GitHub Action ran properly.

    Visit your repository on GitHub. Click the “Actions” tab to view all of the runs. There should be a run with the same name as your last commit.

    Make sure the action finishes running. Here is an example of a completed action:

    GitHub screenshot of an example action run.

    GitHub screenshot of an example action run.

    Scroll down in the “Summary” view to see the “Annotations” section. That will report the number of points your homework has earned so far and any deductions. Possible deductions include:

    For details on which tests failed and these deductions, you need to drill into the “Testing” output:

    GitHub screenshot of an example action run detail view.

    GitHub screenshot of an example action run detail view.

    You can also see the number of points on the README.md file as well:

    GitHub screenshot of an example README file.

    GitHub screenshot of an example README file.

    You may need to refresh your view on GitHub to see the latest result.

At this point, you should be able to move on to the Homework Submission and Homework Testing guides.