Skip to main content

Behavior-Driven Development (BDD) – An extension of Test-Driven Development (TDD)

Behavior-Driven Development (BDD) is a process or best practice for the development (and testing) of code.
Behavior-driven development is a design and testing practice that is utilized to ensure that the outcomes and the behaviors of products and services are articulated in terms of business value.  It means that we should step aside from the technical aspects of coding, development and testing and consider, in real everyday terms, what the behavior and usage aspects are of the application or product.   We will still require technical skills, insights, automation and more, but when thinking about the defining and development of a product, business and service providers can articulate in PLAIN ENGLISH exactly what they are attempting to achieve.
BDD helps design and development practitioners scope appropriate testing for a variety of test types including:
  • Unit tests: A single piece of code (usually an object or a function) is tested, isolated from other pieces
  • Integration tests: Multiple pieces are tested together, for example testing database access code against a test database
  • Acceptance tests/Functional tests: Automatic testing of the entire application, for example using a tool to automatically launch a browser
For some software developers this means a cultural shift for their approach. Today we must rethink the way we approach the design and testing of products.  Unit testing and acceptance testing criteria need to be stated in full sentences including words describing what should be achieved by the result.  This is similar to what we do when we create a user story in Agile Service Management.  We say things like “As a I need to be able to in order to .   BDD is a best practice to ensure that in the design/development stage of a product or service the service is assured to be tested at a level that will give assurance to the business and the consumer.  Testing will be allocated to ensure that the product is fit for use and fit for purpose.
BDD focuses on:
  • Where to start in the process
  • What to test and what not to test
  • How much to test in one phase
  • What to call the tests
  • How to understand why a test fails
In practice, BDD will require the use of technology to support activities in the process.  The tools, technology and automation for BDD are generally developed for specific uses in BDD projects and are highly specialized in conjunction with Test-Driven Development (TDD).
Test-Driven Development (TDD) is a software development methodology which essentially states that for each unit of software, a software developer must:
  • Define a test set for the unit first
  • Make the tests fail
  • Then implement the unit
  • Finally verify that the implementation of the unit makes the tests succeed
This definition is rather non-specific in that it allows tests in terms of high-level software requirements, low-level technical details or anything in between.
One way of looking at BDD is that it is a continued development of TDD and makes more specific choices than TDD. Therefore, with BDD testing, outcomes and value are business driven.
Learn more about DevOps and Agile

Comments

Popular posts from this blog

Four Service Characteristics

Recently I came across several articles by researchers and experts that laid out definitions and characteristics of services. ITIL provides us with a definition that can help drive the creation of value-laden services: A means of delivering value to customers by facilitating outcomes customers want to achieve without the ownership of specific costs and risks. An area that ITIL is not so clear is in terms of service characteristics. Several researchers and experts put forth that services have four basic characteristics (IHIP): Intangibility—Services are the results of actions not things. They have no physical presence and represent a logical set of elements. One way to think of service is “work done for others.”  Heterogeneity—Also known as “variability”; services are unique items because of the mechanisms used to deliver services, which is people. Because the people element adds variability, the service is variable. This holds true, especially for the value proposition—not eve...

What Is A Service Offering?

The ITIL 4 Best Practice Guidance defines a “Service Offering” as a description of one or more services designed to address the needs of a target customer or group.   As a service provider, we can’t stop there!   We must know what the contracts of our service offering are and be able to put them into context as required by the customer.     Let’s explore the three elements that comprise a Service Offering. A “Service Offering” may include:     Goods, Access to Resources, and Service Actions 1. Goods – When we think of “Goods” within a service offering these are the items where ownership is transferred to the consumer and the consumer takes responsibility for the future use of these goods.   Example of goods that are being provided in the offering – If this is a hotel service then toiletries or chocolates are yours to take with you.   You the consumer own these and they are yours to take with you.      ...

What is the difference between Process Owner, Process Manager and Process Practitioner?

This article was originally published in 2015. With the Introduction of ITIL 4, some of this best practice has changed. See  ITIL 4 and the Evolving Role of Roles . Updated Definitions in ITIL 4: Process Owner: In ITIL 4, the concept of 'processes' has expanded into broader 'practices.' Consequently, the Process Owner is now often referred to as the 'Practice Owner.' This individual is accountable for the overall design, performance, integration, and improvement of a specific practice within the organization. They ensure that the practice achieves its intended outcomes and aligns with the organization's objectives. Process Manager: Now commonly known as the 'Practice Manager' in ITIL 4, this role is responsible for the day-to-day management of the practice. The Practice Manager ensures that activities are carried out as intended, manages resources assigned to the practice, and oversees the practitioners performing the work. Process Practit...