Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.94 KB

testing.md

File metadata and controls

43 lines (32 loc) · 1.94 KB

Testing on three levels

According to many test automation experts, testing should be done on 3 levels: Unit tests, Integration tests, End-to-End tests.

This section provides a definition of the terms, how they relate and policies.

The testing pyramid, which is widely used in the testing space:

The testing pyramid - Intro

The Testing Pyramid: How to Structure Your Test Suite References:

Unit tests

The bulk of tests should be unit tests:

  • Tests one unit of execution (one function, class, or even method of a class)
  • Very easy to write and update (even AI can be used to generate ideas for them)
  • Fast to execute (few milliseconds per unit test)
  • Can be made to cover all branches of a function
  • Mocks can be used, by should be used only outside the test target, because Mocks are lies to tell “all is fine” and thus may only be used outside the test target (function, class, or method).

Integration tests

  • These test the correct integration of a number of functional units (functions, classes, methods)
  • Still easy to write and update
  • Still very fast vast to execute (few milliseconds per unit test)

End-to-End Tests

  • These test an entire program end-to-end.
  • All tests in XenRT are E2E tests, but XenRT tests are even system tests.
  • Any test that runs a program as a whole to test its functionality is an E2E test.
    • Using a sufficient test environment, many E2E tests are possible without XenRT.
  • The final E2E test for xenserver-status-report is to get a bug-report through the UI of XenCenter.