We consider the control of the COVID–19 pandemic via incentives, through either stochastic SIS or SIR compartmental models. When the epidemic is ongoing, the population can reduce interactions between individuals in order to decrease the rate of transmission of the disease, and thus limit the epidemic. However, this effort comes at a cost for the population. Therefore, the government can put into place incentive policies to encourage the lockdown of the population. In addition, the government may also implement a testing policy in order to know more precisely the spread of the epidemic within the country, and to isolate infected individuals. We provide numerical examples, as well as an extension to a stochastic SEIR compartmental model to account for the relatively long latency period of the COVID–19 disease. The numerical results confirm the relevance of a tax and testing policy to improve the control of an epidemic. More precisely, if a tax policy is put into place, even in the absence of a specific testing policy, the population is encouraged to significantly reduce its interactions, thus limiting the spread of the disease. If the government also adjusts its testing policy, less effort is required on the population side, so individuals can interact almost as usual, and the epidemic is largely contained by the targeted isolation of positively–tested individuals.