行为测试驱动(BDD)框架 Machine.Specifications

码农软件 · 软件分类 · 单元测试工具 · 2019-11-18 23:14:00

软件介绍

Machine.Specifications简称 MSpec ,是一个行为测试驱动(BDD)框架,它本身并不是测试框架,而是在nUnit的基础上,作了一层友好性的封装。

行为驱动开发(Behavior-Driven Development)是领域驱动设计开发(Domain Driven Design)在测试领域的应用,剔出代码噪音。 因此,MSpec封装nUnit之后的重点就在于,体现测试本身的业务概念: 系统或者模块在某种特定环境(Context)下的行为/功能(Specifications),而不是某个类或某个方法是如何实现的。

这种基于上下文/功能描述(Context/Specification)的概念,可以与用户故事很好的整合,从而,跨越代码与需求流程之间的鸿沟。

注意,BDD本质上仍然是测试驱动.

几个特点:

  1. 提供插件支持Resharper和TestDriven.Net运行它的测试, 并能输出非常优美的Html的测试报告。
  2. 使用Delegate的方式写测试代码,需要习惯 =()=>的方式。
  3. 测试用例在类级别,而不是方法级别。就是说,一个类是一个测试,而不是一个方法。 好处,测试环境可以继承,大幅减少重复代码,使得测试的组织结构更简洁和合理。
  4. 用Extension封装断言语法,使得测试断言更具阅读性,接近自然语言。如 result.ShouldEqual("TestResult")

本文地址:https://codercto.com/soft/d/19297.html

Data Structures and Algorithms in Java

Data Structures and Algorithms in Java

Michael T. Goodrich、Roberto Tamassia / Wiley / 2010-01-26 / USD 177.41

* This newest edition examines fundamental data structures by following a consistent object-oriented framework that builds intuition and analysis skills of data structures and algorithms * Presents ne......一起来看看 《Data Structures and Algorithms in Java》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具