The eight legged essay was the primary test for people to get ranks as scholars in Ming and Qing China. It tested students on their knowledge of the Confucian classics, and their ability to write commentaries on them in a very formal, prescribed manner. It gained its name from the fact it had eight sections.
These essays may seem silly, pointless and formalistic to us today, and the people of the time were not blind to the fact that these essays often tested nothing more then the writers ability to plug in the proper cliched phrases at the right places. The novel The Scholars is particularly mocking of the would be scholars, scurrying to write the best eight legged essays. However, doubts not withstanding, it still remained the primary way to gain a government job over 400 years. This could be due to the fact that although it lended itself to a great deal of BS, it could also be used by a talented writer to convey real thoughts if they so wished.
The phrase "eight legged" stayed in the speech of China for some time, and was used in communist times to describe someone who spouted communist jargon without thinking.
The English translation of the novel The Red Chamber Dream by David Hawkes has a reluctant Jia Bao-yu attempting to write eight legged essays. The translator conveys the rigidity and artificiality of the essays by expressing the Classical Chinese as Latin compositions,
a fairly good rendition of how the essay would sound compared to vernacular Chinese.