Timeline for Testing database insertion, removal, and modification from program code (i.e., rather than test code)
Current License: CC BY-SA 4.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 13, 2019 at 19:21 | comment | added | user2514157 | I'm using python with the official driver (neo4j/neo4j-python-driver) and unittest (but no frameworks). I was able to locate some integration tools (below). But, I am a embarrassed that I was not able to locate any tutorials on how to use them, so they remain a little outside my current coding abilities. stackoverflow.com/questions/49348839/… github.com/neo4j/neo4j-python-driver/blob/1.6/test/integration/… | |
| Jan 12, 2019 at 22:06 | comment | added | simbo1905 | you name the databases you use but what languages and frameworks are you using? | |
| Dec 31, 2018 at 9:20 | answer | added | Simon | timeline score: 1 | |
| Dec 30, 2018 at 23:21 | answer | added | simbo1905 | timeline score: 2 | |
| Dec 30, 2018 at 20:23 | answer | added | Brandon | timeline score: 4 | |
| Dec 30, 2018 at 19:41 | answer | added | amon | timeline score: 2 | |
| Dec 30, 2018 at 19:38 | comment | added | Bogdan | Because, in most cases, it's a bad idea. What you are doing is an assert. You have code in your application which asserts that other code in the application is working correctly. That extra code hurts readability and also hurts performance. And extra code can also add extra bugs. And you said it yourself, it detects "some errors", not all errors. Tests should be separated from the final code. It's better to pay more attention to the code you write than to write even more code trying to catch moments where you were "asleep at the keyboard", so to speak. | |
| Dec 30, 2018 at 18:29 | comment | added | user2514157 | bug: >>>get_list() 1, 2 >>>add_to_list_in_databas(3) >>>get_list() 1, 2 If the add_to_list() method compares get_list() before adding 3 to get_list() after, and they match, then there is a bug. This would not detect that get_list() and add_to_list() are both pointing to the same wrong list, but it would detect at least some errors (e.g., they are adding and getting different lists). Quickly and easily detecting this error (without doing a full mock up or integration test) would have value to me. None of the testing books I read teach this as an option. Why? | |
| Dec 30, 2018 at 17:51 | comment | added | Bogdan | I could create a method that adds a value to the wrong list. Since I know the value I just added must be present, I can retrieve the list and verify it is present. And what guarantees that you don't make a mistake also when you retrieve the list, and you check the wrong list too where you just inserted a new value which is, of course, present. So the test works but you are still in the wrong list. I think you might be overthinking this. Maybe rephrase your question to add more details. As it stands it's not clear what you are asking | |
| Dec 30, 2018 at 17:38 | comment | added | user2514157 | My concern is almost exactly the opposite. I want to ensure that my code to modify the database will work round trip. For example, I am a new user of neo4j. I can update records in ways that are legal, but not what I intended. I could create a method that adds a value to the wrong list. Since I know the value I just added must be present, I can retrieve the list and verify it is present. Just because the database does not throw an error upon retrieval of the list does not mean that all list items are being properly updated (i.e., I may have broken the update method subsequently). | |
| Dec 30, 2018 at 17:10 | comment | added | Bogdan | Your database operation either works or gives an error/exception. That's how you know. Your questions seems to imply that your code works but still the database operation doesn't but also gives no error so you have to double check. It doesn't make sense. You are asking about a solution, but what is your problem? | |
| Dec 30, 2018 at 16:35 | review | First posts | |||
| Dec 30, 2018 at 18:13 | |||||
| Dec 30, 2018 at 16:34 | history | asked | user2514157 | CC BY-SA 4.0 |