Week 10 Flashcards

1
Q

What are test doubles?

A

Units that are used to replace parts of the real system for test purposes.

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

What are some examples of test doubles?

A
  • Databases
  • Code that is not ready
  • External Hardware
  • Components that do not return values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some motivations for using test doubles?

A
  • Check that the SUT correctly interacts with the double
  • If we want to recreate specific issues raised by returning specific values
  • If we want to record values recieved by DOC
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does SUT stand for?

A

System Under Test (The part of the system we are testing)

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

What does DOC stand for?

A

Depended-On Component

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

What is a Test Stub?

A

A unit that allows us to insert some logic to respond to calls from SUT.

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

What are the types of test stub?

A
  • Responder (returns correct values)
  • Saboteur (returns incorrect values)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Mock Object?

A

An object that is set up with information about what calls it should expect.

It might also be setup with details of the data it should expect

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

What can mock objects be used to test?

A

The behaviour of the interaction between the SUT and DOC

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

What is Mockito?

A

A mocking framework that can help with testing

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

What does Mockito do?

A

It takes an interface, and can create a replacement version of it

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

What is a test spy?

A

A way that we can implement an observation point that exposes the indirect outputs of the SUT so they can be verified

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

Why would a test spy be used?

A

If a developer needed more complex ways to verify the success of the info passed from SUT to DOC.

e.g checking email contents from a SUT

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

What is a fake object?

A

An object that replaces the functionality of the DOC

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

What is a dummy object?

A

An object that is not actually used in the code being tested, but is needed for the successful completion of it.

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

What is an example of a dummy object?

A

Testing a checkout feature requires a customer object, but that customer can be anything.