Project 1, part 0: Setup
Overview
This section of the document explains how to set up and
configure your development environment.
You do not need to submit anything for part 0 and there is no due
date, but we strongly recommend you work through this section as soon
as possible. Part 0 contains instructions and mini-exercises designed
to make sure you're comfortable with your development environment
which you'll be using throughout the quarter.
If you run into any issues or have questions about any of these steps,
you should ask one of the course staff as soon as possible so you don't
run into issues down the line.
Part 0a: Install your IDE
First, start by setting up your development environment if you
haven't already. We require installation and
use of Eclipse instead of using jGRASP.
Here are instructions on installing and using Eclipse
Part 0b: Download your project
Download your eclipse project file.
Extract it and open it eclipse. See the guide (linked
above) for instructions on how to do this. Note: since you should
be pair-programming with your partner in person, only one partner
should need to download the project.
You may optionally use Git, a version control
system, to help manage your code. Git is a tool that is used almost
ubiquitously in industry to help people keep track of changes they make
to their code and collaborate with their teammates in a principled way.
If you plan on using Git, first complete all the steps in part 0, then
read this document which contains a tutorial on using
Git as well as our class policies regarding version control.
Part 0c: Run tests locally
Once you have finished setting up your IDE and your project, try
running the tests we have provided you. You can do this by
right-clicking on the test and selecting the
"run" option.
When you try running your tests, your IDE should print out the names
of each test, state that they failed, and include some sort of error
message and stack trace under each one.
If you are unable to get your tests running, talk to one of the
course staff ASAP to get help.
Part 0d: Get style feedback
In this course, style will be graded 100% automatically using tools
known as style linters. Style linters are not comprehensive
and won't necessarily catch all style issues, but they're good enough
to catch the more egregious issues.
We will run these linters for you automatically at the end of every day. You can submit your code as many times as you want
to re-run the style checks. We will grade whatever you submit last and
ignore all prior submissions.
We plan on grading your code for style by:
- Running the same linting tools the submitter
tool uses.
- Briefly performing a manual sanity check over
your code to make sure it's more or less
readable and you didn't somehow fool the linters.
Since we're giving you the same linting tools we'll
use to grade your code, everybody should be able to easily
get full points for style.
Note: we will, however, grade the
design decisions your group made by hand.
Design decisions are the higher-level choices you made
while implementing your code. Examples of poor design
decisions include:
- Not following restrictions listed in the spec.
- Implementing asymptotically inefficient code.
- Writing grossly redundant code.
- Having your data structures use an excessive
and unnecessary amount of memory.
- Structuring your code in an excessively awkward
way.
Note: We will cover what exactly it
means for code to be asymptotically efficient a little
later this quarter. For now, we'll use a simpler
definition: a method is asymptotically efficient if it
uses as few loops as possible.
Part 0e: Exploration
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).
When you open your IDE for the first time, you will see
many different folders and files. Most of these are
configuration files for your IDE: you can safely ignore most
of them. The only folders you need to pay attention to are the
src
folder and the writeups
folder.
Here is a high-level overview of what the src
folder will contain:
src
main
antlr
—
Contains a grammar describing the mini-language
you will be implementing. You should ignore this folder.
java
calculator
— Contains code related
to the calculator language and the GUI. You will modify
some of these files.
datastructures
— Contains abstract
classes and (empty) concrete implementations for the
data structures you will be implementing in this
assignment.
Notice that we have prefixed each interface
with the capital letter "I". This is not standard
Java convention – we use this prefix so
we can easily distinguish our our interfaces
from the ones in java.util
.
misc
— Contains miscellaneous
utilities and files.
test
java
— Contains tests for your project.
We have provided some tests for you; you will be required
to add some extra tests as a part of this project.
In Java, the main way we organize projects containing
multiple files is by using packages.
The most important things you need to know are that:
To declare a Java file is a part of a package, you must
include the line package some.package.name;
at the top of the Java file.
By convention, we store files in folders matching the
structure of the package name.
For example, one of the files in our project is
located at
src/main/java/datastructures/concrete/DoubleLinkedList.java
.
We've configured this project so src/main/java
is considered the "root directory" of your Java source
code. That means that DoubleLinkedList.java
will be located inside the datastructures.concrete
package.
There will always be a one-to-one mapping between the
package name and the folder it's in.
To import a class from a different package, include
the line
import some.package.name.SomeClass;
at
the top of the file. You do not need to import any
classes that a part of the same package as the current
class.
You can find more details about Java packages
at this link.