Testing an application is quite tedious; it gets worse because your application has to run in several different browsers with different behaviors. Later on, there comes a new version either of your application, the libraries you use, or of any of the browsers you are expected to support and all the testing has to be redone. In practice, most testing is replaced with very devoted praying.
YUI Test is a very simple library that lets you run tests automatically. You can define tests and test suites, ask it to perform some actions and then check the results. Those actions, besides explicitly calling functions and methods in your application, can be User Interface events. You can ask YUI Test to simulate mouse events such as clicks, double-clicks and mouse down, up, move, over, and out events as well as key ups, downs, and press. Thus, YUI Test is not limited to test functions but the whole behavior of the UI.
It can also test asynchronous functions such as DataSource's .sendRequest...