In this paper we propose a systematic approach for calculating the preserved measures and integrals of a rational map. The approach is based on the use of cofactors and Darboux polynomials and relies on the use of symbolic algebra tools. Given sufficient computing power, all rational preserved integrals can be found. We show, in a number of examples, how it is possible to use this method to both determine and detect preserved measures and integrals of the considered rational maps. Many of the examples arise from the Kahan-Hirota-Kimura discretization of completely integrable systems of ordinary differential equations.