A usability requirement for interactive layout assistance systems is the principle of least astonishment which states that the system should arrange the layout in a way that conforms to the user’s expectations. This paper presents a framework for transformation-based similarity between two-dimensional spatial configurations. Here, similarity is intended to measure the user’s expectations when he is presented with a system-side generated layout. The framework is based on results in cognitive science. Firstly, it can serve to validate existing layout algorithms with respect to their ergonomic adequacy. Secondly, it is demonstrated how it can help to design new algorithms respecting the principle of least astonishment. The practical use of the framework is illustrated with UML class diagrams as example domain.