开发者

Cucumber and scaffolding

开发者 https://www.devze.com 2023-03-26 16:42 出处:网络
I\'m just learning Cucumber and BDD way to create applications. When I\'m start learning rails by http://guides.rubyonrails.org/ I\'m use scaffolding to generate CRUD functionality and skeleton to my

I'm just learning Cucumber and BDD way to create applications. When I'm start learning rails by http://guides.rubyonrails.org/ I'm use scaffolding to generate CRUD functionality and skeleton to my controllers开发者_Go百科 and views. This way give me large speed up versus PHP custom writing code. But when I'm looking to cucumber screencasts, reading comments about BDD, or looking to https://github.com/diaspora/diaspora source code - all of them doesn't use scaffold. When I try to write tests I'm spent long time to compose and test, but I know that the basic code which generated by scaffold isn't crashable. That is my question: How give compromise between BDD and scaffold speed?


The scaffold serves as a good starting point whilst you are getting to know the TDD/BDD cycle. I found that when I first read the RSpec Book that it was confusing with what to use when and why ! Then along came the Cucumber Book which helps a little more since it takes you through the steps a little slower (although the book is still in beta, but a fantastic resource).

One other great resource that helped was a blog post by Sarah Mei called "Outside-in BDD: How?". What is nice about this post is the discussion of the flow and style that you use as a developer. This was useful since it puts some context around the style of doing BDD and not just a re-hash of a basic example.

Of course there is the usual debate that 'real programmers' shouldn't use the scaffold. That may be true for a large scale, production application. The reality is that we all have to learn and start somewhere and Rails is no exception; it's a large framework and once you add in RSpec + Cucumber the breadth and depth grows very fast.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号