Hey all, Trying to get feel for RSpec usage so I''m taking a straw poll... What''s the largest project you''ve used RSpec on in terms of app LOC app and spec LOC? Also, how long have you been using RSpec in "production" code? -Bryan
Le 17 f?vr. 07 ? 10:48, Bryan Helmkamp a ?crit :> Trying to get feel for RSpec usage so I''m taking a straw poll...Here we go...> What''s the largest project you''ve used RSpec on in terms of app LOC > app and spec LOC? Also, how long have you been using RSpec in > "production" code?Actually I used RSpec in one unreleased project (deadline 23 March...), here''s my rails stats : +----------------------+-------+-------+---------+---------+----- +-------+ | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+----- +-------+ | Controllers | 1487 | 1059 | 21 | 132 | 6 | 6 | | Helpers | 43 | 42 | 0 | 0 | 0 | 0 | | Models | 1168 | 489 | 23 | 42 | 1 | 9 | | Libraries | 233 | 145 | 3 | 30 | 10 | 2 | | Components | 0 | 0 | 0 | 0 | 0 | 0 | | Model specs | 1697 | 1366 | 2 | 25 | 12 | 52 | | View specs | 1581 | 1161 | 0 | 0 | 0 | 0 | | Controller specs | 5998 | 4741 | 0 | 168 | 0 | 26 | | Helper specs | 1581 | 1161 | 0 | 0 | 0 | 0 | +----------------------+-------+-------+---------+---------+----- +-------+ | Total | 13788 | 10164 | 49 | 397 | 8 | 23 | +----------------------+-------+-------+---------+---------+----- +-------+ Code LOC: 1735 Test LOC: 8429 Code to Test Ratio: 1:4.9 My code to test ratio is a bit high, but I''m really a newbie at both RSpec AND (T/B)DD in general, so I assumed the more I''ll be used to it the more I can refactor my specs to use less LOC, my RCov code coverage is around 98% (another one which is probably to high). FYI, I''m using RSpec/RSpecOnRails trunk and RoR 1.2 Stable branch, RSpec and RSpecOnRails are both installed as plugin (this only require minors changes in rake tasks and some plugins like RSpec::Autotest to use the command in vendor/plugin/rspec/bin/spec if present and not the RubyGems one). Jonathan -- Tron Jonathan http://jonathan.tron.name
On 2/17/07, Jonathan Tron <jonathan.tron.mailings at gmail.com> wrote:> Le 17 f?vr. 07 ? 10:48, Bryan Helmkamp a ?crit : > > > Trying to get feel for RSpec usage so I''m taking a straw poll...3 months. All apps are in production. I was lucky enough to have some good rspec-ers (rspectacles?) set up my projects. Code LOC: 1845 Test LOC: 3710 Code to Test Ratio: 1:2.0 Code LOC: 1294 Test LOC: 1073 Code to Test Ratio: 1:0.8 Code LOC: 634 Test LOC: 1136 Code to Test Ratio: 1:1.8 Code LOC: 2789 Test LOC: 3130 Code to Test Ratio: 1:1.1 court3
On 2/17/07, Bryan Helmkamp <bhelmkamp at gmail.com> wrote:> Hey all, > > Trying to get feel for RSpec usage so I''m taking a straw poll... > > What''s the largest project you''ve used RSpec on in terms of app LOC > app and spec LOC? Also, how long have you been using RSpec in > "production" code?I''d like to add to this question. Based on experience doing apps using test/unit and rspec, what benefits do you perceive of each approach during initial development and during subsequent maintenance? Thanks, David> > -Bryan > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On 17 Feb 2007, at 20:27, David Chelimsky wrote:> I''d like to add to this question. > > Based on experience doing apps using test/unit and rspec, what > benefits do you perceive of each approach during initial development > and during subsequent maintenance? > > Thanks, > DavidCan''t really say about maintenance because we''ve only got one app finished and it hasn''t needed going back to. (Well, we''ve got two finished, but I wasn''t involved on the first one and there are no unit tests.) As for initial development: - you can focus on implementing specific features, rather than trying to remember what other bits of code might be affected by any given change (which I find very tiring, as I''m a cautious programmer by nature, rather than a change-it-and-see type) - you can code at a more consistent rate because you''re working on discrete pieces of functionality, so breakages tend to be localised and easily identifiable (it''s probably not the most flattering way to describe it, but I told my boss that programming with rspec was like digging a hole - put shovel in ground, throw soil over shoulder, repeat) - I''m only working with one other person on our current project, but when I read his code I get a good idea what he was thinking by looking at the specs - it''s far less stressful - I get this wierd feeling of creativity writing the specs first, like I want the code to do *this* and *this* and why not *this* too. It feels like half the battle is over just by figuring out what I want the code to look like. There is one downside, which is that on the rare occasions my office is quiet enough to do any useful work (generally around the time hell places an order for hats and scarves, the moon changes a nice shade of #0000ff, and local porcine aviation increases noticeably), it''s possible to code so fast I''m exhausted by the end of the day. Fortunately, the phone stops this happening too often. And on the other hand, it beats chasing a typo around for most the afternoon slowly losing the will to live. Ashley