Test and Deploy
Testing Your Financial Software
Before deploying an algorithm, model, or analytic in Quantmeric, compare its observed outputs with expectations you defined before testing. Use the results to decide whether the version you tested is ready to deploy.
Define what should pass
- Choose a typical case and cases that exercise boundaries in your logic. Include missing or invalid data if the software is expected to handle it.
- Record the expected output for each case. Work it out by hand for simple cases or use an independent reference for more complex ones. For numeric results, specify the units and any acceptable difference before running the test.
- Decide which cases must pass before deployment. Record the observed output for each run and compare it with the expected value, range, or error behavior.
For example, a daily volume analytic should return 150 shares when the day’s inputs contain two trades of 100 and 50 shares. If it returns 100 shares and the test requires an exact match, the case fails. The difference tells you what to investigate, but it does not tell you whether the analytic received both trades.
Choose data you can rerun
- Use a saved historical snapshot when you need to compare versions on identical inputs. Keep the exact records used by the test and document the instrument, time window, and time zone so the same records can be selected again.
- Use live observations when you need to check how the software handles conditions as they occur, such as late or out-of-order records. Save the inputs in the order received, along with their arrival times, so you can reproduce a failure without waiting for it to recur.
Interpret a failed test
- Check what the software actually received against the test case. Verify that the expected records arrived and that their units, timestamps, and order meet the test’s assumptions. If the inputs were wrong, correct the test setup and rerun the case.
- If the inputs match, reduce the case to the smallest set of records that still produces the mismatch. Keep enough prior data to reproduce any state the calculation depends on, then trace where the result first differs from the expected calculation.
- After fixing the issue, rerun the reduced case with the same inputs, then rerun the full test set. Deploy only after all required cases pass on the version you intend to release.