Integrated Language Definition Testing

commentsJune 13, 2011

This paper describes an extension of Spoofax with support for testing of language definitions including the testing of editor services for a language. The language fragments in tests get the same editor support as in regular editors.

Lennart C. L. Kats, Rob Vermaas, Eelco Visser. Integrated Language Definition Testing. Enabling Test-Driven Language Development. In Proceedings of the 26th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2011. ACM, Portland, Oregon, USA, 2011.

Abstract The reliability of implementations of language definitions – compilers, interpreters, and development environments – is essential for effective software development and maintenance. They are often tested only as an afterthought. Languages with a smaller scope, such as domain-specific languages, often remain untested. General-purpose testing techniques and test case generation methods fall short in providing a low-threshold solution for test-driven language development. In this paper we introduce the notion of a language-parametric testing language (LPTL) that provides a reusable, generic basis for declaratively specifying language definition tests. We integrate the syntax, semantics, and editor services of a language under test into the LPTL for writing test inputs. This paper describes the design of an LPTL and the tool support provided for it, shows use cases using examples, and describes our implementation in the form of the Spoofax testing language.

Linguistic Abstraction for the Web

commentsJune 8, 2011

Today I gave a TechTalk at Google Mountain View about "Linguistic Abstraction for the Web".

Abstract Our programming languages have been developed for the single machine programming model, while our current computing environment is distributed and parallel. For example, web applications are programs that run on three different machines, client, server, and database. This results in boilerplate code for encoding communication between layers, and it leads to polyglot programming with limited cross language consistency checking, leading to late detection of failures.

Domain-specific languages (DSLs) address these problems by providing abstractions and notations that allow direct and understandable expression of domain concepts instead of encoding these in a lower level programming language. Since DSLs are typically used by a smaller audience, efficient design and implementation of DSLs is crucial to make introduction possible at all. To enable software engineers to effectively design, implement, and apply domain-specific languages, we have developed the Spoofax Language Workbench, an integrated development environment (IDE) for interactive definition for languages and their IDEs based on declarative language definitions. Spoofax supports editing of language definitions and use of editors generated from those definitions in the same environment.

With Spoofax we have developed WebDSL and Mobl. WebDSL is a DSL for development of web applications, which integrates sub-languages for data modeling, UI templates, access control, and data validation from which generate Java, SQL, and JavaScript code is generated to run on server, database, and browser. Mobl is a high-level declarative language for mobile web applications, which generates HTML5 applications that run in the browser. Both languages provide full compile-time cross-concern consistency checking.

In the presentation, I will show how the use of languages such as WebDSL and Mobl greatly simplifies software development, and how a language workbench such as Spoofax brings language design and development into reach of software developers.

Generating RSS Feeds

commentsJune 7, 2011

Another bug report about this blog concerned various details of the RSS feed. I gave up on RSS readers soon after I started using them because of the overflow of information they generated. I find that twitter now provides a good flow of links to interesting stuff, that is auto cleansing. (And it appears RSS might be going out of fashion in general.)

Anyway, my excuse for never looking into the details of RSS. Based on a little study of the RSS 2.0 Specification I refined the feed definition of my blog application. It should be quite reusable in other WebDSL applications, although I couldn't figure out a way to make it completely automatic. Actually while writing that last sentence I got an idea for improving abstraction, which I'll discuss below.

While testing the improved RSS feed, I got back into RSS reading. The tricks seems to be in not subscribing to too many feeds, and in particular to avoid the high volume feeds generated by news organizations.

Read more

Reconstructing Complex Metamodel Evolution

commentsJune 5, 2011

The difference between two data models in the evolution of an application can be expressed in terms of primitive edit operations such as addition or removal of elements. However, these low-level edit operations don't express the intent of the evolution and are therefore not suitable as starting point for database migration. In this paper, which has been accepted for the SLE 2011 conference, an algorithm for reconstructing complex evolutions from a primitive evolution trace is presented.

Sander Vermolen, Guido Wachsmuth, Eelco Visser. Reconstructing Complex Metamodel Evolution. In Uwe Aßmann, Anthony M. Sloane, editors, Software Language Engineering, Fourth International Conference, SLE 2011, Braga, Portugal, July, 2011, Revised Selected Papers. Springer, 2011.

Abstract Metamodel evolution requires model migration. To correctly migrate models, evolution needs to be made explicit. Manually describing evolution is error-prone and redundant. Metamodel matching offers a solution by automatically detecting evolution, yet detects primitive evolution steps only. In practice, primitive evolution steps are jointly applied to form a complex evolution step, which has the same effect on a metamodel as the sum of its parts, yet generally has a different effect in migration. Detection of complex evolution is therefore needed. In this paper we present an approach to reconstructing complex evolution between two metamodel versions, using a matching result as input. It supports operator dependencies and mixed, overlapping and incorrectly ordered complex operator components. It also supports interference between operators, where the effect of one operator, is partially, or completely hidden from the target metamodel by other operators.

An Algorithm for Layout Preservation in Refactoring Transformations

commentsJune 3, 2011

We are adding support for definition of refactorings to Spoofax. An essential ingredient for refactorings is that the layout of the transformed program is minimally affected. In this paper, which has been accepted for the SLE 2011 conference, we present an algorithm that reconstruct the text of a program after refactoring, using the layout of the original program where possible.

Maartje de Jonge, Eelco Visser. An Algorithm for Layout Preservation in Refactoring Transformations. In Uwe Aßmann, Anthony M. Sloane, editors, Software Language Engineering, Fourth International Conference, SLE 2011, Braga, Portugal, July, 2011, Revised Selected Papers. Springer, 2012.

Abstract Transformations and semantic analysis for source-to-source transformations such as refactorings are most effectively implemented using an abstract representation of the source code. An intrinsic limitation of transformation techniques based on abstract syntax trees is the loss of layout, i.e. comments and whitespace. This is especially relevant in the context of refactorings, which produce source code for human consumption. In this paper, we present an algorithm for fully automatic source code reconstruction for source-to-source transformations. The algorithm preserves the layout and comments of the unaffected parts and reconstructs the indentation of the affected parts, using a set of clearly defined heuristic rules to handle comments.

Previous12345678910111213141516...333435Next