O'Reilly logo

JUnit in Action by Ted Husted, Vincent Massol

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1. JUnit jumpstart

This chapter covers

  • Writing simple tests by hand

  • Installing JUnit and running tests

  • Writing better tests with JUnit

 

Never in the field of software development was so much owed by so many to so few lines of code.

 
 --Martin Fowler

All code is tested.

During development, the first thing we do is run our own programmer’s “acceptance test.” We code, compile, and run. And when we run, we test. The “test” may just be clicking a button to see if it brings up the expected menu. But, still, every day, we code, we compile, we run...and we test.

When we test, we often find issues—especially on the first run. So we code, compile, run, and test again.

Most of us will quickly develop a pattern for our informal tests: We add a record, view ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required