Background: The health economic evidence about the value and optimal targeting of genetic testing in the prevention of coronary heart disease (CHD) events has remained limited and ambiguous. The objective of this study is to optimize the population-level use and targeting of genetic testing alongside traditional risk factors in the prevention of CHD events and, thereby, to assess the cost-benefit of genetic testing. Methods and findings: We compare several strategies for using traditional and genetic testing in the prevention of CHD through statin therapy. The targeting of tests to different patient segments within these strategies is optimized by using a decision-analytic model, in which a patient’s estimated risk of CHD is updated based on test results using Bayesian methods. We adopt the perspective of healthcare sector. The data for the model is exceptionally wide and combined from national healthcare registers, the Finnish Institute for Molecular Medicine, and published literature. Our results suggest that targeting genetic testing in an optimal way to those patients about which traditional risk factors do not provide sufficiently accurate information results in the highest expected net benefit. In particular, compared to the use of traditional risk factors only, the optimal use of genetic testing would decrease the expected costs of an average patient aged 45 years or more by 2.54€ in a 10-year follow-up period while maintaining the level of the expected health outcome. Thus, genetic testing is found to be a part of a cost-beneficial testing strategy alongside traditional risk factors. This conclusion is robust to reasonable changes in model inputs. Conclusions: If targeted optimally, the use of genetic testing alongside traditional risk factors is cost-beneficial in the prevention of CHD.