Matt Can Code  

2017年3月25日

Agenda

  • Benefits
  • Living document
  • Frameworks specflow supports
  • How to integrate it in development cycles
  • Specflow technical features

Benefit -

  1.                 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).
  2.                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. 
  3.                 Ramp up new developer tester quicker by having them understand the test name, test step and related code.

Frameworks specflow supports 

  1.   Unit Test, Integration Test, API and UI test

Specflow technical features

  1.  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);         }

    } }

            

 

posted @ 2017-03-25 19:58 Matt Yeung 阅读(208) 评论(0) 推荐(0)

2013年8月8日

摘要: Load and stress testing are subsets of performance testing. Performance testing means how best something performs under a given benchmark. For example 阅读全文
posted @ 2013-08-08 16:21 Matt Yeung 阅读(199) 评论(0) 推荐(0)

2007年5月11日

摘要: 介绍自定义安全管理框架的 数据结构 目的:1. 对安全管理提供更强大的扩展性和伸缩性。2.提高权限验证算法效率。 以下对传统的安全管理数据结构和安全管理框架的数据结构进行大致比较 传统的数据结构中, 1. 左数第一列为各样安全管理主体, 分别是USER, USERGROUP, ROLE, FUNCT 阅读全文
posted @ 2007-05-11 09:58 Matt Yeung 阅读(494) 评论(1) 推荐(0)

2007年4月30日

摘要: 特点: 在aspx页面中的部件属性注入表达式构造器(expressionBuilder)返回的表达式对象,使部件属性在运行时得到赋值。 表现形式:<asp:Button ID="Button1" runat="server" Text="Try this" Enabled="<%$ Authenti 阅读全文
posted @ 2007-04-30 12:11 Matt Yeung 阅读(937) 评论(10) 推荐(0)

2007年2月12日

摘要: 1.生成临时表,CREATE TABLE #tblPK( PK ' + @type + ' NOT NULL , [Sequence] [int] IDENTITY (1, 1) NOT NULL)INSERT #tblPK (PK)SELECT ' + @PK + ' FROM ' + @Tabl 阅读全文
posted @ 2007-02-12 09:13 Matt Yeung 阅读(636) 评论(0) 推荐(0)

2007年2月8日

摘要: 聚簇索引和非聚簇索引都是为了增加数据检索速度而存在的. 在配置上, 每个表只能有一个聚簇索引,而能有200多个非聚簇索引。 在物理分配上, 每个表的数据都是分配在页上,一个页大概有8k左右,假设一条数据占1000字节的话,那么8000条数据占8000*1k/8k = 1000页面,这些数据存在于数据 阅读全文
posted @ 2007-02-08 14:10 Matt Yeung 阅读(9755) 评论(5) 推荐(1)

2007年2月2日

摘要: MARTIN FOWLER 在 Accountability 分析模式中详细地列举了一个根据需求演变的分析过程在一个企业架构图里, 最简单莫过于公司包含部门,部门包含人这样的结构适合结构改变可能性小,而公司,部门和人三者的行为有很大区别时使用(类型是一种奢侈品) 反过来说,事实上大多数结构还是会有一 阅读全文
posted @ 2007-02-02 15:37 Matt Yeung 阅读(387) 评论(0) 推荐(0)

2007年1月19日

摘要: 组合模式体现了接口对外行为的统一,类的继承,行为的复写, 迭代器体现了数据的封装。 INode接口统一了节点的操作, 客户可取得一个实现了INode的类型的实体进行操作,而无需理会实体的实际类型是什么。而这些操作就由LeafNode和CompositNode具体地实现 Iterator接口定义了迭代 阅读全文
posted @ 2007-01-19 09:03 Matt Yeung 阅读(401) 评论(2) 推荐(0)

2007年1月15日

摘要: 2007 年 OO工程的思想主要体现在服务和接口,IOC的思想是OO的构想的一个方法论, 强调面向对象的项目特性(面向接口以及面向组件)的管理方式.并能在部署和运行时调配实现功能. IOC实现上在运行时才把彼此依赖的实现组织并串联(WIRE UP)起来强调程序设计中的面向接口设计的概念. 要求程序员 阅读全文
posted @ 2007-01-15 16:53 Matt Yeung 阅读(429) 评论(0) 推荐(0)
 
摘要: 1. 概念建摸的目的概念建摸的目的就是找出最能客观表示需求的概念结构,利用好它,能更有效地与领域专家进行需求确认;也因为OO的良好概念特性,让程序实现人更好地理解领域结构,为之后的设计过程做准备,并最好地适应将来的需求更改或扩展. 几乎软件工程所有阶段,概念建摸的和用例建摸都可能迭代更新,齐头并进, 阅读全文
posted @ 2007-01-15 14:22 Matt Yeung 阅读(525) 评论(1) 推荐(0)
 
点击右上角即可分享
微信分享提示