Semaine 3 : Untestable code Flashcards

1
Q

Why should I write tests?

A
  • Manual testing is too expensive
  • It is too easy to make mistakes
  • How can I make sure my new code doesn’t break the existing one?
  • It’s the right thing to do
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a test?

A

In other words, a test is just a piece of code that invokes a method and tests its output.

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

Qu’est-ce que le SRP?

A

Le single responsibility principle est qu’une classe doit avoir une seule responsabilité. S’il y’en a plus qu’une, il faut refactor.

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

Quel est le principe de reduce coupling?

A
  • Group dependencies
  • Define better interfaces
  • Rely on mock objects
How well did you know this?
1
Not at all
2
3
4
5
Perfectly