test functions for residuals class