Agile Testing – Methods

In Agile Testing, the commonly used Testing methods are from the traditional practices and are aligned to the principle – Test Early. The Test Cases are written before the code is written. The emphasis is on defect prevention, detection, and removal running the right test types at the right time and at the right level.

In this chapter, you will get an understanding of the methods βˆ’

  • Test Driven Development (TDD)
  • Acceptance Test Driven Development (ATDD)
  • Behavior Driven Development (BDD)

Test Driven Development

In the Test Driven Development (TDD) method, the code is developed based on the Testfirst approach directed by Automated Test Cases. A test case is written first to fail, code is developed based on that to ensure that the test passes. Method is repeated, refactoring is done through the development of code.

TDD can be understood with the help of the following steps βˆ’

  • Step 1 βˆ’ Write a Test case to reflect the expected behavior of the functionality of the code that needs to be written.
  • Step 2 βˆ’ Run the test. The test fails as the code is still not developed.
  • Step 3 βˆ’ Develop code based on the test case.
  • Step 4 βˆ’ Run the test again. This time, the test has to pass as the functionality is coded. Repeat Step (3) and Step (4) till the test passes.
  • Step 5 βˆ’ Refactor the code.
  • Step 6 βˆ’ Run the test again to ensure it passes.

Repeat Step 1 – Step 6 adding test cases to add functionality. The added tests and the earlier tests are run every time to ensure the code is running as expected. To make this process fast, tests are automated.

The tests can be at unit, integration or system level. Constant communication between testers and developers needs to be ensured.

Acceptance Test Driven Development

In the Acceptance Test Driven Development (ATDD) method, the code is developed based on the test-first approach directed by Acceptance Test Cases. The focus is on the acceptance criteria and the Acceptance Test Cases written by the testers during User Story Creation in collaboration with the customer, end users and relevant stakeholders.

  • Step1Β βˆ’ Write Acceptance Test Cases along with user stories in collaboration with the customer and users.
  • Step2Β βˆ’ Define the associated acceptance criteria.
  • Step3Β βˆ’ Develop code based on the acceptance tests and acceptance criteria.
  • Step4Β βˆ’ Run the acceptance tests to ensure that the code is running as expected.
  • Step5Β βˆ’ Automate the acceptance tests. RepeatΒ Step 3 – Step 5Β until all the user stories in the iteration are implemented.
  • Step 6Β βˆ’ Automate the regression tests.
  • Step 7Β βˆ’ Run the automated Regression Tests to ensure Continuous Regression.

Behavior Driven Development (BDD)

Behavior Driven Development (BDD) is similar to the Test-Driven Development (TDD), and the focus is on testing the code to ensure the expected behavior of the system.

In BDD, language like English is used so that it makes sense to the users, testers, and developers. It ensures βˆ’

  • Continuous communication among the users, testers and developers.
  • Transparency on what is being developed and tested.

Leave a Reply