Keywords

1 Problem Statement

Distributed computing has become a de-facto standard execution model for the majority of application domains. Web-based applications, mobile applications, IoT setups, embedded systems—all make use of remote execution. It is well known that the majority of software engineering effort and costs is spent on software maintenance and evolution [5, 6]. In distributed applications—adaptive, corrective, and perfective modifications are particularly hard, due to the potential presence of server/middleware misconfigurations and network volatility. These mainstay conditions of distributed execution hinder the most important phase of the maintenance process: determining the exact causes of problems to solve and the locations in the code that implement them.

In my dissertation, I explore a new approach that facilitates a large class of evolutionary modifications in distributed applications. This approach puts forward a novel, domain-specific automated refactoring—Client Insourcing—that moves remotely executed functionalities to be executed locally, thereby creating a semantically equivalent centralized version of the distributed application. This centralized version is then used to perform evolutionary modifications.

The cognitive load required to understand, trace, and modify the source code is much lower for centralized applications than for distributed ones. Distributed applications have a complex control flow and suffer from partial failure, being affected by their middleware frameworks, distributed infrastructure configurations, and network environments. The novelty of my research is in reducing the problem of evolving a distributed application by enabling programmers to operate on its equivalent centralized version. Of course, not all software evolution tasks are amenable to this approach. Hence, one of the objectives of my dissertation is to determine this approach’s exact range of applicability.

2 Related Work

The research community has extended a considerable amount of effort to facilitate the comprehension and evolution of distributed applications. In modern enterprise software development, the remote parts of a distributed application are written to interact with each other by means of some middleware framework, based on synchronous or asynchronous communication paradigms. Since the presence of middleware is known to hinder maintenance tasks, several prior approaches have focused on facilitating these tasks. A dynamic analysis platform analyzes full-stack JavaScript applications by abstracting away middleware communication, so it can be emulated in dynamic profiling scenarios [7]. [2] studies implicit relations between asynchronous and event-driven entities, spread over the client and server sides of a distributed execution. Static analysis based on formal reasoning calculus has been applied to understand how asynchronous communication constructs (i.e., callback, promises) are used in distributed event-based JavaScript programs [12, 13]. These prior approaches conquer the complexity introduced by middleware functionality through abstraction and modeling techniques. However, modern middleware frameworks do not lend themselves easily to being abstracted away or modelled faithfully, due to a high variability in their execution behavior as a result of dissimilar configuration options and network volatility. My approach can effectively address many of these scenarios, in which it is advantageous to completely take middleware out of the picture, so the performed maintenance tasks can focus solely on the programmer-written code, adapting and perfecting it for the ever changing requirements.

3 Research Objectives and Progress

My dissertation research explores a radical notion: a centralized equivalent of a distributed application can serve as a faithful surrogate for various maintenance and evolutionary tasks. By taking all distribution and middleware harness out of the picture, my approach makes it possible for maintenance programmers to focus exclusively on the programmer-written code, adapting and perfecting it as required by ever changing requirements. In particular, my approach can be applied to various debugging tasks, security sandboxing [1], and fault-handling adaptations as shown in the Fig. 1.

Fig. 1.
figure 1

Facilitated evolutionary tasks by using insourced surrogates

3.1 Progress So Far

The heterogeneity of the web architecture allows for flexible mixing of dissimilar languages and frameworks, used at the client and server ends of web applications. Nonetheless, using the same programming language for both the client and server parts is increasingly gaining prominence. Cross-platform web applications are written in JavaScript by using various application frameworks. These applications can run their client functionality in a web browser on any platform. The server functionality is typically implemented by means of the Node.js framework. Distributed applications, in which both the client and server parts are implemented in JavaScript are referred to as full-stack JavaScript applications.

Thus far, the focus of my dissertation research has been on the domain of full-stack JavaScript applications. The ability of operate in such a monolingual environment allows for making certain simplifying assumptions, required to create a working proof of concept. However, my long-term vision is to extend my approach to multilingual distributed applications, implemented and maintained in different languages. To that end, I plan to investigate how automatic language translation technologies can be applied to my code analysis and transformation infrastructure (See Fig. 2).

To gain a deeper insight into the issues of automatic language translation, I explored how Java-to-Swift translations rules can be inferred from a set of cross-platform mobile applications, maintained in both languages to support both Android and iOS mobile users [3]. This experience has prepared me to be able to tackle the challenges of multilingual Client Insourcing and all the evolutionary modifications enabled by this refactoring.

Multilingual Virtual Machine (MVM) executes programs written in multiple programming languages within the same interpreter [8,9,10]. For multilingual distributed applications, this approach can be a viable alternative to translating the insourced code segments from the server language to the client one. With MVM, the insourced functionality can be integrated into the client code in the intermediate language-agnostic representation, thus bypassing the need for source-to-source translation.

Fig. 2.
figure 2

Client Insourcing for multilingual distributed applications

4 Research Questions

My dissertation research is driven by the following general questions.

  • RQ1. Client Insourcing Value, Correctness, and Applicability: How much programmer effort does Client Insourcing save? What are the preconditions for this refactoring’s successful application? Can one identify those distributed functionalities to which Client Insourcing can be applied to create their centralized equivalent?

  • RQ2. Applicability to Facilitating Evolutionary Modifications: What kind of evolutionary tasks can be facilitated by Client Insourcing? What architectural principles must distributed applications possess to be amenable to our modification approach? If an application cannot benefit from my approach, can it be refactored for my approach to become amenable?

  • RQ3. Maintaining Semantic Equivalence in the Presence of Client Insourcing Enhanced with Language Translation: How feasible is it to maintain the business logic of a distributed multilingual application by transforming it into a centralized monolingual application? To which source/target languages can this transformation be applied? How much does this transformation affect the cognitive load of evolutionary modifications?

5 Remaining Work

The remaining work of this dissertation research will answer the research questions 2 and 3 above. I am currently investigating the applicability of Client Insourcing as a means of facilitating various evolutionary modifications of full-stack JavaScript applications. Centralized applications can be used as input for various automated distribution approaches, a research area that has received a lot of attention from the research community. For example, in our own research, we introduce compiler-based techniques that enable real-time systems to take advantage of trusted execution environments by automatically placing the functionality needing protection into a separate secure partition [11]. Finally, the automatically generated code of Client Insourcing can be used to put in place certain fault-handling strategies that handle various network communication problems. After this research is carried out and published, I then plan to apply my approach to multilingual distributed execution environments, with an initial target JavaScript client & Java server; due to the maturity of Java to JavaScript automatic translation tools, I am confident that it should be feasible to create a working proof of concept in a timely fashion.

6 Conclusions

In this manuscript, I have described my dissertation research, concerned with the challenges of evolving distributed applications to meet the continuously changing functional and non-functional requirements. My research puts forward a radical notion that a centralized equivalent can serve as a faithful proxy of a distributed application for many software maintenance and evolution tasks. We have successfully applied my approach to reduce the complexity of tracing and removing certain types of bugs in full-stack JavaScript applications. The remaining work will apply this approach to security sandboxing and fault-tolerance adaptations as well as extend the approach to distributed multilingual applications.