Starter project configuration for the course COMP 303: Software Design at McGill University
This repository is configured to be seamlessly imported into the latest version of the Eclipse IDE. However, if you know what you are doing, you can import the project into the IDE of your choice and find the corresponding tools. The code are instructions are for Java 8.
To set yourself up:
- Make sure you have Eclipse for Java (or your favorite Java IDE) and Java 8.
- Install the Checkstyle Eclipse Plug-in. In Eclipse, select
Help | Eclipse Marketplace...
and enterCheckstyle
in theFind:
box. From the results, installCheckstyle Plug-In...
. - Clone this GitHub repository into your Eclipse workspace. In the Eclipse package explorer, right-click and select
Import... | Git -> Projects from Git | Clone URI
and under URI enterhttps://github.com/prmr/COMP303Starter
, then click-through, requesting to import existing Eclipse projects. Once imported, the project should compile without errors. - While you're at it, clone the JetUML project into your Eclipse workspace. For convenience, you can also download the executable file and place it somewhere convenient.
- Similarly, clone the Minesweeper and Solitaire projects into your Eclipse workspace.
To ensure that everything works and start experimenting:
- In package
demo
, right-click on the fileWelcome.java
and selectRun As... | Java Application
. You should see a small GUI application appear. Try the different buttons which should do the obvious thing. - Right-click on the file
TestAlternatingLabelProvider.java
and selectRun As... | JUnit Test
. A green bar should appear. - Right-click again on the file
TestAlternatingLabelProvider.java
and selectCoverage As... | JUnit Test
. A green bar should appear, along with a view showing coverage information. If you go back to the source code file, most lines should be highlighted in green. The meaning of this will be explained later in the term. - Access the "Problems" view in Eclipse. You should see two warnings of the type "Checkstyle Problem".
Once everything works as described above, try the following:
- Fix the code to make the Checkstyle warnings go away. To see the full list of coding rules checked by the tool, right-click on the project and select
Properties | Checkstyle | Configure
and play around with the viewer. - Change line 37 of file
AlternatingLabelProvider.java
to returnaLabel1
instead ofaLabel2
, and re-run the test. The test should fail. - Learn some seriously useful shortcuts. My personal favorites are:
CTRL-1
,CTRL-SHIFT-R
,CTRL-SPACE
,CTRL-O
,ALT-SHIFT-R
.
Unless otherwise noted, the content of this repository is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Copyright Martin P. Robillard 2019