Abstract We investigate the reconstruction of an unknown cavity inside a heat conductor with only single boundary measurement, which is a typical non-destructive testing of defects in material science using thermography. Mathematically, it can be formulated as an inverse boundary value problem for the heat equation. Two domain sampling methods, i.e., the range test (RT) and no-response test (NRT), are developed to realize the reconstruction. We first justify the convergence of the RT, which is based on the analytical extension property of solutions to the heat equation. Then we prove the duality of the RT and NRT by looking at the relation between their indicator functions. Consequently, the unknown cavity can be reconstructed by using either the RT or NRT if the solution associated to the single measurement cannot be analytically extended across its boundary. Next, we design two efficient algorithms for the RT and NRT to reconstruct the unknown cavity numerically. Each algorithm consists of two steps. The first step is to determine an approximation of the unknown cavity by implementing the sampling methods in a coarse grid, while the second step is to improve the reconstruction by using a fine grid in the approximate domain. The numerical results suggest that both algorithms can generate some rough information on the cavity with only one boundary measurement. Finally, by using this information as an initial guess for Newton's method, we improve the accuracy of the mentioned reconstruction results.