Types of tests
The following are the two main categories of tests that are written by developers:
Unit tests:
These tests are meant to test an individual component and such testing is also known as "component testing". Ideally, each test case is independent of the other. It's written to ensure that the code meets its design and behaves as intended.
Unit tests are usually written before the code is written. When the tests pass, the code is considered to be complete. In case the test fails, it's an indicator of a bug in the code or test itself.
The following are the key points related to unit tests:
Tests only a single component. Does not require other components.
Should be fast.
Integration tests:
Integration testing is a phase in software testing where individual software modules are combined and tested as a collective group. During the integration test, input modules that have already been unit tested are taken as input, grouped into larger aggregates, and the tests defined in the integration test...