Connecting formal and legacy systems without a single line of code

By Gemma Church

Congratulations, you’re at the forefront of computer science by using model-driven software with formal methods that mathematically prove your software designs. But unless you’re building something from scratch, you also have millions of lines of legacy code that are developed the traditional way. And your new formal designs need to interact with that legacy code — without breaking anything.

That means writing adapters for your formal systems to communicate with the legacy systems, as well as anti-corruption patterns to protect the formal systems from unexpected behavior of the legacy systems.

Coding these by hand is not only time-consuming, but also error prone: while solving the primary problem, bugs or omissions in this intermediate layer are bound to create new and different problems.

There is a better way: automatic generation of those anti-corruption patterns and adapters.

Smile, that code will be auto-generated soon. Panagiotis Kotsis and Marco Alonso. (Photo: Bart van Overbeeke)

This could be achieved using an “interaction bridge”, which is an intermediate layer sitting between the formal and legacy systems. Marco Alonso, a software architect at ASML, explained: “We have observed that, although implemented differently, this ‘interaction bridge’ always has the same structure and functionality. Being always similar in nature allows us to believe that we can automate it and describe the required patterns that will allow generation.”

Alonso added: “We hope to provide our software engineers with a framework in which they only need to focus in the functional aspects of the development, the rest, when possible, will be automatically generated.”

Focusing on the development of new, innovative code without breaking or even worrying about a legacy code base sounds like development bliss. Not to mention the colossal amount of development time that will be saved.

But is full automation of such artifacts feasible? Maybe. An innovative project, done as part of the post-Master PDEng (Professional Doctorate in Engineering) program of the Technical University Eindhoven (TU/e) in cooperation with ASML, is investigating the boundary conditions and requirements needed to automate such communication layers.

Out with the old, in with the new

Panagiotis Kotsis, supervised by Alonso and TU/e associate professor Alexander Serebrenik, is exploring the automatic generation of anti-corruption and adapter patterns and, within the context of his project, he is using Model-to-Model transformations to create this intermediate layer.

Model-Driven Engineering (MDE) is used in combination with formal methods such as formal specification (with state-charts) and formal verification (by model-checking) to develop the intermediate system. Kotsis explained: “With an MDE approach, we can raise the level of abstraction, enhance consistency, and provide a functional-domain oriented process rather than an implementation oriented one.”

“By also using formal methods we can enhance and even ensure the safety and robustness of software designs, since a software-system that is formally specified and formally verified has a guaranteed behavior,” he added.

The ultimate aim of this work is to move from a document/code centric technique to a model-based technique to give greater focus to the functional development and less focus to the overhead required to interact with existing software. Alonso said: “We are in the process of creating an in-house modelling environment in which the model-based technique can be applied. This environment is already being used by ‘pilot’ projects whose feedback is used to define the roadmap and priorities of the tool.”

There are still hurdles to overcome for this project — such as creating the standards required for automation. Patterns, anti-patterns and desired functionality all need to be identified in such a way that a complete and usable tool is created.

To automate, parts of the model are standardized and you need to define how to specify certain constructs and how to achieve specific functionality, such as communicating with legacy systems. Alonso added: “This is a benefit in itself, documenting the patterns for interaction with legacy systems enable users to focus on the functional aspect of the model. All required artifacts that are needed to enable the interaction are then generated from standardized specifications and hence shortening the development time.”

It’s a lofty goal but an automated intermediary layer would free developers to focus on innovation, not working with legacy code bases. Kotsis said: “I am highly motivated on contributing to a faster and better software development process by researching and using the MDE approach, as I believe that this is the way to go in software engineering.”

This sentiment fits with ASML’s ambition to adopt model-driven engineering on a broad scale to bring modularization and automation to its software — while developing innovative tools to learn and extract models from the 45 million lines of its legacy code.

This is no small undertaking, particularly as these tools and methods (such as MDE) are not a core component of many current university curricula. So, through partnerships with institutions such as the Technical University Eindhoven, ASML is not just future-proofing its code base — but providing its staff with the cutting-edge skills they will need both to advance the field of software engineering and future-proof their own careers.

Do you want to help us push technology further? Find out more about careers in software development at ASML.

Gemma Church is a specialist UK-based journalist, blogger and copywriter for the science and technology sectors.