Assumption kills

In an investigation, assumption kills! – Jack Reacher

What happened?

The dashboard of the management system that I’m working on shows various metric information in widget type. There are some widgets that when you click on them, will show…


This content originally appeared on DEV Community and was authored by Eddy in the bush

In an investigation, assumption kills! - Jack Reacher

What happened?

The dashboard of the management system that I’m working on shows various metric information in widget type. There are some widgets that when you click on them, will show a pop-up that contains detailed information presented in the table.

For some unknown reason, the detail list shows less data than it should ( less than the number shown on the widget itself).

The investigation

  • The investigation begins with one thought standing in my mind:
    The backend code has run just fine and it hasn't changed since 2023!!!

  • With that mindset, I started to check the API call and server log,...
    The data of the detail list is from ElasticSearch service so I assumed that the error started because of the ES data.

  • I started trying to build the ES query that the backend generated, I think when I got the query, I could get the data from ES service, check the result, and find out the problem. It took me two weeks!!!

  • After trying and failing several times, I realized I had taken the wrong path. I checked the API call again and...it shining right in front of my face, just slap a big hand at me.
    So the error didn't come from ES data at all. The difference between the number in the widget and the total record in the detail table is the number in the widget could be the result of an expression but in the detail table, it's NOT.
    eg: the widget number = result from query A + result from query B
    the total record in detail table = result from query A

Result

  • After realizing how dumb I was, I started to implement some code in the back-end code so the detail table would show the correct number of records as the widget when the expression is deactivated ( yes, this business logic is confirmed by the client)

Conclusion

  • The mindset that I had during the early day of fixing the bug was a beginner mistake and I didn't realize it.
  • Should change how I approach the problem sooner after the path leads to nowhere.
  • Always keep looking at the evidence, keep a clear mind, and don't make assumptions.


This content originally appeared on DEV Community and was authored by Eddy in the bush


Print Share Comment Cite Upload Translate Updates
APA

Eddy in the bush | Sciencx (2024-11-13T14:08:45+00:00) Assumption kills. Retrieved from https://www.scien.cx/2024/11/13/assumption-kills/

MLA
" » Assumption kills." Eddy in the bush | Sciencx - Wednesday November 13, 2024, https://www.scien.cx/2024/11/13/assumption-kills/
HARVARD
Eddy in the bush | Sciencx Wednesday November 13, 2024 » Assumption kills., viewed ,<https://www.scien.cx/2024/11/13/assumption-kills/>
VANCOUVER
Eddy in the bush | Sciencx - » Assumption kills. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/11/13/assumption-kills/
CHICAGO
" » Assumption kills." Eddy in the bush | Sciencx - Accessed . https://www.scien.cx/2024/11/13/assumption-kills/
IEEE
" » Assumption kills." Eddy in the bush | Sciencx [Online]. Available: https://www.scien.cx/2024/11/13/assumption-kills/. [Accessed: ]
rf:citation
» Assumption kills | Eddy in the bush | Sciencx | https://www.scien.cx/2024/11/13/assumption-kills/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.