How should I test my code?

There are different kinds of tests that we can perform on a piece of software, such as security tests, performances test, and so on. As developers, we will focus on the tests we can automate and that will help improve our code.

The tests fall under two categories: unit tests and acceptance tests. The test pyramid (http://martinfowler.com/bliki/TestPyramid.html) shows in what proportions these tests should be written:

How should I test my code?

At the bottom of the pyramid, you have the unit tests (fast to launch and relatively easy to maintain), and at the top, UI tests (costlier and slower to execute). Integration tests sit in the middle: they can be viewed as big unit tests with complex interactions between units.

The idea of the pyramid is to remind you to put your focus where you have the most impact and get the best feedback loops.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.195.225