Changes for page Tips and Tricks

Last modified by chrisby on 2024/04/01 13:11

From version 1.6
edited by chrisby
on 2023/05/29 12:30
Change comment: There is no comment for this version
To version 1.8
edited by chrisby
on 2023/05/29 15:56
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -51,3 +51,7 @@
51 51  //some logic
52 52  assertTrue(y);
53 53  {{/code}}
54 +
55 +* If certain production code needs to be called several times with slightly different arguments, it may be useful to iterate over a list of these arguments, calling the production code and then asserting the result on each iteration. It is then often good practice to print out each element before each assertion. If an element causes a test to fail, the terminal output will immediately show which element caused the error.
56 +* If you find a bug or a case that has not yet been tested, it is your duty to create a test that covers it, so that the software is stable against that problem from that moment on.
57 +* Inaccurate results should never be asserted against an exact value, but only within an expected range of approximation. This includes all floating-point numbers, which are always imprecise.