Approches to write test for code