Testing functional programs

Testing is a complex yet important aspect of software development. Java 8 has impacted how testing can be conducted. The intent of this section is not to explore all of the possible ways of testing Java 8 code, but to provide some insight into possible testing approaches.

JUnit is the standard for testing Java applications and is used to test the functional aspects of Java. Typically, a JUnit test is created to test a method by passing it data and comparing the return value to determine if the method executed properly. In this section, we will examine various testing approaches.

Testing lambda expressions

A significant consideration is whether to test a lambda expression at all. If it is too simple to break, then there ...

Get Learning Java Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.