These functions all seem readily testable to me. Give them some fake data where we know the result and make sure that comes out right.