DP function and dptest