<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Java BDD</title>
	<link>http://blog.ianbicking.org/2007/11/27/java-bdd/</link>
	<description></description>
	<pubDate>Thu, 28 Aug 2008 08:45:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: Kragen Sitaker</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-11422</link>
		<dc:creator>Kragen Sitaker</dc:creator>
		<pubDate>Sat, 26 Jan 2008 16:32:21 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-11422</guid>
		<description>BDD is just new names for TDD.  doctest is a fine framework for doing BDD.  Maybe Instinct is too, but it kind of suffers from the method definition overhead; it's less painful in Smalltalk, where the design of SUnit (that it apes) comes from.  But that's Java's fault, not Instinct's.</description>
		<content:encoded><![CDATA[<p>BDD is just new names for TDD.  doctest is a fine framework for doing BDD.  Maybe Instinct is too, but it kind of suffers from the method definition overhead; it&#8217;s less painful in Smalltalk, where the design of SUnit (that it apes) comes from.  But that&#8217;s Java&#8217;s fault, not Instinct&#8217;s.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurent Szyster</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-6835</link>
		<dc:creator>Laurent Szyster</dc:creator>
		<pubDate>Thu, 27 Dec 2007 01:27:31 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-6835</guid>
		<description>"Someone needs to port the concept to Java too."

Here's a bit more than a starting point:

http://svn.berlios.de/svnroot/repos/less4j/trunk/src/org/less4j/protocols/Doctest.java

For sample output see:

http://laurentszyster.be/less4j/doc/#org.less4j.protocols.IRTD2.digested

The implementation is simple: I hijacked javadoc and used the best known REPL for Java: Rhino.

Enjoy ...</description>
		<content:encoded><![CDATA[<p>&#8220;Someone needs to port the concept to Java too.&#8221;</p>

<p>Here&#8217;s a bit more than a starting point:</p>

<p><a href="http://svn.berlios.de/svnroot/repos/less4j/trunk/src/org/less4j/protocols/Doctest.java" rel="nofollow">http://svn.berlios.de/svnroot/repos/less4j/trunk/src/org/less4j/protocols/Doctest.java</a></p>

<p>For sample output see:</p>

<p><a href="http://laurentszyster.be/less4j/doc/#org.less4j.protocols.IRTD2.digested" rel="nofollow">http://laurentszyster.be/less4j/doc/#org.less4j.protocols.IRTD2.digested</a></p>

<p>The implementation is simple: I hijacked javadoc and used the best known REPL for Java: Rhino.</p>

<p>Enjoy &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Margaret M. Gille</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-6830</link>
		<dc:creator>Margaret M. Gille</dc:creator>
		<pubDate>Wed, 26 Dec 2007 21:43:12 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-6830</guid>
		<description>Ian, Are you a decent of Frederick Bicking?  I am working on my family tree and am looking for relatives from this line.  

Frederick Bicking
From Wikipedia, the free encyclopedia
Jump to: navigation, search
Frederick Bicking was born in Winterburg, a municipality in the district of Bad Kreuznach in Rhineland-Palatinate, in western Germany and came probably first to Philadelphia and then to East Brandywine Township, Chester County, Pennsylvania, before the revolution.

In Pennsylvania he owned and operated a paper mill, establishing the Bicking paper dynasty that would last well into the 19th century. The Continental Congress allocated funds to purchase Bicking's paper for currency production. He is mentioned in several of the minutes of the Continental Congress and in the George Washington Papers.

Frederick Bicking married Mary Catherine Unverzagt of Otwiller, Germany on 26 May 1752 at St. Michael's &#38; Zion Lutheran Church in Germantown, Pennsylvania. Mary Catherine Unverzagt, daughter of Johannes Unverzagt, was also a German Palatine.

Of Frederick Bicking's five sons, three were paper makers in Pennsylvania.

John Bicking had a paper mill near present day Fisherville.

Retrieved from "http://en.wikipedia.org/wiki/Frederick_Bicking"</description>
		<content:encoded><![CDATA[<p>Ian, Are you a decent of Frederick Bicking?  I am working on my family tree and am looking for relatives from this line.  </p>

<p>Frederick Bicking
From Wikipedia, the free encyclopedia
Jump to: navigation, search
Frederick Bicking was born in Winterburg, a municipality in the district of Bad Kreuznach in Rhineland-Palatinate, in western Germany and came probably first to Philadelphia and then to East Brandywine Township, Chester County, Pennsylvania, before the revolution.</p>

<p>In Pennsylvania he owned and operated a paper mill, establishing the Bicking paper dynasty that would last well into the 19th century. The Continental Congress allocated funds to purchase Bicking&#8217;s paper for currency production. He is mentioned in several of the minutes of the Continental Congress and in the George Washington Papers.</p>

<p>Frederick Bicking married Mary Catherine Unverzagt of Otwiller, Germany on 26 May 1752 at St. Michael&#8217;s &amp; Zion Lutheran Church in Germantown, Pennsylvania. Mary Catherine Unverzagt, daughter of Johannes Unverzagt, was also a German Palatine.</p>

<p>Of Frederick Bicking&#8217;s five sons, three were paper makers in Pennsylvania.</p>

<p>John Bicking had a paper mill near present day Fisherville.</p>

<p>Retrieved from &#8220;http://en.wikipedia.org/wiki/Frederick_Bicking&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Paci</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-6685</link>
		<dc:creator>George Paci</dc:creator>
		<pubDate>Mon, 24 Dec 2007 04:46:37 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-6685</guid>
		<description>I hate to say it, Ian, but this post is kind of cranky.

You picked an example spec with the greatest possible overhead-to-meaningful-code ratio: 9 lines of setup (much of which, like the import statements, is forced by Java), and only 3 lines of an actual spec (one of which is just an annotation saying that it is, in fact, a spec, so maybe that's overhead, too).

What the framework gives you, like xUnit, is the ability to do some setup in the setUp() method, then share it among some other spec methods (test methods, in xUnit).  It's pretty rare that there's only one spec method.

And only the code is shared: the actual instance (or whatever other context you set up) is different for each spec method, which helps keep one problem from kicking up a cloud of spurious follow-on problems to hide itself.  I'm not sure how you'd go about that in doctest without writing the equivalent of a setUp() method and calling it repeatedly.

The motivations for BDD are to get people to do TDD *right*.  That means ditching anachronistic test-related names that date from back when we thought this stuff was unit testing.  It's not: it's design, and we should use words related to design instead.  (If there's one thing XP people agree on, it's that names actually matter.)

Finally, I think you see a conflict between doctest and BDD.  I don't: doctest is a tool, BDD is an approach, and you could clearly use doctest to help you do BDD.  (Of course, you could, instead, use it as after-the-fact unit tests, functional tests, executable documentation, and possibly a dessert/floor wax.)</description>
		<content:encoded><![CDATA[<p>I hate to say it, Ian, but this post is kind of cranky.</p>

<p>You picked an example spec with the greatest possible overhead-to-meaningful-code ratio: 9 lines of setup (much of which, like the import statements, is forced by Java), and only 3 lines of an actual spec (one of which is just an annotation saying that it is, in fact, a spec, so maybe that&#8217;s overhead, too).</p>

<p>What the framework gives you, like xUnit, is the ability to do some setup in the setUp() method, then share it among some other spec methods (test methods, in xUnit).  It&#8217;s pretty rare that there&#8217;s only one spec method.</p>

<p>And only the code is shared: the actual instance (or whatever other context you set up) is different for each spec method, which helps keep one problem from kicking up a cloud of spurious follow-on problems to hide itself.  I&#8217;m not sure how you&#8217;d go about that in doctest without writing the equivalent of a setUp() method and calling it repeatedly.</p>

<p>The motivations for BDD are to get people to do TDD <em>right</em>.  That means ditching anachronistic test-related names that date from back when we thought this stuff was unit testing.  It&#8217;s not: it&#8217;s design, and we should use words related to design instead.  (If there&#8217;s one thing XP people agree on, it&#8217;s that names actually matter.)</p>

<p>Finally, I think you see a conflict between doctest and BDD.  I don&#8217;t: doctest is a tool, BDD is an approach, and you could clearly use doctest to help you do BDD.  (Of course, you could, instead, use it as after-the-fact unit tests, functional tests, executable documentation, and possibly a dessert/floor wax.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Adams</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-5060</link>
		<dc:creator>Tom Adams</dc:creator>
		<pubDate>Fri, 30 Nov 2007 00:39:05 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-5060</guid>
		<description>Hi Ian, Paddy3118,

So the question is, does making the mental translation between what you **see** and what you interpret it as affect your ability to understand the **intent** of what is being expressed? I agree with you, I can do the translation in my head quickly also (for the tools I'm used to working with), however I find a natural DSL type syntax to be easier to write (good tool support) and more readable than the equivalent. So I get a better process and a better result.

Having a non-specialist as a target audience makes sense for top level "is this done" and "does it do what I want" type of tests (acceptance/functional/story tests). I don't think anyone is trying to dumb things down to a point where **anyone** can read and reason about code. We should strive to make it as simple and clear as possible, but clearly there will always be complexity and a barrier to entry. What we are trying to do is use the same **language** as what a non-specialist would use, so that they can at least get an idea of what we're up to (is it what I asked for, etc.) as well as helping us to not have to translate between how we think of things and how they think of things, this is a recipe for disaster. If your code and your "tests" all use the same language as that of the domain, things become a lot simpler, leaving you to worry about other things.</description>
		<content:encoded><![CDATA[<p>Hi Ian, Paddy3118,</p>

<p>So the question is, does making the mental translation between what you <strong>see</strong> and what you interpret it as affect your ability to understand the <strong>intent</strong> of what is being expressed? I agree with you, I can do the translation in my head quickly also (for the tools I&#8217;m used to working with), however I find a natural DSL type syntax to be easier to write (good tool support) and more readable than the equivalent. So I get a better process and a better result.</p>

<p>Having a non-specialist as a target audience makes sense for top level &#8220;is this done&#8221; and &#8220;does it do what I want&#8221; type of tests (acceptance/functional/story tests). I don&#8217;t think anyone is trying to dumb things down to a point where <strong>anyone</strong> can read and reason about code. We should strive to make it as simple and clear as possible, but clearly there will always be complexity and a barrier to entry. What we are trying to do is use the same <strong>language</strong> as what a non-specialist would use, so that they can at least get an idea of what we&#8217;re up to (is it what I asked for, etc.) as well as helping us to not have to translate between how we think of things and how they think of things, this is a recipe for disaster. If your code and your &#8220;tests&#8221; all use the same language as that of the domain, things become a lot simpler, leaving you to worry about other things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paddy3118</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4964</link>
		<dc:creator>Paddy3118</dc:creator>
		<pubDate>Thu, 29 Nov 2007 06:20:46 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4964</guid>
		<description>Hi Tom, Ian.
I am not so sure that having the needs of a non-specialist business manager as a primary goal is a good thing. Having a concise way to define tests; concise meaning clear, comprehensive, *and* short; from the domain specialists point of view; might be more productive. 

I guess as an example I will switch to the design and verification of digital chips which is the field I am in. We have always had a written design spec that both the verification team and the design team interpret. lately we are using assertion languages such as [PSL](http://www.doulos.com/knowhow/psl/) to accurately and unambiguously define what the spec. says.

The spec may say: "Signal apply_power occurs after the breaks are released". 

Which in PSL becomes: `` assert always {rose(apply_power)} &#124;-&gt; { ! brake_applied }; ``

Which re-interpreted in English becomes something like: "Ensure that whenever the signal apply\_power rises, the signal brake\_applied is not high at that same time"

You can formally check the PSL against the design. You can simulate the design and ensure it does not contradict the assertion. Domain specialists can accurately reason about the specs interpretation using PSL. ( And pedants can flag the spelling mistakes :-) 

Management has to either learn PSL, get someone they trust who can explain PSL to them, monitor the process of creating and using PSL, or probably do all of the above to be a good manager. The domain specialist works together with management  so the process of PSL creation and monitoring ends up as accurate reports and graphs of progress *but* PSL and other assertion languages are optimised for the domain . It needs to be writeable and maintainable by the domain specialists.  

To get back to programming, I think we should be going down a similar route; what is maintainable, precise, and readable for the programmer creating tests will create better software, and, I think, prove easier for the manager in the long run.</description>
		<content:encoded><![CDATA[<p>Hi Tom, Ian.
I am not so sure that having the needs of a non-specialist business manager as a primary goal is a good thing. Having a concise way to define tests; concise meaning clear, comprehensive, <em>and</em> short; from the domain specialists point of view; might be more productive. </p>

<p>I guess as an example I will switch to the design and verification of digital chips which is the field I am in. We have always had a written design spec that both the verification team and the design team interpret. lately we are using assertion languages such as <a href="http://www.doulos.com/knowhow/psl/">PSL</a> to accurately and unambiguously define what the spec. says.</p>

<p>The spec may say: &#8220;Signal apply_power occurs after the breaks are released&#8221;. </p>

<p>Which in PSL becomes: <code>assert always {rose(apply_power)} |-&gt; { ! brake_applied };</code></p>

<p>Which re-interpreted in English becomes something like: &#8220;Ensure that whenever the signal apply&#95;power rises, the signal brake&#95;applied is not high at that same time&#8221;</p>

<p>You can formally check the PSL against the design. You can simulate the design and ensure it does not contradict the assertion. Domain specialists can accurately reason about the specs interpretation using PSL. ( And pedants can flag the spelling mistakes :-) </p>

<p>Management has to either learn PSL, get someone they trust who can explain PSL to them, monitor the process of creating and using PSL, or probably do all of the above to be a good manager. The domain specialist works together with management  so the process of PSL creation and monitoring ends up as accurate reports and graphs of progress <em>but</em> PSL and other assertion languages are optimised for the domain . It needs to be writeable and maintainable by the domain specialists.  </p>

<p>To get back to programming, I think we should be going down a similar route; what is maintainable, precise, and readable for the programmer creating tests will create better software, and, I think, prove easier for the manager in the long run.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Bicking</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4927</link>
		<dc:creator>Ian Bicking</dc:creator>
		<pubDate>Wed, 28 Nov 2007 23:43:58 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4927</guid>
		<description>Perhaps some of the difference in opinion is due to the fact that, to a Python programmer, a console session feels very natural.  That doctest has existed for a while also means there's lots of examples of it, adding to the familiarity.  It's very difficult, for instance, to read `len(stack)` out loud (I find).  Or even worse, `if obj.get(key, default) == value:` -- how do you read that?  "if obj [uck, I can't even pronounce 'obj'] get key comma default equals value" ?  I don't know how to *say* it, but I can read it very naturally.  It's something I (and everyone here) learned to do.  And that's what makes us programmers ;)  In the same way, doctest reads very naturally to me, even though I can't read it out loud.  All these things require some learning before they really sink in.</description>
		<content:encoded><![CDATA[<p>Perhaps some of the difference in opinion is due to the fact that, to a Python programmer, a console session feels very natural.  That doctest has existed for a while also means there&#8217;s lots of examples of it, adding to the familiarity.  It&#8217;s very difficult, for instance, to read <code>len(stack)</code> out loud (I find).  Or even worse, <code>if obj.get(key, default) == value:</code> &#8212; how do you read that?  &#8220;if obj [uck, I can&#8217;t even pronounce &#8216;obj&#8217;] get key comma default equals value&#8221; ?  I don&#8217;t know how to <em>say</em> it, but I can read it very naturally.  It&#8217;s something I (and everyone here) learned to do.  And that&#8217;s what makes us programmers ;)  In the same way, doctest reads very naturally to me, even though I can&#8217;t read it out loud.  All these things require some learning before they really sink in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Adams</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4918</link>
		<dc:creator>Tom Adams</dc:creator>
		<pubDate>Wed, 28 Nov 2007 22:36:07 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4918</guid>
		<description>This has been a really good commentary so far, you guys have thought about these problems quite a bit, that's quite refreshing to see, your take is more mature than mine.

In reply to Paddy3118, I wasn't intending to imply by my IDE remark that the code becomes noise. One of the things Instinct (not BDD per se) aims to get rid of is noisy infrastructure. The point I was trying to make was that it is more verbose, but by using tools, the verboseness doesn't add any extra cost in creation, and the benefits you get from the readability are worth it regardless (of whether it's harder or easier to create).

In fact the Instinct expectation API is type-safe, making it easier to write these more verbose statements (the IDE leads you to the correct methods via the type) than their less verbose equivalents.

As always, there's a tradeoff between verboseness and terseness. BDD aims at producing spec code that is readable, and in an argument between readability and terseness I'd take readability every time.

I don't believe the Instinct expectation API is just noise, it's been specifically crafted to minimise noise (in the eyes of its developers admittedly). The API aims at readability and accurately reflecting the **intent** of the author. So for example there are several ways to say a collection/list/array/string has a certain length, you pick the one that most accurately reflects your intent.

Picking on doctest again, the example given:

    &gt;&gt;&gt; len(stack)
    0

Is not as readable to me as the Instinct (or RSpec) equivalent. Perhaps that's because I haven't used python for 7 years or so, or perhaps because I like the ability to read the expectation aloud and have it make sense. "len stack 0" doesn't read as well to me as "expect that stack is of size 0" or "stack should be empty" (as it would be in RSpec) though they both assert the same thing.

In the end it comes down to the audience and how much implicit conversion you do in your head between what's written and what it means.</description>
		<content:encoded><![CDATA[<p>This has been a really good commentary so far, you guys have thought about these problems quite a bit, that&#8217;s quite refreshing to see, your take is more mature than mine.</p>

<p>In reply to Paddy3118, I wasn&#8217;t intending to imply by my IDE remark that the code becomes noise. One of the things Instinct (not BDD per se) aims to get rid of is noisy infrastructure. The point I was trying to make was that it is more verbose, but by using tools, the verboseness doesn&#8217;t add any extra cost in creation, and the benefits you get from the readability are worth it regardless (of whether it&#8217;s harder or easier to create).</p>

<p>In fact the Instinct expectation API is type-safe, making it easier to write these more verbose statements (the IDE leads you to the correct methods via the type) than their less verbose equivalents.</p>

<p>As always, there&#8217;s a tradeoff between verboseness and terseness. BDD aims at producing spec code that is readable, and in an argument between readability and terseness I&#8217;d take readability every time.</p>

<p>I don&#8217;t believe the Instinct expectation API is just noise, it&#8217;s been specifically crafted to minimise noise (in the eyes of its developers admittedly). The API aims at readability and accurately reflecting the <strong>intent</strong> of the author. So for example there are several ways to say a collection/list/array/string has a certain length, you pick the one that most accurately reflects your intent.</p>

<p>Picking on doctest again, the example given:</p>

<pre><code>&gt;&gt;&gt; len(stack)
0
</code></pre>

<p>Is not as readable to me as the Instinct (or RSpec) equivalent. Perhaps that&#8217;s because I haven&#8217;t used python for 7 years or so, or perhaps because I like the ability to read the expectation aloud and have it make sense. &#8220;len stack 0&#8243; doesn&#8217;t read as well to me as &#8220;expect that stack is of size 0&#8243; or &#8220;stack should be empty&#8221; (as it would be in RSpec) though they both assert the same thing.</p>

<p>In the end it comes down to the audience and how much implicit conversion you do in your head between what&#8217;s written and what it means.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Bicking</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4893</link>
		<dc:creator>Ian Bicking</dc:creator>
		<pubDate>Wed, 28 Nov 2007 18:17:39 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4893</guid>
		<description>I think business people (or domain experts, or whatever kind of non-programmer) does best reading things when the text was written with that person as an intended reader (though not necessarily the *only* intended reader).  These people don't consume code, and that's true in a doctest or a BDD test.  In a BDD test they consume the report output, trusting that it accurately describes what is being tested.  In a doctest they'll skim over the code blocks and read the text.  

In BDD, you embed this readable text in the names of your functions and classes, and in RSpec there are opportunities to use strings with arbitrary text (that look a little like docstrings).  In no case does the computer interpret these strings, or confirm the programmer actually lived up to what they said they'd do.  The only thing really consumable by non-programmers is the non-code text.  So I see two things that we are attempting to accomplish: (a) provide a good space for narrative text about requirements, and (b) attach that to testing code so that the programmer can live up to those specifications, keep them in sync, and for the requirements document to be a useful and functional tool to help the programmer.

Doctests (at least the [tests that don't go in docstrings](http://python.org/doc/current/lib/doctest-simple-testfile.html)) really are editable by non-programmers -- from their perspective the format is pretty trivial.  I don't think BDD systems like RSpec really are editable by non-programmers, as the text is embedded in the syntax of the language (which is pretty fragile); doctest embeds the code in the text.

[FITnesse](http://fitnesse.org/) is a more business-oriented (and less programmer-oriented) approach that is very close to doctest.  I personally think its infrastructure is too complex and there's too much indirection.  The amount of test data that can usefully go in a table is fairly low in my experience.  It's high enough that I think it can still be useful, but not high enough to build an entire test framework on it.  If I was writing doctests where tabular data was appropriate, I might just write a table reader that can be used by the doctest, driving the test off the data while keeping the all important code close to the functional specification as well.  In Python this would unfortunately expose a flaw in doctest: the framework doesn't expose enough to the tests.  I'd *like* to provide hints about failures and what table data I was using, but there's no way to do that.  But doctest is old, and it really needs some more love.  I would hope that new implementations would build in a few more features.</description>
		<content:encoded><![CDATA[<p>I think business people (or domain experts, or whatever kind of non-programmer) does best reading things when the text was written with that person as an intended reader (though not necessarily the <em>only</em> intended reader).  These people don&#8217;t consume code, and that&#8217;s true in a doctest or a BDD test.  In a BDD test they consume the report output, trusting that it accurately describes what is being tested.  In a doctest they&#8217;ll skim over the code blocks and read the text.  </p>

<p>In BDD, you embed this readable text in the names of your functions and classes, and in RSpec there are opportunities to use strings with arbitrary text (that look a little like docstrings).  In no case does the computer interpret these strings, or confirm the programmer actually lived up to what they said they&#8217;d do.  The only thing really consumable by non-programmers is the non-code text.  So I see two things that we are attempting to accomplish: (a) provide a good space for narrative text about requirements, and (b) attach that to testing code so that the programmer can live up to those specifications, keep them in sync, and for the requirements document to be a useful and functional tool to help the programmer.</p>

<p>Doctests (at least the <a href="http://python.org/doc/current/lib/doctest-simple-testfile.html">tests that don&#8217;t go in docstrings</a>) really are editable by non-programmers &#8212; from their perspective the format is pretty trivial.  I don&#8217;t think BDD systems like RSpec really are editable by non-programmers, as the text is embedded in the syntax of the language (which is pretty fragile); doctest embeds the code in the text.</p>

<p><a href="http://fitnesse.org/">FITnesse</a> is a more business-oriented (and less programmer-oriented) approach that is very close to doctest.  I personally think its infrastructure is too complex and there&#8217;s too much indirection.  The amount of test data that can usefully go in a table is fairly low in my experience.  It&#8217;s high enough that I think it can still be useful, but not high enough to build an entire test framework on it.  If I was writing doctests where tabular data was appropriate, I might just write a table reader that can be used by the doctest, driving the test off the data while keeping the all important code close to the functional specification as well.  In Python this would unfortunately expose a flaw in doctest: the framework doesn&#8217;t expose enough to the tests.  I&#8217;d <em>like</em> to provide hints about failures and what table data I was using, but there&#8217;s no way to do that.  But doctest is old, and it really needs some more love.  I would hope that new implementations would build in a few more features.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paddy3118</title>
		<link>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4795</link>
		<dc:creator>Paddy3118</dc:creator>
		<pubDate>Wed, 28 Nov 2007 06:01:08 +0000</pubDate>
		<guid>http://blog.ianbicking.org/2007/11/27/java-bdd/#comment-4795</guid>
		<description>If we were writing a _Python_ stack then you wouldn't write the doctest:

     &gt;&gt;&gt; stack.isEmpty()
     true

It would be:

     &gt;&gt;&gt; len(stack)
     0

I find it difficult to believe Kevin Teague's point (8.); that Business types who might find a doctest hard to read, might find a BDD test easier to understand.

Tom Adams (4.) Makes the point that "you don’t type much of this stuff, an IDE will auto-complete the matchers". That point never sits well with me. If the computer can do this stuff then we should move towards not having to see it at all - its just noise. I moved from C because I was wasting too much time chasing pointers, and along came other languages that handled that for me. 

\- Paddy.

Oh, another doctest introductory [link](http://en.wikipedia.org/wiki/Doctest)</description>
		<content:encoded><![CDATA[<p>If we were writing a <em>Python</em> stack then you wouldn&#8217;t write the doctest:</p>

<pre><code> &gt;&gt;&gt; stack.isEmpty()
 true
</code></pre>

<p>It would be:</p>

<pre><code> &gt;&gt;&gt; len(stack)
 0
</code></pre>

<p>I find it difficult to believe Kevin Teague&#8217;s point (8.); that Business types who might find a doctest hard to read, might find a BDD test easier to understand.</p>

<p>Tom Adams (4.) Makes the point that &#8220;you don’t type much of this stuff, an IDE will auto-complete the matchers&#8221;. That point never sits well with me. If the computer can do this stuff then we should move towards not having to see it at all - its just noise. I moved from C because I was wasting too much time chasing pointers, and along came other languages that handled that for me. </p>

<p>&#45; Paddy.</p>

<p>Oh, another doctest introductory <a href="http://en.wikipedia.org/wiki/Doctest">link</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
