Lab Test

All students will sit a 90-minute test in regular lab times in week 3.

You will not use the labs repository to complete the lab test. Instead, you will create your own repositories as part of the test. When you sit the test, you will find instructions on the desktop of the computer when you log in.

Your lab test will include the HelloWorld exercise from lab 1, plus four questions chosen at random from the homework questions for units J1, J2, J3, J4, J5 , J6, and O1). The test will not contain any questions that you have not seen before. Work through all of your homework questions to ensure that you are fully prepared for the exam.

The how-to video Lab test, question 1 shows you how to complete Question 1 of the lab test. Be sure to watch it and ensure that you can complete question one without help (the video is from 2016 so there are minor differences to the appearance of IntelliJ, however the steps remain the same).

Your mark in the lab test is redeemable against the final exam.

The structure of the test will be as follows:


COMP1110 Lab Test

The test will be marked out of 20. Your mark will be divided by 4 to give a final mark out of 5.

Tasks

No Materials permitted.

Question 1 (5 Marks)

You will be asked to answer the following question:

  • Using IntelliJ, create a new Java project called comp1110-labtest.
  • Import the project into git (VCS -> Import into Version Control... -> Create Git Repository.... Select the default location (comp1110-labtest) as the place where the new git repository is created.
  • Within your project’s src directory, create a new Java class called comp1110.labtest.HelloWorld (you should add the file to git when prompted).
  • Force JUnit to be added to your project’s classpath. Place your cursor within your HelloWorld class, and type Ctrl+Shift+T (or Navigate -> Test). Select OK when prompted with “Create test in the same source root?”. This will bring up the Create New Test dialogue. In the “Testing library:” drop-down, select Junit4. Use the Fix button to add Junit to your module. You can then press Cancel. Be sure to choose Junit4 (not Junit3 or Junit5).
  • Now add comp1110-labtest.jar to your module’s dependencies. File -> Project Structure..., choose Modules and select the Dependencies tab. Use the + button (mid-right of window) and select JARs or directories... then navigate to your comp1110-labtest.jar which you should download if you’re practicing, or you’ll find on your desktop when you’re sitting the lab exam. You should now see that comp1110-labtest.jar is within your External Libraries folder within your IntelliJ project.
  • Navigate to your Exernal Libraries folder and you should see comp1110-labtest.jar. Expand the jar and you should see runConfigurations. Select runConfigurations and copy it (right mouse click or ctrl+C) and the paste it inside your .idea folder. Once you do that, you should see tests appear next to the green run button at the upper right of your screen.
  • Navigate back to your HelloWorld class, and modify it so that its main method prints Hello world!.
  • Test your HelloWorld class by selecting the Q1 HelloWorldTest option from the drop-down next to the green run button.
  • Once your HelloWorld class passes the tests, commit it to your git repo.

Question 2 (5 Marks)

You will be asked to answer one of the following questions:

Question 3 (5 Marks)

You will be asked to answer one of the following questions:

Question 4 (5 Marks)

You will be asked to answer one of the following questions:

Updated:  13 Jan 2020/ Responsible Officer:  Head of School/ Page Contact:  Josh Milthorpe