Java Reference
In-Depth Information
Part 1
JUnit essentials
Welcome to JU nit in Action, Second Edition . JU nit is a framework that was
started by Kent Beck and Erich Gamma in late 1995. Ever since then, the popu-
larity of the framework has been growing, and it's now the de facto standard for
unit testing Java applications.
This topic 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 JU nit.
We cover the newest version of JU nit, 4.6, and we talk about many features
that were included after the first edition of the topic. At the same time, we focus
on some other interesting techniques in testing your code: mock objects, JU nit
extensions, testing different layers of your application, and many more.
This part starts by exploring JU nit itself. We focus on the other tools and tech-
niques later in the topic.
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 JU nit at its best. We build a bigger project
and walk through the code. We not only explain the JU nit concepts, widgets, and
guts, but we also show you the best practices in writing a test case and demon-
strate 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.
 
 
Search WWH ::




Custom Search