Test Driven Development Flashcards
What are the two main types of software testing?
Manual tests and Automated tests.
What is automated testing?
Automated testing is the use of software tools such as executables and scripts to automatically execute and verify the steps and results of test scenarios.
Why is automated testing beneficial?
Automated testing reduces the error-prone nature of repeatedly performing manual tests, prevents steps from being forgotten or test cases from being skipped, and allows tests to be scheduled automatically.
Name three types of tests that can be automated.
Accessibility testing, Acceptance testing, and Black box testing. (Other acceptable answers include End to End testing, Functional testing, Integration testing, Load testing, Non-functional testing, Performance testing, Regression testing, Sanity testing, Security testing, Smoke testing, Stress testing, Unit testing, and White-box testing.)
What are the three levels of tests based on software layers?
- UI/GUI tests (End to End Tests) 2. Service tests (Integration Tests) 3. Unit tests (Developer tests).
What does the testing pyramid illustrate?
The testing pyramid illustrates that there should be more unit tests than service tests, and more service tests than UI tests, as unit tests run quickly while UI tests are the slowest.
What does TDD stand for?
Test Driven Development
What is the main principle of TDD?
In TDD, tests are specified before any code is written.
What are the two main rules of TDD?
Always write a failing automated test before writing any code and always remove duplication.
Describe the rhythm of TDD.
Quickly add a test, run all tests and see the new one fail, make a little change, run all tests and see them all succeed, refactor to remove duplication.
What are the steps in the TDD cycle according to Kent Beck?
Write a test, make it compile, make it run, and remove duplication.
What are the phases of the TDD mantra?
Red, Green, Refactor.
What happens in the ‘Red’ phase of the TDD mantra?
The code does not compile, or there are failing tests. In this phase, it is not allowed to refactor. The goal is to eliminate compile errors and write code to make the tests pass.
What happens in the ‘Green’ phase of the TDD mantra?
All tests pass. In this phase, it is allowed to refactor.
What happens in the ‘Refactor’ phase of the TDD mantra?
The code structure is improved for better readability and maintainability