function test and construct