Skip to main content
7 events
when toggle format what by license comment
Sep 12, 2019 at 10:34 comment added Diane M You can never ensure 100% code correctness. You can have tooling that makes you more confident that it is for some cases, including known edge cases. I highly doubt humanly compile and execute a query in your head is faster and more reliable than having it written down and done by machines. This is why as a reviewer you should mostlsy assure tests are covering enough of these cases, and that they pass.
Sep 12, 2019 at 10:21 comment added CEGRD Because the example you may not fully cover the code. Without understanding the code you cannot ensure that there is an edge case in the query so that when that when that where condition becomes true, then the query would blow up. So you would still need to look and read the code line by line to sure you get enough coverage.
Sep 12, 2019 at 10:18 comment added Diane M @CEGRD Temporary tables and PL_SQL are implementation details, not functional needs, as long as in the end of the day the query does its job on a minimal example why would you care ?
Sep 12, 2019 at 9:07 comment added CEGRD I believe your assumption is that it is easy to see “a request should update table A using B and C”. That is not the case most of the time in real world queries. I am talking about 100 lines sql queries going over many tables with iterations, temporary tables, stored procedure calls etc.
Sep 12, 2019 at 8:30 comment added Diane M @CEGRD A test (or a suite of tests) should inherently give you the guarantee that the implementation is correct, otherwise it's not a good test or it's not sufficiently tested. You should make sure the tests cover the change, not that the implementation cover the change. E.g. if you have a request that should update table A using B and C, in your test mock A, B and C data, check A updated correspond to the perimeter of your functionnal need, you don't need to actually care how it internally was updated (only should so for performance and style like I mentionned)
Sep 12, 2019 at 8:19 comment added CEGRD I hear you but introducing test cases do not solve the entire problem of having to still going through the entire code and verify whether the test cases are accurately testing the change. Am I misunderstanding?
Sep 12, 2019 at 8:12 history answered Diane M CC BY-SA 4.0