By Developers, For Developers

Historical errata for Debug It!

PDF PgPaper PgTypeDescriptionFixed onComments
8TYPO

I suggest that the following will read better:
“You can buy any number on every other aspect of software engineering—design, code construction, requirements capture, methodologies, the list is endless.” -> “…, methodologies, etc.—the list is endless.”

2009-07-20
9TYPO

“Although the approaches discussed earlier in the book apply to all bugs, certain types of bug benefit from special treatment.” -> “…certain types of bugs…”

2009-07-20
135TYPO

“If you have fond a bug” —> “If you have found a bug”

2009-07-20
130TYPO

In the “Joe Asks…” section: “Cacheing:” —> “Caching:”

2009-07-20
85TYPO

Under “Root Cause Analysis”

“something when wrong” s/b “something went wrong”

2009-07-20
148TYPO

Sidebar:
“entire team are all happy to use” —> “entire team is happy to use”

2009-07-20
13TYPO

For “whereas other thrash around”, “other” should be plural.

2009-09-10
107SUGGEST

“He was never able to explain to me why software that passed the tests was a bad thing, however.” sounds a little sarcastic. Maybe the architect in this particular case took things too far, but it’s worthwhile examining the concern I assume he has: that giving the tests to the developers enables them to “cheat”.

2009-09-10
106TYPO

“Chinese wall” usually has the “c” capitalized.

2009-09-10
30TYPO

With “worth it’s weight in gold”, it’s is not a genitive.

2009-09-10
198TYPO

It should be “Dinkumware sells ….,” not “Dinkumware sell…”
Dinkumware is singular, isn’t it?

2009-09-10
161TYPO

After “Here’s how we might use it:” […]
message.addHeader(“Accept” , “text/html,test/xml” ); <- text/xml

Thanks for a really top shelf and useful book Paul!

2009-10-09
163SUGGEST

First para. “, the software itself notices when something is gone wrong […]” <- ? remove “gone” or use “has” not “is” :-)

2009-10-09
171TYPO

About line 28 : “[…] help us debug problem in situ.” <- ? “a problem”

2009-10-09
176SUGGEST

Middle of page : “And this is what running the test might look like the following:” <- ? “the following” could be deleted.

2009-10-09
77TYPO

You may or may not wish to rephrase “the final solution”.

2009-10-18
146SUGGEST

The text talks about versions 2.0 and 2.1, but the diagram shows versions 1.0 and 2.0

2010-01-17
32TYPO

The following Java code is not valid

if(item = workQueue.lockWorkItem()) {
item.process();
workQueue.writeResultAndUnlock(item);
}

It is most likely intended to read

if(workQueue.lockWorkItem(item)) {
item.process();
workQueue.writeResultAndUnlock(item);
}

depending on how the workQueue API behaves.

An additional pedantic point: the unlocking should be under a finally clause such that there are no “lock leaks” due to unhandled exceptions. The more appropriate fix would be

if(workQueue.lockWorkItem(item)) {
try {
item.process();
} finally {
workQueue.writeResultAndUnlock(item);
}
}

2010-01-17
157SUGGEST

I cannot help but disagree with much of Section 10.1 “Assumptions and Assertions”. This is perhaps a cultural approach between languages, with my primary language being Java. I prefer explicit checks on method parameters, with appropriate exceptions being raised - greatly simplified by the Google Collections API - than the author’s recommendation on the use of “assert”. For me, bad parameters should be discovered as soon as possible, using “assert” to catch them will only lead to difficult-to-track bugs on production deployments. In my opinion, “assert” is best used to check parameters in non-public APIs and for checking variables deep within an algorithm.

To be more explicit, on page 160, instead of writing

assert name.length() > 0 : “name cannot be empty”;

I much prefer the following (note, methods are static imports from com.google.common.base.Preconditions)

checkNotNull(name, “name”);
checkArgument(!name.isEmpty(), “name cannot be empty”);

which will result in a NullPointerException or an IllegalArgumentException, respectively, if name is faulty - and most importantly, will not be dependent upon whether assertions are enabled or not. “assert” is best used within internal code, not in public APIs (even if public between internal projects) or exposed to user input.

2010-01-17Hey Sam, \n \nThanks for the input. I suspect that we probably agree more than we disagree - we both would prefer to see code implement checks to make sure that the underlying assumptions are respected. The details of exactly how this might happen are a second-order effect \n \nAs you suggest, our difference in approach may result from a cultural issue. I come from a C/C++ background where assertions are the primary mechanism used to achieve this kind if thing. In Java, an alternative may be more appropriate. If this chapter manages to get the reader thinking about automatically verifying assumptions at all, by whatever mechanism, I'll be happy. \n \nThanks again, \n \nPaul
147TYPO

In the first paragraph of section 9.3 Automatic Builds:

“One the most important variables…” should be
“One of the most important variables…”

Categories: