Ki testing was a tool created by Tohei Sensei of the Ki Society to help improve Aikido. Some suggest this is his greatest contribution to Aikido. In addition to the parlour tricks used to demonstrate Ki power (and the main focus of aiki physics), Ki testing is a powerful tool to help improve Aikido.
Taking a reductionist viewpoint, its purpose is to ensure that the physical structure of the body is strong and stable at any position throughout the execution of a technique. Students of the Ki Society are taught a range of Ki development exercises which involve various postures where there are prescribed tests. The following video is of the Ki examination at my Shodan grading (taken just a few years ago). Although I am no longer with the Ki Society, I am just beginning to understand some of these movements and tests now.
Ki tests are also done at higher levels, where a mental reaction is elicited from the person being tested to cause them to compromise their own stability. It is a good test of stability under the mental pressure of an attack.
Unfortunately sometimes the tool can be used for other purposes, such as egotistic practice. The person doing the testing can nearly always make someone fail a Ki test unless they test correctly. Kataoka Sensei addressed this in one seminar I went to by having someone Ki test the person doing the Ki test. An egotistical Ki tester will fail a Ki test.