ci-definitions.rst.inc 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. Definition of terms
  2. ===================
  3. This section defines the terms used in this document and correlates them with
  4. what is currently used on QEMU.
  5. Automated tests
  6. ---------------
  7. An automated test is written on a test framework using its generic test
  8. functions/classes. The test framework can run the tests and report their
  9. success or failure [1]_.
  10. An automated test has essentially three parts:
  11. 1. The test initialization of the parameters, where the expected parameters,
  12. like inputs and expected results, are set up;
  13. 2. The call to the code that should be tested;
  14. 3. An assertion, comparing the result from the previous call with the expected
  15. result set during the initialization of the parameters. If the result
  16. matches the expected result, the test has been successful; otherwise, it has
  17. failed.
  18. Unit testing
  19. ------------
  20. A unit test is responsible for exercising individual software components as a
  21. unit, like interfaces, data structures, and functionality, uncovering errors
  22. within the boundaries of a component. The verification effort is in the
  23. smallest software unit and focuses on the internal processing logic and data
  24. structures. A test case of unit tests should be designed to uncover errors due
  25. to erroneous computations, incorrect comparisons, or improper control flow [2]_.
  26. On QEMU, unit testing is represented by the 'check-unit' target from 'make'.
  27. Functional testing
  28. ------------------
  29. A functional test focuses on the functional requirement of the software.
  30. Deriving sets of input conditions, the functional tests should fully exercise
  31. all the functional requirements for a program. Functional testing is
  32. complementary to other testing techniques, attempting to find errors like
  33. incorrect or missing functions, interface errors, behavior errors, and
  34. initialization and termination errors [3]_.
  35. On QEMU, functional testing is represented by the 'check-qtest' target from
  36. 'make'.
  37. System testing
  38. --------------
  39. System tests ensure all application elements mesh properly while the overall
  40. functionality and performance are achieved [4]_. Some or all system components
  41. are integrated to create a complete system to be tested as a whole. System
  42. testing ensures that components are compatible, interact correctly, and
  43. transfer the right data at the right time across their interfaces. As system
  44. testing focuses on interactions, use case-based testing is a practical approach
  45. to system testing [5]_. Note that, in some cases, system testing may require
  46. interaction with third-party software, like operating system images, databases,
  47. networks, and so on.
  48. On QEMU, system testing is represented by the 'check-avocado' target from
  49. 'make'.
  50. Flaky tests
  51. -----------
  52. A flaky test is defined as a test that exhibits both a passing and a failing
  53. result with the same code on different runs. Some usual reasons for an
  54. intermittent/flaky test are async wait, concurrency, and test order dependency
  55. [6]_.
  56. Gating
  57. ------
  58. A gate restricts the move of code from one stage to another on a
  59. test/deployment pipeline. The step move is granted with approval. The approval
  60. can be a manual intervention or a set of tests succeeding [7]_.
  61. On QEMU, the gating process happens during the pull request. The approval is
  62. done by the project leader running its own set of tests. The pull request gets
  63. merged when the tests succeed.
  64. Continuous Integration (CI)
  65. ---------------------------
  66. Continuous integration (CI) requires the builds of the entire application and
  67. the execution of a comprehensive set of automated tests every time there is a
  68. need to commit any set of changes [8]_. The automated tests can be composed of
  69. the unit, functional, system, and other tests.
  70. Keynotes about continuous integration (CI) [9]_:
  71. 1. System tests may depend on external software (operating system images,
  72. firmware, database, network).
  73. 2. It may take a long time to build and test. It may be impractical to build
  74. the system being developed several times per day.
  75. 3. If the development platform is different from the target platform, it may
  76. not be possible to run system tests in the developer’s private workspace.
  77. There may be differences in hardware, operating system, or installed
  78. software. Therefore, more time is required for testing the system.
  79. References
  80. ----------
  81. .. [1] Sommerville, Ian (2016). Software Engineering. p. 233.
  82. .. [2] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering,
  83. A Practitioner’s Approach. p. 48, 376, 378, 381.
  84. .. [3] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering,
  85. A Practitioner’s Approach. p. 388.
  86. .. [4] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering,
  87. A Practitioner’s Approach. Software Engineering, p. 377.
  88. .. [5] Sommerville, Ian (2016). Software Engineering. p. 59, 232, 240.
  89. .. [6] Luo, Qingzhou, et al. An empirical analysis of flaky tests.
  90. Proceedings of the 22nd ACM SIGSOFT International Symposium on
  91. Foundations of Software Engineering. 2014.
  92. .. [7] Humble, Jez & Farley, David (2010). Continuous Delivery:
  93. Reliable Software Releases Through Build, Test, and Deployment, p. 122.
  94. .. [8] Humble, Jez & Farley, David (2010). Continuous Delivery:
  95. Reliable Software Releases Through Build, Test, and Deployment, p. 55.
  96. .. [9] Sommerville, Ian (2016). Software Engineering. p. 743.