We consider the problem of the accurate tracing of long magnetic field lines in tokamaks, which is in general crucial for the determination of the plasma boundary as well as for the magnetic properties of the scrape-off layer. Accurate field line tracing is strictly related to basic properties of ordinary differential equation (ODE) integrators, in terms of preservation of invariant properties and local accuracy for long-term analysis. We introduce and discuss some assessment criteria and a procedure for the specific problem, using them to compare standard ODE solvers with a volume-preserving algorithm for given accuracy requirements. In particular, after the validation for an axisymmetric plasma, a three-dimensional (3-D) configuration is described by means of Clebsch potentials, which provide analytical invariants for assessing the accuracy of the numerical integration. A standard fourth-order Runge-Kutta routine at fixed step is well suited to the problem in terms of reduced computational burden, with extremely good results for accuracy and volume preservation. Then we tackle the problem of field line tracing in the determination of plasma-wall gaps for a 3-D configuration, demonstrating the effective feasibility of the plasma boundary evaluation in tokamaks by tracing field lines with standard tools.