Chapter 7. Unit Testing and Debugging

Two questions echo endlessly in the dark hours of small, enclosed areas lit by the dim glow of display screens: "Is it working?" and "How did that happen?" This chapter is about answering those questions.

"Is it working?" will be addressed by writing unit tests. The agile programming model suggests starting with unit tests and building the code afterwards. I generally try to follow this model, although under pressure, I have shifted to just writing the code, usually to my later regret. Testing the lower-level APIs in your applications is a known skill set. This chapter will cover unit tests that actually run MapReduce jobs at a small scale.

There are several ways to determine what is happening in a running program. ...

Get Pro Hadoop now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.