Skip to Main Content
The Well-Grounded Java Developer
book

The Well-Grounded Java Developer

by Benjamin Evans, Martijn Verburg
July 2012
Intermediate to advanced content levelIntermediate to advanced
496 pages
16h 42m
English
Manning Publications
Content preview from The Well-Grounded Java Developer

Chapter 11. Test-driven development

This chapter covers

  • The benefits of practicing test-driven development (TDD)
  • The red-green-refactor lifecycle at the heart of TDD
  • A brief intro to JUnit, the de facto Java testing framework
  • The four types of test double: dummy, fake, stub, and mock
  • Testing against an in-memory database for your DAO code
  • Mocking subsystems with Mockito
  • Using ScalaTest, the testing framework for Scala

Test-driven development (TDD) has been part of the software development industry for quite some time. Its basic premise is that you write a test before writing the code that actually provides the implementation, and then you refactor that implementation as needed. For example, in order to write an implementation of concatenating ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Performance and Instrumentation for the Well-Grounded Java Developer

Java Performance and Instrumentation for the Well-Grounded Java Developer

Benjamin J. Evans
Java By Comparison

Java By Comparison

Simon Harrer, Linus Dietz, Jörg Lenhard
DevOps Tools for Java Developers

DevOps Tools for Java Developers

Stephen Chin, Melissa McKay, Ixchel Ruiz, Baruch Sadogursky
Optimizing Java

Optimizing Java

Benjamin J. Evans

Publisher Resources

ISBN: 9781617290060Publisher SupportOtherPublisher WebsiteErrata PageSupplemental ContentPurchase Link