CPSC 331 — Java Development Exercises
Almost all lectures and tutorialsl in this course will concentrate on the design and analysis of data structures and algorithms. However, assignments will include questions that must be answered by developing Java programs and giving evidence that these correctly and efficiently solve the problems they should.
A small amount of help to set up your Java development environment will be provided during the second week of the course. Students will be expected to make use of the supplied material — available on this page — and work independently to get things running, after that.
Most of the students in this course have completed two half-courses in computer science at the University of Calgary and they can probably skip over the beginning of the material that follows. Students who are also familiar with the UNIX/Linux operating system and have already been using it to do course work, for computer science courses, can possibly skip over the rest as well. However, students who have only been using the Windows operating system will need to become familiar with UNIX/Linux and the support for this provided by the Department of Computer Science.
Computer Science Technical Support: Students who have just arrived at the University of Calgary may need to start here, in order to obtain a CPSC user account and learn about the general computing services that are available.
Remote Access — SSH: This is one of the articles linked to, from the general “Technical Support” page above. It gives information about how the department's computing facilities can be accessed from off-campus.
UNIX/Linux Tutorial: Students who have only used Windows, before this, should work through everything in the “Unix/Linux for Beginners” section of this online tutorial. The section on “Unix/Linux Shell Programming” is also recommended, and might be quite useful later on, when “testing using shell scripts” is considered.
Bash Guide for Beginners: The tutorial given by the previous link might be all that you need! It discusses the use of any of several similar “shell command languages.” This second tutorial concerns one of these shell command command languages, namely, the language “Bash” that is used, by default in the computer science department.
The first three chapters include information — including information about “Shell initialization files” — that will might be useful if you need to make changes to your computing environment, in order to use Java development tools, during this course. It is not clear that you will need material in later chapters during this course, but they might be of interest.
This includes steps to follow in order to make sure that Java can be used with the Department of Computer Science’s systems, along with links to information about the Java programming language.
This includes instructions that you can follow in order to make sure that Java class files are stored, and found, in standard places. This is important, and you should make sure that things work as expected now, because it is not guaranteed that your source code will be compilable by markers when you submit code for assessment, otherwise!
This includes instructions that you can follow to set up a Java development on your computer at home (if you do not already have one), so that most of your work can be done without logging onto a compute server at school. Please note, though, that any code that you submit for assessment will be compiled, run and tested using the Department of Computer Science's Unix compute servers — so that marks might be lost, or your code might not be marked at all, if your code cannot be compiled and run in this way.
This includes information about Oracle’s online Java documentation. It also mentions a problem with the Java implementations from Lecture #3 and Tutorial Exercises #3 and #4, and encourages you to try to use the online documentation, being discussed, to develop better Java implementations to solve the problem that has been noticed.
This discusses the use of the test harness, JUnit, to run tests on Java programs.
This discusses the use of Unix shell scripts to perform additional tests on programs.
This introduces the Java code debugger “jdb” and takes you through an example of its use.
This provides more information about the use of “javadoc” to produce online documentation for Java programs.
This describes the UNIX/Linux “time” utility, which can be used to measure the time used by a software execution.
The following shell scripts for use at home are based on the assumption that the GNU time utility has been installed and is available as
/usr/local/bin/time
They will need to be edited if the utility has been installed somewhere else and they cannot be used, at all, if this has not been installed at all — so that the “time” utility that is part of the UNIX/Linux shell is to be used instead.
This introduces the Java profiler, “visualvm” which can be used to measure and display information about the computing resources used when a program is executed.