Master
ThoughtWorks
菜单
关闭
  • 产品及服务
    • 概况
    • "客户体验、产品及设计业务线 "
    • 数据战略、工程及分析业务线
    • 数字化转型及运营业务线
    • 现代化企业、平台及云业务线
  • 合作伙伴
    • 概况
    • 汽车企业
    • 医疗企业
    • 公共服务机构
    • 清洁技术,能源与公用事业
    • 媒体和出版业
    • 零售业和电商
    • 金融和保险企业
    • 非盈利性组织
    • 旅游业和运输业
  • 洞见
    • 概况
    • 特色

      • 技术

        深入探索企业技术与卓越工程管理

      • 商业

        及时了解数字领导者的最新业务和行业见解

      • 文化

        分享职业发展心得,以及我们对社会公正和包容性的见解

    • 数字出版物和工具

      • 技术雷达

        对前沿技术提供意见和指引

      • 视野

        服务数字读者的出版物

      • 数字化流畅度模型

        可以将应对不确定性所需的数字能力进行优先级划分的模型

      • 解码器

        业务主管的A-Z技术指南

    • 所有洞见

      • 文章

        助力商业的专业洞见

      • 博客

        ThoughtWorks 全球员工的洞见及观点

      • 书籍

        浏览更多我们的书籍

      • 播客

        分析商业和技术最新趋势的精彩对话

  • 加入我们
    • 概况
    • 申请流程

      面试准备

    • 毕业生和变换职业者

      正确开启技术生涯

    • 搜索工作

      在您所在的区域寻找正在招聘的岗位

    • 保持联系

      订阅我们的月度新闻简报

  • 关于我们
    • 概况
    • 我们的宗旨
    • 奖项与荣誉
    • 多元与包容
    • 领导层
    • 合作伙伴
    • 辅助功能
    • 新闻
  • 联系我们
China | 中文
  • United States United States
    English
  • China China
    中文 | English
  • India India
    English
  • Canada Canada
    English
  • Singapore Singapore
    English
  • United Kingdom United Kingdom
    English
  • Australia Australia
    English
  • Germany Germany
    English | Deutsch
  • Brazil Brazil
    English | Português
  • Spain Spain
    English | Español
  • Global Global
    English
博客
选择主题
查看所有话题关闭
技术 
敏捷项目管理 云 持续交付 数据科学与工程 捍卫网络自由 演进式架构 体验设计 物联网 语言、工具与框架 遗留资产现代化 Machine Learning & Artificial Intelligence 微服务 平台 安全 软件测试 技术策略 
商业 
金融服务 全球医疗 创新 零售行业 转型 
招聘 
职业心得 多元与融合 社会改变 
博客

话题

选择主题
  • 技术
    技术
  • 技术 概观
  • 敏捷项目管理
  • 云
  • 持续交付
  • 数据科学与工程
  • 捍卫网络自由
  • 演进式架构
  • 体验设计
  • 物联网
  • 语言、工具与框架
  • 遗留资产现代化
  • Machine Learning & Artificial Intelligence
  • 微服务
  • 平台
  • 安全
  • 软件测试
  • 技术策略
  • 商业
    商业
  • 商业 概观
  • 金融服务
  • 全球医疗
  • 创新
  • 零售行业
  • 转型
  • 招聘
    招聘
  • 招聘 概观
  • 职业心得
  • 多元与融合
  • 社会改变
软件测试技术

The Evolution of TDD

Fabio Pereira Fabio Pereira

Published: Jun 21, 2015

Last week I had the privilege of interviewing Nat Pryce about the past, present and future of TDD, BDD, Mocking, GOOS, tools and practices. Nat and I agree that TDD is not dead - it's evolving, hence the hashtag #TDDIsEvolving.

The Evolution of TDD

Here's the full interview:

On TDD and Design

The conversation started with concepts around design. Nat mentioned that "TDD is not just about unit testing it is the mental process of thinking how I am going to show that it's working to myself and to other people" and completed by saying:

Writing tests forces me to think what I want to achieve

On BDD

Nat began this topic with the issue that "BDD is getting confused with some of the tooling. I don't find all of the tooling very useful, but I find the collaborative process useful - you don't have to use cucumber or any other tool to do it." He mentioned he's spent a lot of time refactoring Java code to make it readable, which reminded me of a project where we've created a Java Code DSL to express test behaviour.

BDD is getting confused with some of the tooling

On Mocks and 'Is TDD Dead'

As we mentioned before, Nat does not think TDD Is Dead, instead, he believes it's evolving. We spoke about some of the problems raised during the debate being related to the misuse of Mocks. When mocking sometimes "people overdo the isolations" - "A mock returning a mock, you think - stop!". "A class can be composed of other objects that don't have to be exposed and don't necessarily have to be mocked."

A mock returning a mock, you think - stop!

On Microservices and APIs

The highlight of the discussion around Microservices and APIs was clearly Consumer-Driven Contracts - "Being able to write a test for somebody else's service and have your test become part of their continuous integration is quite a change and it's been really useful in my experience".

Here are a couple of his recommendations in this area:

  • Have each team (consumer) write the tests the way that they want and have them published
  • Same idea of having conversations between "stakeholders", in this case, the consumers are the stakeholders

Some examples of tools for this type of test:

  • Pact & Pacto
  • JSON Schema with plain JUnit
When building APIs, developers are your customer - find out what they want

On the Evolution of Roles

I asked what he thought about the fact that "We've moved from a world where developers wouldn't write tests to a place where it's a reality that developers take responsibility and accountability for the tests". Unfortunately he pointed out that "It's still not the reality everywhere".

We've touched on the point of having a separation between developers and the test automation teams and here's what he said: "I've never seen testing teams in another building or another country work well. If a test is not easy to write, change the design. This feedback loop is hard if people who write production code and automated tests are not close to each other."

I've never seen testing teams in another building or another country work well

On The Future - What's next?

One of the trends mentioned by Nat is Property based testing, which, according to him, is "where your test is structured as a predicate that defines a property of some aspect of your system and the test framework generates random inputs", he also mentioned that this is a "great way to find unknown unknowns". I wrapped up by saying that it "sounds like bringing some exploratory intelligence to automated testing". Nat finished by saying that "it's fun to play with".

According to him, the trends are mainly around Consumer-Driven Contracts, Property based testing and Monitor-Driven Development.

I'm becoming property test infected

I want to thank Nat Pryce for the interview and also want to thank some key people without whom this would not have been possible - Britt Klontz, Heather Malec and Kaifeng Zhang.

If you have any questions, feel free to keep the #TDDIsEvolving twitter hashtag discussion going on.

This post was designed and produced by Kaifeng Zhang

Master
政策声明 | 现代奴役声明 | 辅助功能
Connect with us
×

WeChat

QR code to ThoughtWorks China WeChat subscription account
© 2021 ThoughtWorks, Inc.