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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.