Ref:
“Pipe Line Rules of Thumb Handbook” E.W. McAllister, Editor, 4th edition
Gulf Publishing Company, Houston, Texas
Appendix A, Page 127 & 128, Volume of Water Required to Fill Test Section
Equation and Sample Calculation are given in the Appendix.
Equation:
Vtp = V * Fwp * Fpp * Fpwt
Vtp = Gallons in section at test pressure
Fwp = Factor to correct for compressibility of water from 0 to test pressure
Fpp = Factor to correct for volume change in pipe from 0 to test pressure
Fpwt = Factor to correct for the change in water volume and pipe volume due to change in temperature from 60 to pipe and water temp.
This reference list out the equations for V, Fwp, Fpp, and Fpwt so it should answer your question.