Experiences with using Alloy in real-world projects
Asked Answered
B

3

16

I have been interested in formal methods for some time. I have used formal methods to reason about some very specific sub-areas of a few projects I have been working on. I was never able to convince other team members to try the same let alone specify an entire domain with a formal method.

One method I have found particularly interesting is Alloy. I think that it may "scale" better as foundation for an entire project because it is conceptually and notationally very close to actual programming languages. Furthermore, the tools are quite solid so that the benefits of model verification are readily available.

I'd be very much interested to hear about any real-world experiences you folks might have had with using Alloy in your projects. Do you feel that it has helped you in designing a better domain model? Did find errors in your domain model during verification? Would you use it again?

Bilabial answered 25/2, 2010 at 13:29 Comment(0)
C
5

Yes, I've used Alloy and it's cousins industrially. Alloy has been most helpful in convincing me that my models weren't wildly wrong---or rather, showing me where they were wrong and gave rise to silly results. Other more specific tools, like Song's Athena and Guttman and Ramsdell's CPSA have been more useful in their narrower domains. What more would you like to hear about?

Cavein answered 16/8, 2010 at 15:1 Comment(2)
Could you please provide links to the other tools you mentioned? It's not easy to search for them.Radiograph
I think perhaps this answer refer's to the Athena project here (probably no longer maintained by Professor Dawn Song at Berkeley), and CPSA here.Handal
F
21

I've used Alloy on a few projects and have found it helpful; on some but not all of those projects I have been able to persuade others involved to use Alloy as well, or at least to work with the Alloy models I wrote. These projects may or may not be what you have in mind in asking for 'real-world' projects, but they certainly took place in the part of the real world I work in.

In 2006 and 2007 I created a partial Alloy model for the then-current draft of the W3C XProc specification; as far as I could tell, most members of the working group never read the paper I wrote (at http://www.w3.org/XML/XProc/2006/12/alloy-models/models.html); they said "Oh, we changed that part of the spec last week, so what the model says is no longer relevant". But the paper did manage to persuade the editor of the spec that the abstract 'component' level described in the first draft of the spec was woefully underspecified and needed to be either fully specified or dropped. He dropped it, with (I think) good results for the readability and usability of the spec.

In 2010 I made an Alloy model of the XPath 1.0 data model, which uncovered some glitches in the specification. The reaction of most interested parties (including the W3C working group responsible for maintaining the XPath 1.0 spec) has, unfortunately, not been encouraging.

A research project I'm involved with has used Alloy to model the MLCD Overlap Corpus, a collection of sample documents and related information we are creating (hyperlinks suppressed at SO's insistence); the Alloy model found a couple of errors in our initial design for the corpus catalog, so it was well worth the effort.

And we have also used Alloy to formalize some modeling work we have done on the nature of transcription and on the extension of the type/token distinction to document structure (for our paper, look for the 2010 proceedings of Balisage: The Markup Conference). This lies a little bit outside Alloy's usual area of application, as it has nothing to do with software design, but Alloy's ability to check models for consistency and generate instances has been invaluable in showing us some of the logical consequences of this or that possible axiom for our model.

To answer your specific questions: yes, Alloy has helped me specify cleaner domain models, and yes, it has found errors and glitches. They have often been small, for the reasons Daniel Jackson explains in his book Software Abstractions: first, if you use models during design, you catch errors early, when everything is still small. And, second (in Jackson's words), "In hindsight, most software design issues are trivial."

He continues: "But if you don't address them head-on, trivial issues have a nasty habit of becoming nontrivial." My experience amply confirms this. Much better to head off such problems early. So yes, I will use Alloy again.

Fredricfredrick answered 16/8, 2012 at 19:31 Comment(3)
Thanks for the nice explanation. Do you you more resources that show some more metamodels. I am more looking to find some model diagrams (graphical diagrams) and would like to understand the hierarchical design with Alloy.Debris
Hi Michael, this is absolutely cool. I found this question accidentally; have you tried to model the XDM 3.1?Roti
@DimitreNovatchev, thank you. I did embark on that task once (for XDM 1.0, not 3.1), but did not get very far. The XDM avoids most of the problems I found in the XPath 1.0 spec, but walks into others. Unexpectedly, it has problems with the notion of tree (see bugs 12534 and 12535) and the responsible WGs were unwilling to fix the botched wording. So I gave up, for the time being.Fredricfredrick
C
5

Yes, I've used Alloy and it's cousins industrially. Alloy has been most helpful in convincing me that my models weren't wildly wrong---or rather, showing me where they were wrong and gave rise to silly results. Other more specific tools, like Song's Athena and Guttman and Ramsdell's CPSA have been more useful in their narrower domains. What more would you like to hear about?

Cavein answered 16/8, 2010 at 15:1 Comment(2)
Could you please provide links to the other tools you mentioned? It's not easy to search for them.Radiograph
I think perhaps this answer refer's to the Athena project here (probably no longer maintained by Professor Dawn Song at Berkeley), and CPSA here.Handal
R
5

Belatedly adding to this thread... Eunsuk Kang has recently applied Alloy to perform security analyses of web APIs for some start ups (following many applications of Alloy in security such as Apurva's analysis of OAuth and Barth et al's analysis of browser based security mechanisms for CSRF etc); Pamela Zave has been working on an impressive analysis of Chord, a peer to peer storage system, and has recently written up a fix to the original algorithm.

Retortion answered 25/11, 2014 at 17:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.