This section of the document explains how to set up and configure your development environment.
While there are no deliverables in this part of the assignment, we strongly recommend you complete them as soon as possible so you have plenty of time to visit office hours if you run into issues.
If you run into any issues while following these instructions, or just have any general questions on using Eclipse, please talk to a member of course staff ASAP during office hours.
You should follow the same project import steps as Homework 1, which can be found here. This time, your group's Gitlab page should be located at https://gitlab.cs.washington.edu/cse373-18su-project1/
This repository is for both you and your partner. Both partners can import this repository into Eclipse and push commits to the repository. If one partner pushes their code, the other can pull the code again and the changes will be there. If both partners change the same part of the code independently, you might end up with what is called a merge conflict. In order to fix this, all you need to do is edit the part of the code that both partners changed so that the code runs again, and then commit the changes. This process allows two partners to work together remotely. If you have more questions about this process (called version control), you can come to office hours or use the internet to help fix issues and learn more.
In this course, style will be graded mostly using tools known as style linters. Style linters are not perfect and are no substitute for manual code reviews, but they do a pretty good job of catching many common issues and so are used very frequently in industry.
When you were following the above instructions on how to install Eclipse, you should have also installed the checkstyle plugin and configured it with a set of rules downloaded from the course website.
If you are using a different IDE, here is a direct link to the checkstyle configuration file you must use.
After you finish, you can run checkstyle on your computer to perform the exact same set of style checks we will be using to grade your code. If you run checkstyle and it reports no issues, you will get full points for style.
At this stage, everything should be installed and configured. To confirm everything is ok, do the following:
Run SanityCheck.java
. This file is located at
src/main/java/misc/sanity/SanityCheck.java
:
right click the file from the project explorer and select the
option to run it.
Important note: you should be running this file from within Eclipse. In the pane to the left, navigate to the file, right click it, and select the "Run" option.
If Eclipse asks you if you want to run this as a Java application or a Gradle task, pick the Java application option.
If everything went well, this file should successfully run and print out a few lines of output.
Run a test. For example, try right-clicking
src/test/java/datastructures/TestDoubleLinkedList.java
and select the "run" option.
As before, you should be doing this within Eclipse. If Eclipse asks you if you want to run this as a JUnit test or a Gradle task, pick the JUnit test option.
When you try running any test, your IDE should print out the names of each subtest, state that they failed, and include some sort of error message and stack trace under each one.
Try running checkstyle on your entire project. See the Eclipse usage guide for details on how to do this.
Checkstyle should report exactly five errors with SanityCheck.java:
You can find these errors listed in the Checkstyle view (the Eclipse usage guide will instruct you on how to open this view). These lines should also be highlighted in red within your editor window: you can hover over them to see what the error is.
And finally, Checkstyle will add a little red "x" icon next to any file that has style violations in your Package Explorer view. (Eclipse will also flag any files that won't compile with the same red "x" icon).
If checkstyle is not reporting any errors, or is reporting far more then these five errors, something has gone wrong. (Note: you may either fix these errors or ignore them. We will ignore SanityCheck.java when grading your code for style.)
(Note: Checkstyle should also report several other "Found a stray TODO/FIXME
comment" located in different files throughout your code. This is expected –
those TODOs mark code you'll eventually need to edit. However, if we ignore those
errors, the SanityCheck.java
class should have exactly the above
5 errors.)
If you are unable to get any of these four steps working, please talk to the course staff ASAP.
Finally, explore the rest of your project with your partner and become comfortable with where everything is located. You do not need to understand all of the code provided to you, but you should at least be aware of where the files you need to modify are located.
We've included some extra info below to help you with your exploration process. (Remember, click the box titles to expand).