functional test code