Group Group Group Group Group Group Group Group Group

Errata for Android Test-Driven Development by Tutorials 1st Edition

Creating this topic to catch any typos and bugs in the 1st Edition of Android Test-Driven Development by Tutorials.

Hi. p106 of the digital edition of the book (Chapter 6 : Architecting for Testing)

interface Space

data class RectangularSpace(val width: Double, val height: Double): Space

data class CircularSpace(radius: Double): Space

class ArchitectUtils {
	fun calculateArea(spaces: List<Space>) {
		var total = 0
		for (space in spaces) {
			if (space is SquareSpace) {
				total += space.width * space.height
			} elseif (space is CircularSpace) {
				total += space.radius * space.radius * PI
		return total

I believe it should be

if (space is RectangularSpace)

not SquareSpace

Section II, before Chapter 4, rendering issue:

(Apple Books)

Chapter 3, before the section “Refactor: Updating your code”

“This mean you need to update the function so it returns null again when given null as a parameter while ensuring your newest test is passing.”

Should be “This means…”

@ellem @abunur Thank you for the heads up - much appreciated! I will forward this to the book team.