The tester was upset that he discovered the following flow on an update action of an item from database:
- Client: request and get an item from server
- Client: change some data from the item
- Client: send an update command to the server
- Server: get the update command request
- Server: delete from database the given item
- Server: recreate the item as a new item with the updated data
For each update, the server deletes the item from database and recreates the item. Each deleted item is marked only as deleted in database but is not physical removed, because we need a tracking mechanism. This is a very bad practice. We are talking about a small web-application that recreates each item when the user changes some fields on it.
Imagine the following scenario: The web application is an e-commerce solution and has around 10.000 items listed. Each week, we receive from each producer updates related to each product that we import from Excel files. Because of this in only 3 months, our database will have around 120.000 items, even if only 10.000 are active.
The developer said to the testers that was the most convenient way for him. But this solutions is farthest the best one.
So what we can do to solve these problems? First of all we should look what we should do when an item is updated. If we need some tracking capabilities, that we should create a separate table/tables that track the changes.
If you are a tester, you should never accept a response like “It was the most convenient”. The “tracking” should never be made in the same table. Also if this was the most easier way to update an item from the database that say no again.
0 comments:
Post a Comment