implement database test function