Part 1. JUnit essentials

Welcome to JUnit in Action, Second Edition. JUnit is a framework that was started by Kent Beck and Erich Gamma in late 1995. Ever since then, the popularity of the framework has been growing, and it’s now the de facto standard for unit testing Java applications.

This book is a second edition. The first edition was a best seller, written by Vincent Massol and Ted Husted in 2003, and was dedicated to version 3.x of JUnit.

We cover the newest version of JUnit, 4.6, and we talk about many features that were included after the first edition of the book. At the same time, we focus on some other interesting techniques in testing your code: mock objects, JUnit extensions, testing different layers of your application, and many more.

This part starts by exploring JUnit itself. We focus on the other tools and techniques later in the book.

The first chapter gives you a quick introduction to the concepts of testing. You need this information to get started. You’ll jump straight to the code and see how to write a simple test, execute it, and see the results.

The second chapter introduces JUnit at its best. We build a bigger project and walk through the code. We not only explain the JUnit concepts, widgets, and guts, but we also show you the best practices in writing a test case and demonstrate them with the project we build.

The third chapter is dedicated to tests as a whole. We describe different kinds of tests and the scenarios to which they apply. We also explore the various platforms (development, production, and so on) and show you which tests and which scenarios are best to execute there.

The last chapter in this part of the book is dedicated to improving your testing skills. We show you how to measure your test coverage and how to improve it. We also explain how to produce testable code before you write your tests as well as how to write the tests before you write a single line of code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.220.22