Hello, I'm not trolling. I don't like specs (RSpec) : everytime I had a look to specs I felt it was only syntaxic sugar driven by a big machinery and I continued to write classic unit tests.
But I've seen more and more projects using rspec - So I consider beeing wrong about this software.
Do you have any link to articles that advocates for or against specs ? Or do you have any argument in favor of specs compared with plain old test suites ?
Hello, I'm not trolling. I don't like specs (RSpec) : everytime I had a look to specs I felt it was only syntaxic sugar driven by a big machinery and I continued to write classic unit tests.
But I've seen more and more projects using rspec - So I consider beeing wrong about this software.
Do you have any link to articles that advocates for or against specs ? Or do you have any argument in favor of specs compared with plain old test suites ?
Hello, I'm not trolling. I don't like specs (RSpec) : everytime I had a look to specs I felt it was only syntaxic sugar driven by a big machinery and I continued to write classic unit tests.
But I've seen more and more projects using rspec - So I consider beeing wrong about this software.
Do you have any link to articles that advocates for or against specs ?
I wasn't crazy about what I had read about rspec, but then the
management side of agile, scrums etc hasn't appealed to me either and
I can't say I've had much of any positive experiences with it thus
far.
···
On Nov 18, 4:56 am, Zouplaz <u...@domain.invalid> wrote:
Hello, I'm not trolling. I don't like specs (RSpec) : everytime I had a
look to specs I felt it was only syntaxic sugar driven by a big
machinery and I continued to write classic unit tests.
But I've seen more and more projects using rspec - So I consider beeing
wrong about this software.
Do you have any link to articles that advocates for or against specs ?
Or do you have any argument in favor of specs compared with plain old
test suites ?
On Tue, Nov 18, 2008 at 10:56 AM, Zouplaz <user@domain.invalid> wrote:
Hello, I'm not trolling. I don't like specs (RSpec) : everytime I had a look
to specs I felt it was only syntaxic sugar driven by a big machinery and I
continued to write classic unit tests.
But I've seen more and more projects using rspec - So I consider beeing
wrong about this software.
Do you have any link to articles that advocates for or against specs ? Or do
you have any argument in favor of specs compared with plain old test suites
?
You can keep using all the existing assert_xxx macros of Test::Unit, but
wrap up groups of tests in a logical and hierarchical way.
I also find it much clearer to write
assert_equal "foo", @bar # required value, actual value
rather than whatever_the.rspec.equivalent_is?
FWIW, I use Shoulda with mocha. I previously used flexmock, but I found
its error messages when expectations are not met to be very unhelpful in
locating the problem.
I've read that before. Can anyone defend rspec against that attack? What
does rspec do better? I want to get a better idea of why they invented
this quasi-English framework.
--Ken
···
On Tue, 18 Nov 2008 08:49:51 -0500, James Gray wrote:
On Nov 18, 2008, at 3:56 AM, Zouplaz wrote:
Hello, I'm not trolling. I don't like specs (RSpec) : everytime I had a
look to specs I felt it was only syntaxic sugar driven by a big
machinery and I continued to write classic unit tests.
But I've seen more and more projects using rspec - So I consider beeing
wrong about this software.
Do you have any link to articles that advocates for or against specs ?
--
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/
If you haven't yet, look at MiniTest. It claims to be a foundation for building other test suites, but I rather like it on it's own. Small, simple, fast...and I really like their Mock strategy. Very clean... like Ruby!
-Josh
···
On Nov 18, 2008, at 10:14 AM, Brian Candler wrote:
You can keep using all the existing assert_xxx macros of Test::Unit, but
wrap up groups of tests in a logical and hierarchical way.
I have been using test/spec for same thing. What advantages shoulda
have over test/spec ?
···
On Tue, Nov 18, 2008 at 8:44 PM, Brian Candler <b.candler@pobox.com> wrote:
I also find it much clearer to write
assert_equal "foo", @bar # required value, actual value
rather than whatever_the.rspec.equivalent_is?
FWIW, I use Shoulda with mocha. I previously used flexmock, but I found
its error messages when expectations are not met to be very unhelpful in
locating the problem.
--
Posted via http://www.ruby-forum.com/\.
--
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.
* I love the normal strings used for test naming as opposed to wearing out your underscore key with test/unit
* I have found contexts to be generally an improvement, despite the negative break down from the shoulda author
* Despite the jokes about how they just changed a T to a B, I do think BDD has improved awareness of key testing concepts
James Edward Gray II
···
On Nov 18, 2008, at 8:06 PM, Ken Bloom wrote:
On Tue, 18 Nov 2008 08:49:51 -0500, James Gray wrote:
On Nov 18, 2008, at 3:56 AM, Zouplaz wrote:
Hello, I'm not trolling. I don't like specs (RSpec) : everytime I had a
look to specs I felt it was only syntaxic sugar driven by a big
machinery and I continued to write classic unit tests.
But I've seen more and more projects using rspec - So I consider beeing
wrong about this software.
Do you have any link to articles that advocates for or against specs ?
I've read that before. Can anyone defend rspec against that attack? What
does rspec do better? I want to get a better idea of why they invented
this quasi-English framework.
BDD is, as you've identified, just testing with a slightly different
vocabulary. But vocabulary is important: it influences how you think
about the problem.
I've seen a lot of TDD code fall into the rut of "let's test method A,
now let's test method B, now let's test method C". BDD encourages a
different focus and a different organization: "let's talk about how
this object should behave in situation A. Now let's talk about how
the object should behave in situation B." The granularity is based on
contextual behavior, rather than on methods.
The very best TDD unit tests I've seen have provided a well-organized
breakdown of the expected inputs and outputs of each method in a
class, and were usable as documentation by a programmer.
Documentation, not a document. By contrast, the very best BDD specs
I've seen have read almost like a prose document describing the
system's behavior, one you could read aloud to a client and have them
understand and either agree or disagree.
···
On Tue, Nov 18, 2008 at 9:06 PM, Ken Bloom <kbloom@gmail.com> wrote:
I've read that before. Can anyone defend rspec against that attack? What
does rspec do better? I want to get a better idea of why they invented
this quasi-English framework.
I've never found that syntax clear or natural, despite doing it for
years. I always have to look up the exact wording of any assertion
other than assert_equal, and I can never seem to remember which side
the "expected value" is conventionally placed on. Using RSpec has
been like finally being able to write expectations the way my fingers
have been *wanting* to write them all these years.
···
On Tue, Nov 18, 2008 at 11:29 AM, Yossef Mendelssohn <ymendel@pobox.com> wrote:
On Nov 18, 9:14 am, Brian Candler <b.cand...@pobox.com> wrote:
I also find it much clearer to write
assert_equal "foo", @bar # required value, actual value
If you haven't yet, look at MiniTest. It claims to be a foundation for
building other test suites, but I rather like it on it's own. Small,
simple, fast...and I really like their Mock strategy. Very clean...
like Ruby!
It's kind of misleading. Many of the assertions he uses in the
Test::Unit example are rails-specific, and don't work with the standard
library (1.8 test/unit or miniunit/minitest/bfts compat layer) like he
claims.
I've dealt with this struggle a bit recently... I think I can safely
comment on Test::Unit and Miniunit.
Miniunit is good for simple situations. Most situations are simple.
There's nothing wrong with that. Unless you want the BDD stuff, use it.
If you need to do anything unorthodox, you will not find (or be capable
of doing without extensive monkeypatching) that support in miniunit. One
of the nice things in particular about Test::Unit is that it takes a
very OOP nature to testing; Miniunit is very top-down and the parts are
harder to deal with individually than with Test::Unit, and miniunit is
small and light as a result.
QA and Testing is one thing Perl really excels at. I think it would be
wise to look at how they're doing it and consider adapting ruby's
environment to deal with it in a similar way. TAP and Test::Harness mean
that you can write the test suite with print statements if you really
want to, that's a powerful abstraction I don't think is transferring
well between language communities due to perl's pariah status here.
Depending on what I am doing, I start by writing the end-user
documentation (prose, phrases, examples, drawings, pictures)
explaining the behaviour of an object, with the different possible
approaches, etc. This document is refined until everything seems to
fall naturally in place. Then I divide the problem into small
objectives by writing unit tests. And finally I write the code. I
think this approach is very close to BDD with one simple but important
difference: I can write *nice*, searchable, illustrated documentation
with real, sometimes funny, phrases.
I find RSpec to be a poor middle man: not good enough for literature,
too verbose/intrusive for simple tests.
gaspard
···
On Wed, Nov 19, 2008 at 7:44 PM, Avdi Grimm <avdi@avdi.org> wrote:
On Tue, Nov 18, 2008 at 9:06 PM, Ken Bloom <kbloom@gmail.com> wrote:
I've read that before. Can anyone defend rspec against that attack? What
does rspec do better? I want to get a better idea of why they invented
this quasi-English framework.
BDD is, as you've identified, just testing with a slightly different
vocabulary. But vocabulary is important: it influences how you think
about the problem.
I've seen a lot of TDD code fall into the rut of "let's test method A,
now let's test method B, now let's test method C". BDD encourages a
different focus and a different organization: "let's talk about how
this object should behave in situation A. Now let's talk about how
the object should behave in situation B." The granularity is based on
contextual behavior, rather than on methods.
The very best TDD unit tests I've seen have provided a well-organized
breakdown of the expected inputs and outputs of each method in a
class, and were usable as documentation by a programmer.
Documentation, not a document. By contrast, the very best BDD specs
I've seen have read almost like a prose document describing the
system's behavior, one you could read aloud to a client and have them
understand and either agree or disagree.