Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved so that the tests pass.
- Add minimal set of tests for a (new) feature
- Run all tests. The new test is expected to fail
- Write the code for the feature
- Run all tests again
- Refactor code (kind of optionnal but way better)
- Repeat
- Makes the developer focus on the requirements before writing the code
- Constant refactoring = cleaner code
- Needs well defined requirements
- Can make you waste time if you refactor too much
For simplicity's sake, our server will be as simple as it could be. You can list the pizzas and place an order assuming that we have infinite pizzas (Yummy).
Endpoints:
This endpoint has been already coded and tested.
This endpoint should list all the different kind of pizzas available with their list of ingredients, caracteristics (veggie, vegan, ...) and price.
This endpoint should receive a list of pizzas and return a order number.
This endpoint should return the order number, the list of pizzas and the price of the previous order matching the given number.