Testing Doubles Flashcards

1
Q

Testing doubles

A

Objects in unit testing for verifying data or interactions without dependencies

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

Spies

A

Records/monitors values and functionality. Spies don’t change the behaviour but verified wether the method has been called/interactions been called

Similar to mock

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

Mocks

A

Records/monitors values and functionality. Mocks has expectations on the outcome and fails if the methods outcome don’t match the test pre programmer results

Similar to spies

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

Dummy

A

Placeholder object being passed through. The value doesn’t matter, it’s if the function is being run that’s important

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

Fake

A

Less complex objects used instead of labor intensive objects such as databases or external API:s

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

Stub

A

Hard coded values and responses to remove complex logic such as dependencies so that the test solely focused on the logic being tested

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