Core Java 8: TDD Flashcards

(9 cards)

1
Q

Unit

A

the smallest testable piece of code

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

TDD

A

Test-Driven Development: a way of developing code which begins with a test, and then writing the minimum amount of code to fulfill that test. Each test should bring you closer and closer to the overall goal

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

Why do we use TDD?

A

Reduces waste, you only write bare minimum code necessary; makes it easier to plan, forced to plan what code should do rather than writing it as it comes. You create less error prone code on average

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

Unit testing

A

verifying all of smallest testable pieces of code (units) are working in isolation

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

What does the assert statement do?

A

sets criteria for whether test passes

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

Mockito

A

testing framework used to create mock objects

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

Why do we use Mockito?

A

test classes with dependencies in isolation

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

What is a mock object?

A

a fake version of an object whose behavior can be precisely controlled

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

What is verify?

A

state-based testing vs behavioral testing; verify is used to make sure your class is interacting correctly with its dependencies; you can only verify on mock objects

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