Xero interview question

Explain why need to write test in this code