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.