Test Driven Development Flashcards

1
Q

What are the two main types of software testing?

A

Manual tests and Automated tests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is automated testing?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why is automated testing beneficial?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name three types of tests that can be automated.

A

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.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the three levels of tests based on software layers?

A
  1. UI/GUI tests (End to End Tests) 2. Service tests (Integration Tests) 3. Unit tests (Developer tests).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the testing pyramid illustrate?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does TDD stand for?

A

Test Driven Development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the main principle of TDD?

A

In TDD, tests are specified before any code is written.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the two main rules of TDD?

A

Always write a failing automated test before writing any code and always remove duplication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the rhythm of TDD.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the steps in the TDD cycle according to Kent Beck?

A

Write a test, make it compile, make it run, and remove duplication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the phases of the TDD mantra?

A

Red, Green, Refactor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What happens in the ‘Red’ phase of the TDD mantra?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What happens in the ‘Green’ phase of the TDD mantra?

A

All tests pass. In this phase, it is allowed to refactor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens in the ‘Refactor’ phase of the TDD mantra?

A

The code structure is improved for better readability and maintainability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly