I've found it relieving to think "It's not that much a difference".
In practive, I've started to think of my old "tests" more as "checked
examples" -- collected in "stories" or "specs". I've found it slightly
easier to write test code since I started reading about BDD, and I'm
also more forgiving on some "hard TDD principles" I've used before --
specifically I'm not adhering to the DRY-principle at all that much
anymore (Don't Repeat Yourself) when it comes to test-code.
The main idea I'm following instead, is "readability" when it comes to
test code:
// In some Fixture/Story/Spec
[Test]
public void Example1_Assigning_a_variable() {
Given_a_computer();
And_variable_set_to("A", 5);
This_expression_should_compute_to("A*2", 10);
}
My old TDD version this code might have look like:
[Test]
public void AssigningAVariable() {
Computer cpu = new Computer("test computer");
cpu.SetVariable("A", 5);
double result = cpu.Compute("A*2");
Assert.AreEqual(10, result);
}
As you can see, it is mostly cosmetic. But nonetheless, it is somewhat
more readable, don't you think..?
The "literate methods" is just easing the readability of test code. In
my TDD background, I would NOT have written them! Some month into my
BDD experience, I find them the most profound difference from TDD.
cya,
/Olof
2008/7/20 Sean Chambers <dko...@gmail.com>: