Design For Testability Flashcards

1
Q

code that is easy to test..

A

is code that is well designed

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

what is testability

A

a non functional requirement

easy to test

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

what is design for testability

A

testability concerns drive the design

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

what are difficulties in design for testability.

A

non deterministic code

hard coded/hidden behaviour

not allowing inheritance/override

complex/slow configurations

breaking the law of demeter

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

what is the law of demeter

A

principle of least knowledge

only limited knowledge about other units:
Only talk to immediate friends.

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

what is a test double

A

version of code object whose behaviour is predictable and controllable

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

describe a dummy

A

passed around but never used

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

describe a stub

A

provide canned answers to calls

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

describe fakes

A

have implementations but take short cuts

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

describe mocks

A

created on the fly

behaviour matches programmed expectations.

fixed return values

can verify behaviour, such as number of calls

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

what is design for testibility

A

allows us to predict behaviour and plan for it from the start. All classes have at least two clients from the start.

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