mysql,Linux,HighPerformance,ruby on Rails

2009年10月22日星期四

学习Behavior Driven Development 的来龙去脉

是的,我不会BDD,因为要解决自已的测试需求,所以我找到了rspec,所以我遇到了BDD.
什么是BDD,有现成的不用介绍.我只说一下为什么要BDD.这起源于我的一个场景下的需求
如果我使用rails,好像只用得着unit test,并没有什么必要需求使用BDD.但最近继续写这个Plugin

http://github.com/xiaods/open-taobao
就是调用open.taobao.com 插件,更方便的调用taobao open api.现在这个插件还只有一个架子,也没有测试,所以我想通过TDD来驱动开发taobao TOP的API,API支付GET/POST,所以使用unit test行不通.所以需要一种更自然的方式来作.哪种呢,经过Digg之后,我认为就是BDD.BDD需要和TDD结合才算完美.其实本质上来说,就是换个方法来TDD,所以本无区分.只需要会用就用.那现在就要问了:如何踏出第一步呢:
* Simple Ruby and RSpec Tutorial – This tutorial will bring you through the basics of the process while developing a simple state machine. It’s a fun tutorial.
* RSpec on Rails – Luke Redpath’s awesome introduction to using RSpec with your Rails application development.
* RSpec Mocks and Models – Peepcode screencast explaining Mocks and Models. You can view a small sample of the screencast, but I suggest forking out the $9. It’s definitely worth it. This especially helped me out as I’ve been writing a Ruby-based library for accessing the FamilySearch Public API.

其中,Simple Ruby and RSpec Tutorial我是亲自看了一遍,讲的非常清楚,基本看完就可以建立基本的概念观.也欢迎有高人与我分享.可以通过Twitter来告诉我.我的帐号是xds2000

参考:
http://jimmyzimmerman.com/blog/2007/11/simple-tutorials-for-learning-bdd-and-rspec.html

没有评论:

发表评论