Stochastic dynamics for adaptation and evolution of microorganisms