Tom Loveless, a scholar at the Brookings Institution, has spent many years analyzing testing data. He is active in the study of international testing.

He has deciphered the secrets of Shanghai’s remarkably high test scores.

For one thing, China as a whole does not take the PISA test. Shanghai is a city, not the nation. It is a huge city, to be sure, but it is not typical of the nation. Other provinces take PISA, but China has an unusual arrangement with the OECD (which administers the tests) by which the Chinese government is allowed to review the test scores and decide which provinces will release their scores.

Loveless writes:

How dissimilar is Shanghai to the rest of China?  Shanghai’s population of 23-24 million people makes it about 1.7 percent of China’s estimated 1.35 billion people.  Shanghai is a Province-level municipality and has historically attracted the nation’s elites.  About 84 percent of Shanghai high school graduates go to college, compared to 24 percent nationally. Shanghai’s per capita GDP is more than twice that of China as a whole.  And Shanghai’s parents invest heavily in their children’s education outside of school.  According to deputy principal and director of the International Division at Peking University High School, Jiang Xuegin:

 Shanghai parents will annually spend on average of 6,000 yuan on English and math tutors and 9,600 yuan on weekend activities, such as tennis and piano. During the high school years, annual tutoring costs shoot up to 30,000 yuan and the cost of activities doubles to 19,200 yuan.

The typical Chinese worker cannot afford such vast sums.  Consider this: at the high school level, the total expenses for tutoring and weekend activities in Shanghai exceed what the average Chinese worker makes in a year (about 42,000 yuan or $6,861).

Further, Shanghai does not allow the children of migrants to attend its high schools.

The hukou system prevents children of migrants–numbering at least 500,000 by the government’s own count and probably many more than that–from attending Shanghai’s high schools.  Many are forced back to rural villages to attend school.