How do quality assurance engineers test calculations?
How do quality assurance engineers test calculations done inside the code and calculations in stored procedures?
Also if the calculation is complex what should be the approach to test something like that?
We can't rely on developers codes for complex calculations and even if a QA developed a method to calculate it, how can we rely on it? Because even the QA could have made mistakes.
Im expecting an answer which is suitable for both manual and automation QA's
All engineers (application and automation) test algorithms by providing known inputs and having knowledge of the expected output in order to perform verifications.
The verification values can be found by manual calculations and/or different algorithm(s).
If the algorithm and manual calculation approach are not known another approach is BDD (Behaviour-Driven Development). What formula would work for "1". Then "2". Then "3", etc. This does assumes that you can at least manually calculate those. At some point you make the call that it seems reliable enough with enough numbers tested. This is an approach to use tests to discover the design. If you can't figure out what your formula should produce given a simple input, e.g. "1", you may have a different issue.