Monday, April 21, 2014

Essential Skills for TDD Terminology


A specified sphere of activity or knowledge. Example : Visual communication is the domain of the graphic designers.

Visual Communication
 - Contour
 - Contrast
 - Opacity
 - Form

 - Equity
 - Debt
 - Gross Margin
 - Net Income

 - Parallel
 - Ordinate
 - Arc
 - Angle

Problem Domain

Problem domain refers to real-world things and concepts related to the problem.

Problem Domain Analysis

Problem Domain Analysis is the process of creating a mental model that describes the problem. The focus is on understanding the problem domain.

Solution Domain 

Solution Domain refers to real-world things and concepts related to the solution.

Solution Domain Analysis

Solution Domain Analysis is the process of arriving at a solution. It describes the sequence of steps used to solve a given problem. Finding abstractions helps us to solve problems.

Tuesday, April 08, 2014

Destroy All Software - Episode Fast Tests With and Without Rails Review

The specs in the final solution abuses mock by mocking the ActiveRecord API. The expectation mocks update_attributes. He says the solution only depends on RSpec and specs run outside of Rails, so the specs run fast. The problem is that the dependency on Rails exists because of the coupling created by the mocking of ActiveRecord. The tests are now brittle and can break when you upgrade Rails if the active record API changes.

Monday, April 07, 2014

Growing a Test Suite Screencast Review

This is the review of the solution discussed in Growing a Test Suite Screencast.

Here is a list of things that the solution violates:

1. Separate Command from Query.
     digest method is a command. digest method should not return any value
2. Allocate responsibilities to the right class.
    digest method does not belong to the Cheese class.
3. Law of Demeter.

Here is my solution:

class Walrus
  attr_reader :energy
  def initialize
    @energy = 0
  def eat(food)
    @energy +=
  def digest
    p 'Digesting...'

class Cheese
  def energy

cheese =
w  =

p "Energy before eating is : #{}"

p "Energy now is : #{}"