How to ensure the security of the key data of the accounting system in the aspects of development, testing, backup and remedial measures?

recently, I have done a lot of financial projects and found that sometimes there are always some small loopholes, leading to data confusion, such as calculating dividends and credits for users according to certain rules. If the calculation is wrong, the data of all users will be affected.
fortunately, the usage of the project is not too much, which can be solved by backup and recovery.
this leads to more consideration.

how can we better ensure that financial data are not wrong? Can testing solve this problem well? Or how can we test for errors in financial calculations? Can you give me an example?
if there is a problem, how can I fix it?


personal suggestion:

1.;
2.;
3.

if this kind of problem occurs, first ensure the user experience and data correctness and completeness, then fix it with bug and discuss how to deal with the problem, finally, it depends on the personal code background, uncertain code does not start, this is the most important.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2bdf2-2bac5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2bdf2-2bac5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?