OOP Lab Manual
OOP Lab Manual
Lab Manual
1 General remarks
Responsible teachers A.Zaidman ([email protected]) &
Thomas Overklift ([email protected])
Schedule Times and rooms where the practical sessions are being held are available on https:
//mytimetable.tudelft.nl
Computer and network You can use your own laptop. When on campus you can connect
to the wireless network (SSID: Eduroam). Use your TU Delft provided netID and password.
Assignments There will be 5 assignments. The first three can be implemented on Weblab
https://weblab.tudelft.nl/cse1100/2020-2021. The other two can be downloaded and
need to be implemented using a local IDE (we recommend the latest version of IntelliJ IDEA).
Note the importance of Assignments 4 & 5, which we consider crucial for mastering the
computer exam of this course.
1
Assignment Final Week Process
1 1.3 Finish on WebLab before queueing for review by TA
2 1.4 Finish on WebLab before queueing for review by TA
3 1.6 Finish on WebLab before queueing for review by TA
4 1.7 Finish in your IDE before queueing for review by TA
5 1.9 Finish in your IDE before queueing for review by TA
Coding guidelines. Make sure to follow the guidelines of each of the assignments. Also,
please adhere to the coding style conventions as mentioned during the lectures and in the book
“Java in Two Semesters” by Charatan & Kans.
Unit tests. Make sure all unit tests pass before signing off your solution with a TA. In the
first few assignments, unit tests are given to you. After that, you should write your own unit
tests.
2 Weblab
The first three assignments, the mid-term exam as well as one of the final exams will offered
through Weblab. Weblab is an online learning system where you can make small programming
assignments. You can access Weblab via https://weblab.tudelft.nl/. Navigate to the
CSE1100 course in the course catalog and enroll to get started.
Java You will also need Java, more specifically the Java Development Kit which contains
the runtime and compiler. The JDK can be found here: https://jdk.java.net/. We recom-
mend the latest stable version, which is Java 14 (or Java 15 after September 15th 2020), but
any version from Java 11 contains all tools you will need for this course. Mind you, download
the JDK, not the JRE!
Detail If you have a Java source code file and you save this as MyProgram.java and you
invoke the compiler, it will translate your program to byte code and save the byte code in the
file MyProgram.class (if your source code is free of mistakes of course!)
Configuring It may be necessary to configure your operating system (OS) further so that
your OS (and other pieces of software) know where Java is installed. Have a look here if
everything doesn’t work out of the box: https://docs.oracle.com/en/java/javase/14/
2
4 Working with IntelliJ
IntelliJ, the first time When IntelliJ starts up for the first time, it will ask you to configure
some settings, you can change these settings if you want, but the defaults are just fine. After
this you will see a screen where you can create projects. See Figure 1; select ”new project”.
After this you will have to configure your new project. Make sure you select the Java SDK
you installed before as the Project SDK, see Figure 2. You don’t need to select any additional
frameworks.
Subsequently you can click next twice, and skip over the template (since we do not need to use
a template, see). Finally you can choose the name and location of your project and click finish,
see Figure 3.
Package Explorer At the very left you will see an overview of the workspace and the projects
contained (see Figure 4). Click on a project to expand it and see what’s inside.
Your first Java program Within your project there will be a folder src. This is where you
can create Java classes. Do a right click on the src folder and select New → Class. Give this
class the name HelloWorld. You have now created an empty class.
3
Figure 2: Creating a new project
4
Figure 4: IntelliJ overview, on the left, the project overview.
5
5 Working with jUnit tests
Once you’ve implemented some methods you should write tests for your code. Start by creating
a test class, you can easily do this by right-clicking in a class of your choice, and selecting the
menu option "Generate" → "Test...". You can then configure the methods you want to test
in a new class (see Figure 5). When you create your first test class, make sure you add JUnit
5 to the procect (see Figure 6)! Then you can continue to create tests from there.
6
Figure 6: adding jUnit 5 to the project.