{"id":27545,"date":"2019-08-19T15:09:09","date_gmt":"2019-08-19T19:09:09","guid":{"rendered":"https:\/\/centricconsulting.com\/?p=27545"},"modified":"2022-03-06T17:13:31","modified_gmt":"2022-03-06T22:13:31","slug":"accelerate-testing-with-behavior-driving-deployment","status":"publish","type":"post","link":"https:\/\/centricconsulting.com\/blog\/accelerate-testing-with-behavior-driving-deployment\/","title":{"rendered":"Accelerate Testing with Behavior Driven Development"},"content":{"rendered":"

BDD provides a framework for full-system testing in a CI and CD pipeline as part of a team\u2019s agile processes using three primary principles.<\/h2>\n
\n

Automated integration tests are an essential part of achieving Continuous Integration and Continuous Delivery<\/a> as part of agile<\/a> development.<\/p>\n

We use Behavior Driven Development (BDD) to provide a set of integration tests written from the perspective of the business. This article details the fundamental principles we use with BDD.<\/p>\n

What is Behavior Driven Development (BDD)?<\/h2>\n

Software development teams employed many different testing strategies, including unit tests, integration tests, and automated tests. Test-Driven Development<\/a> (TDD) is a well-known methodology that involves writing unit tests first, then implementing the method, class, or module until the tests pass.<\/strong> This methodology allows the developers to minimize over-engineering the codebase. They accomplish this by implementing only enough code to meet the requirements while continuously improving the structure of the code. Unfortunately, TDD tests do not test the overall system from a user\u2019s perspective. Teams address this issue by introducing higher-level testing in the form of Acceptance Test-Driven Development (ATDD), which is specifically set up to test the user\u2019s requirements. Behavior Driven Development is a specific type of ATDD that uses Given\/When\/Then syntax.<\/p>\n

BDD in Practice<\/h2>\n

Below is an example of a BDD test for a car-rental company. This test shows the usage of a Background block executed before each of the Scenario blocks. In this example, we showcase a single scenario. The \u201cWhen\u201d block in the scenario section creates a rental agreement for the customer and equipment combination as specified in the background section. The \u201cThen\u201d block in the scenario section verifies the default rates configure on the rental agreement.<\/p>\n

\"BDD<\/a><\/p>\n

The main principles we followed as part of our team\u2019s BDD implementations include:<\/strong><\/p>\n