Test Driven Development
Here is a quiz about “Test Driven Development”.
At the end of the quiz, you’ll be see your results, and replay false answer to discover the good one.
Warning
If your score is below average, call SED immediately ! 😆. Seriously, please come and talk with us to avoid doing major mistakes.
The button provides some help !
---
primary_color: steelblue
---
# Why writing tests
Select good reasons for writing tests.
- [x] To avoid regression bugs
- [x] To validate the behaviour of the code
- [ ] To spend time
- [ ] to make some fuzzing
> Fuzzing is a way to crack a code by strange behavior
- [ ] to make some DoS
> 2 good answers to win :wink:
## TDD Loop
Put the TDD steps in order
1. Write a test
2. Write easiest production code related to the test
3. Check test succeed
4. Refactor by cleaning up test and production code
5. Write another test
## Good Test
Select answers : A good test must be...
- [x] Readable
- [x] Maintainable
- [ ] Long
- [ ] Definitely written in the same language than the code
> 2 good answers to win :wink:
## TDD Principles
Select TDD principles in this list
- [x] Single Responsibility Principle
- [ ] You aren't Gonna Need It
- [ ] Keep It Simple (Stupid)
- [ ] Don’t Repeat Yourself
- [x] Test Your Code
> 2 good answers to win :wink:
## Unit test
What is a unit test ?
1. [x] A single test to check only one functionnality
1. [ ] A test for booleans
1. [ ] A set of tests for a complete software
1. [ ] A user interface test
## False about TDD
Select **false** sentences in this list:
- [x] A test check the whole system behavior
- [ ] Tests can provide exemples of how using the code
- [x] Tests are a complete representation of the specification
- [x] Tests are formal proofs
- [ ] Tests are code
> 3 good answers to win :wink:
## Truth about TDD
Select **true** sentences in this list:
- [x] A test can be based on the result of a computation
- [x] A test can be based on the state of an object
- [x] A test can be based on interactions between the system and the outside world
- [ ] A test cannot be executed in an automated way
> 3 good answers to win :wink:
## Useful concepts
Select the following concepts that are useful for writing tests :
- [x] Helpers fonctions
- [x] Fixtures in Python
- [x] Stubs, mocks and fakes
- [ ] Aspect Oriented Programming
- [ ] Annotations
> 3 good answers to win :wink:
## Predefined data
Select test objects which contains predefined data :
- [x] Stub
- [ ] Proxy
- [ ] Singleton
- [x] Fake
- [ ] Observer
- [ ] Subject
- [x] Mock
> 3 good answers to win :wink:
## Registry
Select test objects which registers any call they receives :
- [ ] Stub
- [x] Proxy
- [ ] Singleton
- [ ] Fake
- [x] Observer
- [ ] Subject
- [ ] Mock
> 2 good answers to win :wink:
The quiz only runs in your browser. Even if your score is bad ! 😉
No personnal datas about you or your score are kept. Only an anonymous ratio is store to help us to build future tutorials.