1. A method for testing a user interface comprising: receiving an indication of an actual state of the graphical user interface; computing a difference between the actual state of the graphical user interface and a target state of at least a portion of the graphical user interface based, at least in part, on a weighting function; comparing the difference to a threshold value; and generating a value indicating whether the graphical user interface is valid based, at least in part, on whether the difference exceeds the threshold value.