Changes for page Tips and Tricks
Last modified by chrisby on 2024/04/01 13:11
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,4 +1,4 @@ 1 -* **Regularity:** Run tests regularly, ideally before every commit, for optimal quality assurance. In particular, run all relevant tests before pushing code or creating a pull/merge request. Continuous integration practices are helpful for enforcing testing of code uploaded by other developers. 1 +* **Regularity:** Run tests regularly, ideally before every commit, for optimal quality assurance. In particular, run all relevant tests before pushing code or creating a pull/merge request. 'Continuous integration' practices are helpful for enforcing testing of code uploaded by other developers. 2 2 * Use **functional programming** for data processing tasks because it is less prone to errors and side effects. 3 3 * It's common to create **test users and test data** to facilitate the testing process. 4 4 * Don't reinvent the wheel and **use existing test libraries**. There are proven solutions that minimize the effort of creating tests. ... ... @@ -28,7 +28,8 @@ 28 28 } 29 29 {{/code}} 30 30 31 -* **Different branches of production code should be checked in different tests.** Avoid if-statements in the test code, but at least be careful with assertions in if/if-else blocks, as the test may pass without executing them. To prevent this, add 'else {fails()}' at the end, or assert the condition and branch: 31 +* **Different branches** of production code should be checked in different tests. 32 +* **Avoid if-statements in the test code**, but at least be careful with assertions in if/if-else blocks, as the test may pass without executing them. To prevent this, add 'else {fails()}' at the end, or assert the condition and branch: 32 32 33 33 {{code}} 34 34 // bad - still passes when x == false and y == false