PRC2

Module description

  • Module description can be found on canvas

This site contains the up-to-date course material, exercises and announcements about PRC2 (Programming Concepts 2: the Test Driven Way), starting in February 2024.

Responsible Teachers for 2024 PRC2:

  • Martijn Bonajo
  • Ibrahim Kouzak
  • Richard van den Ham

Most contents on this website were originally developed by Pieter van den Hombergh.

Study materials

  • For the Java basics and advanced features we are using Cay Horstmann’s fine books from the core Java series, 12th edition. They are on the book-list from September.
  • The exercises will be published via a personal github repository.
  • The Junit version is Junit 5.
  • "Using frameworks for testing" will start with using AssertJ, which is a modern and up to date Open Source testing framework. The documentation is of excellent quality and fun to read.
  • JavaFX bonus chapter to Core Java Volume I (for the 11th Edition.)
  • Core Java, Volume I: Fundamentals
  • Core Java, Volume II: Fundamentals

Topics 2024 (preliminary)

In the topics table below, Vol I is Core Java Volume I, Fundamentals and Vol II is Core Java Volume II, Advanced Features both by Cay S. Horstmann and both in the 12th edition.

WeekTopicBookExercises
1Test Driven, Unit Testing basics-Phonebook, Minibar
2Parameterized TestsVol I 5.6 enum classesFraction, Flawless Password, Enum Calculator
3Design for testability, Mockito-Perishable sales
4GenericsVol I 8.1 - 8.8 Generic ProgrammingShapefilter, Generic Ranges
5JPMS, Lambda & StreamVol II 9 (JPMS) - Vol I 6.2 (lambda) - Vol II 1 (stream)Lambda Library
6Database access using JDBCVol II 5MinMaxCollector, DB programming in PRJ2
7JavaFX Properties and BindingsBonus Chapter https://horstmann.com/corejavaFXTriangulate
8State MachinesThis websiteGumball Machine, Grade capture
9ReflectionVol I, ch. 5.9Table Generator, Genealogy
10I18N / Exceptions / LoggingVol I, ch. 7; Vol II, ch. 6 (time API) and 7 (LOgging)Pub Exceptions
11Securitytbd
12Number systems and storage in Javatbd
13Concurrencytbd
14Buffer
Caution: Exercises

You should start with the exercises in the week they are listed in and hand them in by committing your work to your personal github repository.
Best is to do that before next week’s lesson, so you even if you were not able to even when trying, you will at least have some questions.

We will use a strict deadline policy for the assignments.
The hand in deadline is two lesson weeks after the publication date.

Way of Working during practical hours

tdd

The way of working with the practical assignments is as follows:

  • Each student has a personal github repository
  • The teachers will provide starter templates in due time via Github classroom.
  • The students will work on the assignment and work TDD style.
    • Write a test for a requirement (typically a method),
      see it showing failure (RED),
    • then implement the method to turn the test GREEN.
    • If GREEN, commit both test-class AND implementing class.
  • If the assignment is complete (all requirements covered with tests, all tests green and code coverage at an appropriate level), push the code to your repository.
    • Pushing to the repository will also start the test on CodeGrade.

Automatic correction of practical exercises

In PRC1 you have become acquainted with automatic tests. In PRC2 you will not only write the implementation, but also the tests. These tests need testing too.

The approach to follow is having not only a correct implementation, but also some broken implementations to test your tests.

The ubiquitous question is always: Where do I start?

The answer is surprisingly simple: at the requirements of class, method or whatever you want to develop. And always start at the simple end. So if a requirement says that a fresh Stack is empty, that means you can write a test that asserts that a new instance of your class reports that it is empty when the isEmpty() is called.