Programmers confront a minefield when they design interactive Web programs. Web interactions take place via Web browsers.
With browsers, consumers can whimsically navigate among the various stages of a dialog and can thus confuse the most sophisticated
corporate Web sites. In turn,Web services can fault in frustrating and inexplicable ways. The quickening transition from Web
scripts toWeb services lends these problems immediacy.
To address this programming problem, we develop a foundational model of Web interactions and use it to formally describe two
classes of errors. The model suggests techniques for detecting both classes of errors. For one class we present an incrementally
checked record type system, which effectively eliminates these errors. For the other class, we introduce a dynamic safety
check, which catches the mistakes relative to programmers’ simple annotations.