A large number of optical measurement methods provide a fringe pattern which must be processed in order to extract the fringe phase, where the physical information is. Today, phase- stepping has become the standard method for fringe processing. A set of fringe patterns is digitized, where the fringe phase is varied by a known amount from frame to frame. The 'algorithm' is the mathematical formula which relates the set of recorded images to the phase field. However, it is desirable that this algorithm be independent of some well- known systematic sources of error: nonsinusoidal profile of the fringes, miscalibrated phase shifts, bias variation and so on. Some procedures to design such an algorithm have been proposed recently. Among them, the characteristic polynomial theory has proved to be a simple tool which allows to fully customize the algorithm, so that the most efficient use of the recorded frames is done. Apart from the simplicity of the computations which are necessary, one of the most interesting features of the theory is that it is possible to give analytical formulae for the residual phase errors, thus allowing a fully metrological approach. The present paper give the basics of the theory, and practical rules to design fully customized algorithms.