Is there a difference between TDD and Test First Development (or Test First Programming)?

前端 未结 8 1537
鱼传尺愫
鱼传尺愫 2021-02-01 00:41

Both ideas sound very similar to me, but there might be subtle differences or the exact same thing, explained in different ways. What is the relationship between TDD and Test Fi

8条回答
  •  Happy的楠姐
    2021-02-01 01:21

    The are a lot of similar terms like test-first programming, test-first development, test-driven development or even test-driven design. It is important to clarify a few points:

    1. Test First Programming (TFP)

    The term test-first programming is a programming best practice. It was reintroduced (if not coined) by Kent Beck in his book “Extreme Programming Explained”: “Write unit tests before programming and keep all of the tests running at all times”. So, when talking about test-first programming we are talking about writing automated unit tests by the very developer that is going to write the code to satisfy those tests. The unit tests pile up and build an automated regression test suite that could be run periodically.

    2. Test Driven Development (TDD)

    Test-driven development (TDD) is the name of a methodology introduced by Kent Beck in his book "Test Driven Development by Example". It is a software development process, it is not only about writing tests before code. The whole book is trying to explain it by patterns, workflows, culture and so forth. One important aspect of it is the emphasis on refactoring.

    Some people use the terms test-first development, test-driven design, or test-driven programming and ... One thing is for sure: the well established methodology is test-driven development and the programming technique is test-first programming. The rest are either generally referring to the idea of writing tests before code or mistakenly referring to test-driven development or test-first programming.

提交回复
热议问题