written 5.3 years ago by |
Since every team member in ASD intends to deliver a high-quality product, the agile tester does not wait for work but contributes throughout the development cycle. Contrary to traditional testing, unit test cases are written prior to the code writing, that is, these test cases are not in accordance with a formal requirement specification document. This is known as test driven development (TDD). Since Agile is iterative and incremental, the testers test each increment as soon as it is finished. Development and testing is done on a small feature so that we have a working code.
Test Driven Development
The idea of TDD is to write a production code (well-written code) along with testers which is passed through several rapid iterations. In TDD, each new feature begins with writing a test. This test must initially fail because it is written before the feature has been implemented. (If it does not fail, then either the proposed 'new' feature already exists or the test is defective.) To write a test, the developer must clearly understand the feature's specification and requirements. The developer can accomplish this through user stories that cover the requirements and exception conditions. This could also imply a variant or modification of an existing test. This is a differentiating feature of test-driven development versus writing unit tests after the code is written: it makes the developer focus on the requirement before writing the code, a subtle but important difference.
These unit test cases are then run to ensure they fail. The next step is to write the code that will cause the test to pass. The new code written at this stage will not be perfect and may, for example, pass the test in an inelegant way. That is acceptable because later steps will improve and hone it.
If all the test cases now pass, the developer can be confident that the code meets all the tested requirements.