building and testing database