On Principles of Least Change and Least Surprise for Bidirectional Transformations
James Cheney‚ Jeremy Gibbons‚ James McKinna and Perdita Stevens
Abstract
In software engineering and elsewhere, different people may work intensively with different, but related, artefacts, e.g. models, documents, or code. They may use bidirectional transformations (bx) to maintain consistency between them. Naturally, they do not want their deliberate decisions disrupted, or their comprehension of their artefact interfered with, by a bx that makes changes to their artefact beyond the strictly necessary. This gives rise to a desire for a principle of Least Change, which has been often alluded to in the field, but seldom addressed head on. In this paper we present examples, briefly survey what has been said about least change in the context of bx, and identify relevant notions from elsewhere that may be applicable. We conclude that we cannot expect a Principle of Least Change to determine the optimal behaviour of a bx based on the consistency relation it embodies alone. Any such principle would bind the hands of the bx developer too tightly: the specification of how consistency is restored is as important a part of the development of a bx as the specification of what consistency means. Rather, what is required is a notion of reasonable behaviour of a bx that captures the idea that the bx’s consistency restoration does not gratuitously surprise its user. We suggest considering continuity variants, particularly Hölder continuity. Such properties are too strong to expect them to hold universally, so we introduce the idea of a property holding piecewise on an atlas of subspace pairs.