Module description

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

Responsible Teachers for 2020: PRC2: Pieter van den Hombergh, Richard van den Ham, and Linda Urselmans.

Study materials

  • For the Java basics and advanced features we are using Cay Horstmann’s fine books from the core Java series. They are on the book-list from September.

  • The exercises will be published via a personal svn repository on fontysvenlo.org.
    You can find to which group you belong through peerweb

  • 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

Read the corresponding Horstmann book chapters and do the tutorials before you come to class. This will make the lessons more effective for you, because the questions that you might have from studying could be answered immediately.
Studying is not glancing over some (web) pages, but experimenting with the compiler, IDE and other tools, to see if you can use the presented ideas and apply it in your own code.

1. Topics 2020

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 eleventh edition.

Week Topic Test Topic Book Exercises

01

Test Driven, Unit Testing basics

TDD get the rythm, asserting

-

Fraction, In the pub

02

Enums, Interfaces, Lambda Expressions and Inner Classes

Test Coverage, Parameterized Tests

Vol. I - Ch5.6 + Ch6.1-6.3

Comparator as Lambda, In the pub, Enum Calculator

03

Exceptions

Testing Exceptions

Vol. I - Ch7

In the Pub, Password Validator

04

Generics

Test and Quality and other Qualities

Vol. I - Ch8

BoxOfThings, Shapes

05

Collections + Java8 Streams

Break your code

Vol. I - Ch9 + Vol. II - Ch1

Lambda Library, CSV to Object Stream

06

Design for testability, Date/Time API

Mocking with Mockito

Vol. II - Ch6

First Mocks, Perishable products

07

Logging, + Internationalization

-

Vol. II - Ch7, Vol. I - Ch7.5

Spanish Beer

Break

08

State machines, Regex

Mocking with Mockito II

Vol. II - Ch2.7

GradeCapture, Olifantys balls

09

Networking, I/O

Testing networking protocol

Vol. II - Ch2.2, Ch4

Template Engine

10

Threads & Concurrency

Testing in case of concurrency

Vol. I - Ch12

Concurrent Restaurant

Ascension Day

12

Java Reflection

Testing non functional aspects, static tests

Vol. I - Ch5.7

Table Creator

13

Java Platform Module System

-

Vol. II - Ch9

Travel agency

14

Spare

You should start with the exercises in the week they are listed in and hand them in by committing your work to your personal subversion repository before the start of next week’s lesson. There will be no new exercises in the final lesson week.

2. Way of Working during practical hours.

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

  • Each student has a personal subversion repository

  • The teachers will add the starter project for the assignment in due time
    to all student repositories, which are then available for checkout by the students

  • 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, svn-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 ) ask any of the teachers or student assistants to run the teachers test on your code.

    • The teachers will not explicitly test your tests, only your implementation code, but will provide you with the test report.

    • They will run your tests, to see if your test report is in agreement with the teachers tests.

This procedure is similar to the one followed during the performance assessment at the end of the semester. The difference is that we will review not only the implementation, but will start with reviewing the tests. If there is no valid test, the implementation of the method will not be considered.

3. Slack channel(s)

For questions and answers thus documenting them and also discussions and explanations, sharing information, links and other things between students and lecturers, feel free to use the slack channel: Slack invitation link.

Please use the channel #prc2class. We will use this channel to ask and and answer questions during and after class.

Please note that the content of this channel will appear on youtube because we are recording the lectures. So use proper language.

You are only allowed to use a student.fontys.nl email address. Using slack is optional, but if the students share their knowledge there, this can be a helpful source and learning environment.

4. 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 test need testing too.

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

The exact details are spelled out in the rules for the performance assessment.

In short you provide your own test code and implementation, we provide an implementation, our own tests and some broken implementations to make your tests have a nice red blush.

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.