Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36875
481
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Image from Pragmatic
Title: Pragmatic Unit Testing in Java 8 with JUnit
Author(s): Jeff Langr
Publisher: Pragmatic

Summary
Pragmatic wrote:The Pragmatic Programmers classic is back! Freshly updated for modern software development, Pragmatic Unit Testing in Java 8 With JUnit teaches you how to write and run easily maintained unit tests in JUnit with confidence. You’ll learn mnemonics to help you know what tests to write, how to remember all the boundary conditions, and what the qualities of a good test are. You’ll see how unit tests can pay off by allowing you to keep your system code clean, and you’ll learn how to handle the stuff that seems too tough to test.



Book Preview (when available)



From the publisher
  • Table of Contents (HTML)
  • Errata (HTML)


  • Where to get it?
  • Amazon.com
  • Pragmatic



  • Related Websites
    JUnit 4
    COMMENTS:
     
    Jeanne Boyarsky
    author & internet detective
    Marshal
    Posts: 36875
    481
    Eclipse IDE Java VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    “Pragmatic Unit Testing in Java 8 with JUnit” covers JUnit 4 and a mix of Java 7 and 8. JUnit 5 wasn't out yet when the book was written so the decision to cover JUnit 4 makes sense. There was good coverage of assertThat along with three stycles of exception testing.

    There were some Java 8 idioms used include functional interfaces, method references, streams and lambdas. There were also some places that could have used lambads and didn't. For example, chapter 8 makes a big point of refactoring to make the code cleaner. But then the anyMatches/matches methods use a loop.

    The narrative about Dale testing and Pat the skeptic added nice color. Each chapter ends with a short “After” section that provides a mix of summary and transition. I also liked the technique of using arrows to show what changed in each refactoring and edition. Testing concepts were covered well including the FAST, Right BIPCEP and CORRECT acronyms.

    I think the book was great. It's a timely updated to the original Pragmatic Unit Testing book (which uses JUnit 3.8.) But I have to take off a tiny bit for the fact that Java 8 looks to have been retrofitted in.

    I give this book 9 out of 10 horseshoes.

    Disclosure: I received a review copy of this book from the publisher for reviewing it on behalf of CodeRanch.
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!