Design for Testability Flashcards

1
Q

Is testability a functional requirement?

A

Nope, it’s just easier to test code like that

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

What stops code from being testable?

A
  • non-deterministic code
  • hard/coding hiding behaviour
  • overriding
  • complex/slow configuration requirements
  • Breaking the law of Demeter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a test double?

A

A version of a production code object whose behaviour is predictable/controllable in a way that helps us write the test

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

Type of test double?

A

Dummies: -passed around, never used, fill PARAMETER lists
Stubs:provide canned ANSWERS to calls made during the test
Fakes: working implementation but with shortcuts
Mocks:
Mock objects that mimic the behaviour of real objects in controlled ways (don’t worry about dependencies)

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