What meal should Ι eat?
break a big measurement into smaller estimatable measurements
Number of pianos divided by number of tunings in a year
| variable | value |
|---|---|
| population | 9M |
| people per household | 2 |
| houses w/ piano | 20 |
| hours per tuning | 2 |
| hours per tuner | 50 * 5 * 8 |
Number of pianos divided by number of tunings in a year
9000000 / 2 / 20 / (50 * 5 * 8 / 2)
225
Good enough for Descartes
Good enough for Fermi
decomposition is called factoring
Yep. re-factoring.
Real talk now (wake up your neighbor)
You have to be able to refactor the implementation under test
def test_same_modality
one_mod = ["CR", "CR"]
two_mods = ["CR", "CT"]
assert same_modality?(one_mod)
refute same_modality?(two_mods)
end
def same_modality?(documents)
modalities = []
documents.each do |document|
unless modalities.include?(document.modality)
modalities << document.modality
end
end
modalities.size == 1
end
documents.map(&:modality).uniq.size == 1
Descartes invented TDD
Aldric Giacomoni
@trevoke
Wake up your neighbor
Send flames to /dev/null