Abstract. We compute chemical evolution models to constrain the mode and the history of star formation in starburst galaxies as a whole, i.e. over a large range of mass and metallicity. To this end, we investigate the origin of the dispersion observed in the evolution of both nitrogen-to-oxygen abundance ratio and galaxy luminosity as a function of metallicity for a large sample of starburst galaxies. We find that the variation of the star formation efficiency, in the framework of continuous star formation models, produces a scatter equivalent to that observed in the N/O versus O/H diagram for low-mass Hii galaxies only. However, continous star formation models are unable to reproduce i) the scatter observed for massive starburst and UV-selected galaxies in the N/O versus O/H relation, and ii) the scatter in the MB versus O/H scaling relation observed for the whole sample of starburst galaxies. The dispersion associated with the distribution of N/O as a function of metallicity, for both low-mass and massive galaxies, is well explained in the framework of bursting star formation models. It is interpreted as a consequence of the time-delay between the ejection of nitrogen and that of oxygen into the ISM. These models also reproduce the spread observed in the luminosity-metallicity relation. Metal-rich spiral galaxies differ from metalpoor ones by a higher star formation efficiency and starburst frequency. Low-mass galaxies experienced a few bursts of star formation whereas massive spiral galaxies experienced numerous and extended powerful starbursts. Finally, we confirm previous claims (Contini et al. 2002) that UV-selected galaxies are observed at a special stage in their evolution. Their low N/O abundance ratios with respect to other starburst galaxies is well explained if they have just undergone a powerful starburst that enriched their ISM in oxygen.