This paper studies the impact of different teacher and class characteristics on third graders' outcomes. It uses a feature of the French system in which some novice teachers start their jobs before receiving any training. Three categories of teachers are included in the sample: experienced teachers, trained novice teachers and untrained novice teachers. To identify the effects, we use administrative mistakes in forecasting the number of teachers. We find that trained and untrained novice teachers are assigned to similar classes, whereas experienced teachers have better students located in better environments. Hence, in order to match similar students and classes, we focus on pupils with novice teachers and discard those with experienced teachers. In addition, we show that the same sample can be used to estimate the causal effect of class size on students' outcomes. Our findings are: (1) teachers' training substantially improves students' test scores in mathematics; (2) this training effect does not rely on different teaching practices, but mainly on subject matter competence; untrained teachers who majored in sciences at university improve their students' achievement as much as trained teachers do; (3) the class size effect is substantial and significant; class size does not seem to be correlated with instructional practices; (4) teachers' training does not improve the scores of initially low-achieving students and classes; on the contrary, a smaller class is more beneficial to low-achieving students within classes and to all students in low-achieving classes.