Acceptance Test - Business Readable Acceptance Test using - Specflow
Agenda
- Benefits
- Living document
- Frameworks specflow supports
- How to integrate it in development cycles
- Specflow technical features
Benefit -
- Provide business readable test cases that can be executed and confirm by product to build confidence that development implemented exactly what business needed(build the right stuffs and built it right).
- Giving up using the documenting test cases like traditional plain text that become stale after times, write it in Specflow framework can be well organized and update in time and versioning together with production code.
- Ramp up new developer tester quicker by having them understand the test name, test step and related code.
Frameworks specflow supports
- Unit Test, Integration Test, API and UI test
Specflow technical features
- Feature file Structure
tags can be at feature level or scenario level to indicate special attributes, using symbol @
Header - Provide the feature name (Pretty much like a user story caption)
Scenrio 1 - Provide the scenario
comment can be added at anywhere start with # to add remark
Step 1 - Logical step (Using Given, When, Then, And / But is key word that help improve the readibility)
All are in business language
2. Map the feature file to csharp class and method code
using attributes [given] to map the code back to steps
download specflow extension(generate mapping c# code, Tools->Extension and Updates->Search Specflow Visual Studio Extension), nuget packages(framework that glue the feature with IDE Xunit.Runner.VisualStudio ), nuget test frameworks(Specflow.Xunit nuget)
3. Use scenario outline to organize parameterized inputs and outputs
Scenario Outline: Add numbers
Given I have a new calculator start with <current>
When I have entered <add> into the calculator
Then the result should be <result> on the screen
Examples:
| current | add | result |
| 100 | 20 | 120 |
| 200 | 30 | 230 |
| 234 | 22 | 11 |
namespace POC_LAB_Spec {
[Binding]
public class SpecFlowFeature1Steps
{ Calculator _cal;
[Given(@"I have a new calculator start with (.*)")]
public void GivenIHaveANewCalculatorStartWithCurrent(int current)
{ _cal = new Calculator(); _cal.Current = current; }
[When(@"I have entered (.*) into the calculator")]
public void WhenIHaveEnteredAddIntoTheCalculator(int add) { _cal.Add(add); }
[Then(@"the result should be (.*) on the screen")]
public void ThenTheResultShouldBeResultOnTheScreen(int result) { Assert.True(result == _cal.Current); }
} }
Acceptance Test - Business Readable Acceptance Test using - Specflow的更多相关文章
- Reading Notes of Acceptance Test Engineering Guide
The Acceptance Test Engineering Guide will provide guidance for technology stakeholders (developers, ...
- BVT & BAT (版本验证测试和版本验收测试)
BVT & BAT 版权声明:本文为博主原创文章,未经博主允许不得转载. 一.BVT: (Build Verification Test ) BVT的概念: BVT(版本验证测试)是在所有开发 ...
- USER STORIES AND USE CASES - DON’T USE BOTH
We’re in Orlando for a working session as part of the Core Team building BABOK V3 and over dinner th ...
- software quality assurance 常见问题收录
1. What is Quality? Quality means, “meeting requirements.” ..Whether or not the product or service d ...
- Software development process
一.Development process 1.Business/User Requirement 2.Architecture Proposal,Solution Proposal 3.Functi ...
- pybot/robot命令参数说明
Robot Framework -- A generic test automation framework Version: 3.0 (Python 3.4.0 on win32) Usage: r ...
- 携程apollo系列-客户端集成
本文讲解如何在 Java 程序中集成 Apollo 配置, 主要涉及到一些基础用法. 对于一些高级用法, 比如如何加密/解密配置项 (可用于数据库密码配置), 如何动态切换数据源地址,如何动态切换日志 ...
- BizDevOps — the true value proposition of workflow engines
转自:https://blog.bernd-ruecker.com/bizdevops-the-true-value-proposition-of-workflow-engines-f342509ba ...
- pybot/robot命令参数说明【dos下执行命令pybot.bat --help查看】
Robot Framework -- A generic test automation framework Version: 3.0 (Python 3.4.0 on win32) Usage: r ...
随机推荐
- [Android]Linux下WebRTC下载与编译
1.硬盘空间: WebRTC官方原话: The checkout size is large due the use of the Chromium build toolchain and many ...
- Linux修改用户所在组方法
Linux修改用户所在组方法 usermod -g 用户组 用户名强行设置某个用户所在组usermod -G 用户组 用户名把某个用户改为 group(s) usermod -a -G 用户组 用户名 ...
- css样式基础详解
一.字体属性:(font) 1.大小 {font-size: x-large;}(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX.PD 2.样式 {font-styl ...
- UVa514 Rails (栈)
题意:一列有n节车厢的火车按顺序进站,给你一个出站顺序,问你该火车的车厢能否以该顺序出站? 分析:出站的车厢满足后进先出的关系,所以我们考虑采用栈s 假设车厢一共有n节,n = 5: 进站顺序A:1 ...
- Django中的视图(view)
视图 1.什么是视图 视图就是Django项目下的view.py文件,它的内部是一系列的函数或者是类,用来专门处理客户端访问请求后处理请求并且返回相应的数据,相当于一个中央情报处理系统 2.具体视图实 ...
- MongoDB主从复制和副本集
MongoDB有主从复制和副本集两种主从复制模式,主从复制最大的问题就是无法自动故障转移,MongoDB副本集解决了主从模式无法自动故障转义的特点,因此是复制的首选.对于简单的主从复制无法自动故障转移 ...
- STM32F401 外部中断误触发问题
现象:调试STM32F411低功耗的时候,使用的PA1做个唤醒源,发现在没有触发EXTI的时候,MCU居然被唤醒. 原因:PA1配置成EXTI(上拉输入),经常被误触发 解决方式:将PA1配置成浮空输 ...
- python入门(十五):装饰器
1.装饰器(decorator):设计模式 作用:给不同的函数和方法,增加不同的公用的功能. @classmethod,@staticmethod等均是装饰器 定义一个装饰函数,函数必须返回一个闭包函 ...
- java中常规使用的mysql语句
1.登录型校验 limit 1,例如: SELECT `password`FROM workerWHERE phone = 18611406603LIMIT 1 结果无值,不需验证;有值,校验 2.存 ...
- docker挂载目录的深入研究
转载一篇很好的文章: https://www.cnblogs.com/ivictor/p/4834864.html