BDD和单元测试单元测试、BDD

2023-09-04 00:14:58 作者:柠檬不萌堪比心酸i

我一直在做TDD和使用更单元测试,而不是驱动我的设计。最近,我读了很多关于BDD;现在,我对他们俩一个更好的主意,我试图找出如何使用BDD和单元测试同时进行。

I have been doing TDD and was using it more as unit testing than to drive my design. Recently I have read a lot about BDD; now that I have a better idea about them both, I was trying to figure out how to use BDD and unit testing concurrently.

例如我会使用BDD,丹北作风带动我的设计,并让说我工作的一个应用程序,我有一个简单的规格,我实现它。我刚刚够BDD /规格来覆盖它。现在我已经经过重新分解,并很高兴,它的传递完成了对该规范,我应该开始编写单元测试,以涵盖所​​有可能的输入,因为这是我在TDD做?

For example I would drive my design using BDD, Dan North style, and lets say I am working on an app and I have a simple spec and I implement it. I have just enough bdd/spec to cover it. Now after I've re-factored it and am happy and it's passed as done for that spec, should I start writing Unit tests to cover all possible inputs, because that's what I did in TDD?

我在公司的唯一开发商,一切都在我的肩上,虽然其他球队会尽力手工测试应用程序,我想降低缺陷率。

I am the only developer in the company and everything is on my shoulders, although the other team do try to manual test the app, I would like to lower the defect rate.

推荐答案

拿起RSpec的书。该书采用黄瓜和放大器; RSpec的。可以很容易地黄瓜和放大器; NUnit的或别的东西,但。黄瓜BDD延长了红,绿,重构的理念更深一层。

Pick up "The RSpec Book". The book uses Cucumber & RSpec. Could easily be Cucumber & NUnit or something else though. Cucumber and BDD extend the red, green, refactor concept a level deeper.

http://www.pragprog.com/titles/achbd/the- RSpec的书

黄瓜: http://cukes.info/ RSpec的: http://rspec.info/ NUnit的: http://www.nunit.org/ JUnit的: http://www.junit.org/

Cucumber: http://cukes.info/ RSpec: http://rspec.info/ NUnit: http://www.nunit.org/ JUnit: http://www.junit.org/