> Rails has the best GUI unit-test rig in the industry. This is doubly
> incredible, because the web is one of the suckiest unit-test situations we
> have.
>
> If you treat your "unit" as a thing whose job is emitting curiously
> constructed HTML, then you test by reading back your HTML to detect the
> inserted data. This doesn't prove your browser won't have bugs. No unit
> testing works like that. It does, however, help you safely refactor and add
> features.
>

I certainly concede the point that Rails has the best GUI unit-test rig in
the industry. I would also concede that it operates in one of the most
difficult-to-test contexts around.

Even being the best, I'm pretty sure we can all agree that it's not quite a
simple as you've stated above. How deep should those tests go? How fragile
are they? Which HTML snippets should be verified? Which should not? How do
we teach others to write those tests? What does this mean in an AJAX world?
Even though we aren't responsible for browser bugs, it is our job to work
around them, shouldn't our tests verify this work too?

there are still some issues there. I hear that rspec goes quite a ways in
> this direction, but I'm not quite seeing it yet.
>

RSpec has nothing there; it's just a DSL that wraps standard unit testing.
> Its benefits and problems are the same as unit tests.
>
> It gives itself good press, though!


My understanding, which certainly could be flawed as I don't have any real
experience with it, is that RSpec basically gives us 'permission' to write
tests at a less granular level. By essentially creating that DSL and naming
it a 'specification', we can write tests against object interactions in
addition to isolated object behavior. This has the obvious side effect of
compromising defect localization, but it seems like that may be a useful
tradeoff in the context of GUI testing.

Again, I'm certainly not in a position to defend RSpec, as I haven't been
convinced to use it, that's just my (potentially flawed) understanding of
it's value proposition. I do know that some smart people I respect choose
not to use it, and others do. This leads me to believe that it has some
value, but that this value isn't so obvious and so significant that we all
dump whatever we're doing now and jump on board.

Thanks for the conversation!


Luke Bayes
http://www.asserttrue.com

Reply via email to