Ever thought about DNA? I mean, the fact that DNA is a way to store executable instructions? That sounds a lot like code.
This talk is an exploration of what Nature can teach us about testing software.
Notes by slide:
Adenine [A] can only pair with Thymine [T]
Cytosine [C] can only pair with Guanine [G]
“It [DNA] generally repairs mistakes in the placement of bases as it replicates itself. This repair work is performed by DNA Polymerase, the enzyme that helps catalyze construction of new DNA from single strands.”
“If an adenine is mistakenly set in place to become linked with a guanine (not its correct partner), the polymerase recognizes that mistake, backtracks by one pair, fixes the mismatch, and then moves on. So the rate of mutation in most DNA viruses is relatively low.”
From Spillover pg. 237
Image Attribution: http://commons.wikimedia.org/wiki/DNA#mediaviewer/File:DNA_chemical_structure.svg
Madeleine Price Ball
RNA can form a double helix, but is still not as stable (ribose vs deoxyribose).
RNA is a single stranded molecule, generally, with a single base.
Uracil represents the [U] in RNA. It usually takes the place of thymine.
Image Attribution: http://commons.wikimedia.org/wiki/File:RNA-Nucleobases.svg
The enzyme employed by RNA viruses, on the other hand, is “error prone,” according to Eddie. “It’s just a really crappy polymerase,” which doesn’t proofread, doesn’t backtrack, doesn’t correct erroneous...
By Paul Burt
(a very handsome mans)
DNA vs RNA
and their Transcription Polymerases
+ is strongly typed.
+ has unit tests.
+ is slow (harder to change).
+ is weakly typed.
+ does not test.
+ is fast (easy to change).
RNA’s Transcription Enzyme
Is “error prone […] It’s just a really crappy polymerase,”
From Spillover, pg. 273
Enter the Eigen Paradox!
A Mathematical proof that says...
You tell ‘em, Manfred Eigen!
● Scripts and other tiny software? Ok to roll without tests.
● Multi-ﬁle projects? You MUST test.
So yeah, it’s hard.
Fear not, JFK offers inspiring words:
“We choose to go to the moon [write tests] in this
decade and do the other things, not because they are
easy, but because they are hard, because that goal will
serve to organize and measure the best of our energies
Tent Caterpillars and Gypsy Moths
Boom and Bust Cycles
Q: What happens when a bug
catches a bug?
Why the Boom and Bust?
● Food scarcity or abundance?
● Venus is in retrograde motion?
When a caterpillar wanders through a prior infection, it
too becomes infected, then melts.
The resulting melt drips on leaves.
It’s neighbors (likely) become infected.
Big population = Big problems
● Some bugs are only revealed in large sets. For
example, lots of users.
● If you’re seeing erratic and seemingly random
behavior in a bug report…
● It could be a melty bug!
● (bugs interacting with bugs)
Adapt or Atrophy
Our History n Frogs, Fish, and Everything
Re-using code = Hello bugs
Generally: It’s easier to modify something that exists,
than to build it from scratch. Adapt, don’t create.
That said... adapting is a shortcut. Shortcuts lead to
bugs of their own.
When bugs appear knowing why helps. Fixing the
problem is often signiﬁcantly easier.
We Find Strength
Stay away from your cousin
Emacs vs Vim
Python vs Ruby
iOS vs Android
● Really, Natural Selection?
Competition = Strength
● (Even with competition, life is still relatively fragile)
Take something out of it’s intended
environment and …
OH HAY, THATS Y U DO
Drift between teams / programming philosophies can be
beneﬁcial (breeds strength!)
Don’t get carried away, though. Taking a creature (or
piece of software) out of it’s native environment can have
bad effects. Use common sense.
Small drifts between highly similar products will drive
ﬁerce competition. Can be a great natural motivator.
GMO, Hell No!
Intelligent Design -- No, really
Designing for any ONE attribute
will lead you into a corner.
Making changes to code means you increase your
Old features will break after making a change.
It’s ok! Don’t need to ﬁx it all, just need to know about it.
Together, we determine what’s acceptable and what is
Prions, Protists, and Viruses
How did we discover viruses?
We couldn’t see them.
The answer is theory.
Ebola (Bats, we’re pretty sure)
Fuck Bats (!)
(ie Simulators) are shit.
To ﬁnd the right bug,
the host matters.
Like viruses, prions, etc… some bugs are invisible.
Bugs appear in every imaginable shape and size.
As a result… “Bug Free” software is a unicorn.
Simulators are sterile environments. To ﬁnd bugs, you
gotta get dirty (test on device / host).