{"id":94,"date":"2019-07-08T14:39:25","date_gmt":"2019-07-08T14:39:25","guid":{"rendered":"https:\/\/www.bddtesting.com\/?page_id=94"},"modified":"2019-07-08T14:39:25","modified_gmt":"2019-07-08T14:39:25","slug":"how-and-why-to-adopt-bdd-in-software-development","status":"publish","type":"page","link":"https:\/\/www.bddtesting.com\/how-and-why-to-adopt-bdd-in-software-development\/","title":{"rendered":"How and Why to Adopt BDD in Software Development"},"content":{"rendered":"\n
Over the past several years, many organizations have transitioned to agile development<\/strong> in order to accelerate delivery and get more timely feedback from the market. In these organizations, while development begins to move faster, QA will struggle to keep pace unless they integrate automated software testing practices into the development pipeline, so that is often the first bottleneck to overcome.<\/p>\n\n\n\n But after successful adoption of test automation and the whole organization moving more quickly, organizations start to ask themselves if they are building the right<\/em> software. Accelerating software development and ensuring software quality with automated continuous testing is a great achievement, but it\u2019s all for naught if the software isn\u2019t what your customers want or need.<\/p>\n\n\n\n Folks at this stage in their software development processes evolution are taking a close look at BDD as a means of ensuring that their software meets their organization\u2019s business requirements. But what exactly is BDD and how does it pertain to testing?<\/p>\n\n\n\n BDD is an evolution of the test-driven development (TDD) methodology<\/a>, in which developers write the test before<\/em>writing the code. After crafting a failing test to start, developers practicing TDD write just enough code to ensure that the test passes, then write another test; rinse and repeat. The result is lean and mean code with high test coverage. <\/p>\n\n\n\n TDD is an activity designed to improve software quality and ensure code coverage. BDD, in contrast, solves the problem of correctly implementing requirements. Rather than focusing on the test<\/em> to verify the functionality<\/em> you want implement, BDD is about defining the behavior<\/em> of the application so that it meets specific business requirements<\/em>.<\/p>\n\n\n\n The similarity between TDD and BDD is that a contractual mechanism is implemented before any work is done, to ensure that the output matches a specific expectation.<\/strong> But this is where the similarity ends. In TDD, the test is a contract intended to ensure that the application meets a specific functional requirement. In BDD, the behavior is the contract intended to ensure that the application meets a specific business requirement.<\/p>\n\n\n\n We\u2019ve been casually throwing around the term \u201cbehavior,\u201d but it does have a technical meaning in the context of BDD. In BDD, behaviors<\/em> are carefully-crafted, human-readable statements that follow a specific format. They are collected in \u201cfeature files\u201d that can be integrated into the development process.<\/p>\n\n\n\n Feature files are typically written in Gherkin, which is a BDD-specific syntax that enables BDD tools, such as Cucumber and SpecFlow, to automate the process of validating the behaviors. These BDD tools parse the behaviors in the feature file and execute the appropriate \u201cglue code.\u201d This glue code maps \u201cbehaviors\u201d to execution steps, typically Java or .NET test code written by a developer, in a specific test engine. These mappings are commonly referred to a \u2018step definitions,\u2019 or \u2018step-defs.\u2019 As a result, testers can use feature files as test cases that verify the behaviors associated with the requirements. <\/p>\n\n\n\n There are several advantages that Business-Driven Development brings to software development. With BDD, you can:<\/p>\n\n\n\n This last point is one of the key features of BDD. Modular, reusable test steps enable testers to rely on the BDD tool to do the heavy lifting when verifying and validating the requirements. The sticking point, however, is that developers are still required to write the glue code that binds the behaviors to the requirements. We\u2019ll talk more about this next. <\/p>\n\n\n\n The biggest cost associated with implementing BDD is writing the glue code. In most cases, this task falls on the development team, which shifts the burden of creating the test artifacts for validating the requirements from testers to developers. <\/p>\n\n\n\n In a pre-BDD world, testers would use tools and frameworks to create tests that validate the functionality, not necessarily the requirements. With BDD, testers, business analysts, and other stakeholders define behaviors in a feature file, but developers or people with code-writing skills are still required to write the glue code that maps the behaviors to the functionality. <\/p>\n\n\n\n The fact that BDD adds to the cost of development can hurt organizations with limited development resources. Although the glue code is intended to be reusable and easier to leverage for test automation, the investment required to scale and implement BDD across the entire enterprise is often too high.<\/p>\n\n\n\n Parasoft enables non-developers to write step-defs that execute as SOAtest tests, which greatly reduces the technical resources required to write tests. With the Parasoft SOAtest-Cucumber Executor, each step definition maps to a reusable SOAtest test or test suite that runs when that step is executed.<\/p>\n\n\n\n Consider the following examples:<\/p>\n\n\n\n Step definitions can also reference an individual SOAtest test or a test suite that contains a number of tests within.<\/p>\n\n\n\n Parasoft puts more control in the hands of testers and gives them confidence that they\u2019ve completely covered the functionality under test. Leveraging a mature, feature-packed, end-to-end testing solution<\/a> provides easy entry into test automation, test maintenance, and a natural integration into existing CI\/CD workflows. At a high level, it enables organizations to leverage less technical resources to implement BDD, freeing up development resources, changing the creation area as illustrated below:<\/p>\n\n\n\n BDD is a powerful development practice that can ensure that the correct \u202ffunctionality \u202fis being built. Scaling BDD to the enterprise level, however, can be difficult because implementing the practice requires a large pool of technical resources. Parasoft lowers the technical barrier by enabling users to map behavior statements to step execution definitions using a much simpler syntax than Java, .NET, or other programming languages. The step definitions are executed as SOAtest<\/a> tests, making it much easier for testers and non-technical staff contribute to the verification process. <\/p>\n\n\n\n https:\/\/blog.parasoft.com\/how-and-why-to-adopt-bdd-in-software-development<\/a><\/p>\n","protected":false},"excerpt":{"rendered":" Behavior-driven development (BDD) addresses the problem of implementing poorly defined requirements by leveraging the domain expertise of business and QA professionals to ensure that the development team builds the correct software. Read on to learn more about how to adopt BDD in the enterprise. Over …. Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"class_list":["post-94","page","type-page","status-publish","hentry"],"yoast_head":"\nTDD vs. BDD<\/h4>\n\n\n\n
What is BDD in Software Development?<\/h4>\n\n\n\n
<\/figure>\n\n\n\n
What are the Benefits of BDD?<\/h4>\n\n\n\n
Costs of Implementing BDD in the Enterprise<\/h4>\n\n\n\n
How to reduce the technical burden of BDD<\/h4>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
Conclusion<\/h4>\n\n\n\n