07 Unit Testing Part 2 Flashcards

1
Q

Test-Driven Development (TDD)

A

A software development process where a unit’s test are written before the unit’s implmentation and guide the unit’s development as the tests are executed repeatedly until they are all succeed.

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

Refactoring

A

Process of restructuing existing computer code without changing its external behavior.

Improve nonfunctional attributes of the software.

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

TDD Process Steps

A

Red:
- Write new tests
- Verify failure of new tests and success of existing tests.

Green:
- Write Code to implement, modify, or develop the unit.
- Repeat until the tests pass.

Refactor:
- Refactor the code
- Confirm tests pass.

Repeat

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

Unit Testing

A

A test that invokes a small, testable unit of work in a software system and then checks a single assumption about the resulting output or behavior.

Form of white box testing, focusing on implementation details.

Uses Coverage criteria as the exit criteria.

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

Unit Testing Tools

A

Test Framework
Test Runner
Mocks
Coverage Reporter

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

Test Framework

A

Defines the test writing syntax.

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

Test Runner

A
  • Executes all (or subset) of the system’s unit tests and present,s displays or otherwise output the results.
  • Might also spin up mocks, a virtual environment, or any other resources the test require.
  • Often a basic tesyt runner is built into the test framework.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Mocks

A

Provides a “mock” or simulated implementation of each external dependency or resources required by the methods being tested.

May return random, dummy, or cached data.

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

Coverage Reporter

A

Determines and provides a report on the test coverage metrics.

Might run independently or during each test executed by a test runner.

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