Skip to content

Types of tests

Devrath edited this page Oct 24, 2023 · 4 revisions

github-header-image

Types of tests

  • Unit testing
  • Integration testing
  • End-to-end testing

Unit testing

  • It is used to test a single unit of code.
  • Normally people say it is just a function to code but what actually matters is it is something that performs an isolated behavior.
  • Behaviour means, what the code does, rather than how the code does it.

Integration testing

  • Unlike unit testing where you test a single unit of code, In integration testing you test a collection of units.
  • These collection of units work together to perform a certain functionality

End to end testing

  • This testing takes the grouping of tests even further than integration tests.
  • Basically they are used to validate the entire software from start to finish.
  • Here all the layers of the application are involved by using which we verify the flows end-to-end.
  • This is like a manual tester performing some action to test the outcome.

Testing pyramid

0_QSQybvwFwnQ16-aQ

Mutation Testing

  • It is a type of testing where you check the test cases after writing a collection of test cases.
  • That is by intentionally breaking the production code and checking if your test cases fail.
  • Because sometimes there can be an issue in your test case and with the help of mutation testing, we can find the root cause.
  • Say you have a fake implementation in your code and all the time you check if test cases work for fake implementation. Now intentionally break prod code if your tests still succeed there is a possibility there is an issue with your test cases.