DEV Community

Nuno Neves
Nuno Neves

Posted on

What kind of tests I should implement?

What kind of tests I should implement?

Tests...tests and more tests! So, what kind of tests I should implement? How many tests do I need? These are common questions normally a developer ask himself when he needs to implement a use case, a new feature, create a library or a service.

First of all, there are several software testing tactics/techniques which you can apply. They can be conjugated and normally you have more than one of these techniques in your development cycle.

  • Automated testing
  • Box approach
  • Software performance testing
  • Usability testing
  • Security testing

The levels

Resultado de imagem para levels testing

The four basic levels of testing - (professionalqa.com 2019)

Now we will analyze the levels. It is important to keep in mind that some of these levels sometimes have other names or other designations. (this list doesn't have all the type of tests):

  • Unit testing: This is a small part, the first part, of the testing ecosystem. With unit tests, you can evaluate the code implemented. It is very chipper and it allows the detection of simple defects, such as exceptions or calculation problems.
  • Component testing: In this part of testing you can test functionality or flows but all external dependencies are simulated/mocked. In this level, we don't want to know if the dependency X or Y returned the correct result, we have to forget the external results and test our components behaviour and internal communications.
  • Integration testing: Testing the behaviour with the real results from external dependencies. This level of tests sometimes becomes hard to maintain because other dependencies should be available all the time. You should discuss if this level of tests it will add benefits for your project.
  • System testing: Sometimes called end-to-end testing, it is where you test the full integration. This type of test ensures that software works in all intended target system. This means you should have a system configured and the test needs to run in an application deployed outside from your local environment.
  • Acceptance testing: Also called user acceptance testing, this type of testing is used to obtain the customer approved. After approved the software can be delivered.

In general, I'm using the unit tests, component tests, system tests and acceptance tests. I believe that with these four levels you can achieve a nice test coverage and they will prevent you for a couple for issues.

What kind of levels do you normally use? Do you have any negative experience about one of these levels? Copy past the bullets below and let's share our opinion :)

  • What is my favourite test level and why:
  • What was my worst experience and why:

Original Post

References:

Latest comments (0)