ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Python行为驱动的开发BDD

Python行为驱动的开发BDD

原创 Linux操作系统 作者:jieforest 时间:2012-08-27 10:09:40 0 删除 编辑
Behavior. Driven Development is an excellent process to follow in software development. With testing often a practice that is pushed aside to the last minute (or ignored, entirely), baking the process into your daily workflow can prove to be hugely beneficial to the quality of your code. The structure and design of the tests, coupled with the Gherkin syntax makes tests easy to read – even for team members with non-technical backgrounds.

All code should be tested thoroughly, meaning that defects should ideally never reach production. If they do, then a thorough test suite, focused on the behavior. of your application as a whole, ensure that they are easy to both detect and fix. This speed, clarity, focus and quality in your code is why you need to be adopting this process…now.

What is Behavior. Driven Development?
Behavior. Driven Development (which we will now refer to as “BDD”) follows on from the ideas and principles introduced in Test Driven Development. The key points of writing tests before code really apply to BDD as well. The idea is to not only test your code at the granular level with unit tests, but also test your application end to end, using acceptance tests. We will introduce this style. of testing with the use of the Freshen testing framework.

Behavior. Driven Development (BDD) is a subset of Test Driven Development (TDD).

The process can be simply defined as:
1. Write a failing acceptance test
2. Write a failing unit test
3. Make the unit test pass
4. Refactor
5. Make the acceptance test pass

Rinse and repeat for every feature, as is necessary.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/301743/viewspace-741947/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 开源框架评估
请登录后发表评论 登录
全部评论

注册时间:2008-04-23

  • 博文量
    441
  • 访问量
    602351