Return
AutoArk: A model-based approach for ArkTS application code generation
DOI:10.1016/j.scico.2026.103503.png)
Abstract
En 中文
With the rapid advancement of the Internet of Things (IoT) and 5G technology, the demand for application development targeting the HarmonyOS ecosystem is rapidly on the rise, encompassing an increasingly wide array of application scenarios and drawing the attention of numerous developers. However, the ArkTS development framework that HarmonyOS relies on introduces distinct features compared to other web frameworks. Unlike traditional frameworks, ArkTS employs a declarative UI syntax, integrated state management, and a unique layout system specifically tailored for HarmonyOS applications. These characteristics require developers to adopt different design and coding approaches, which can pose significant technical challenges, increase the learning curve, and elevate development difficulty for new developers. In this paper, we propose an efficient model-based HarmonyOS code generation approach named AutoArk, which enables developers to efficiently generate complete HarmonyOS applications through the construction of modeling languages, enabling users and product managers to promptly confirm requirements via visual models, thereby accelerating product requirement confirmation and iteration speed. AutoArk has designed a new meta-model and domain-specific modeling languages (DSLs) that capture the structural and behavioral aspects of ArkTS applications. The meta-model comprehensively represents GUI components, layout configurations, and logical workflows, allowing developers to define and organize these elements in a unified framework. We selected three commercial applications for comparative experiments on the HarmonyOS system. In these case studies, the results indicated the effectiveness of our approach. Compared to manual development for these specific tasks, the generated code achieved a CodeBLEU score of 63.5% and a correct generation rate of 98%. Furthermore, in our experimental setup, the development efficiency improved by approximately 3 times. With the assistance of a large language model for model construction, the efficiency in these cases was observed to increase by up to 16 times.
Keywords:
HarmonyOS applications
Model-driven
Meta-model
Domain-specific modeling languages
Code generation approach
Journal
S
IF:
1.4
Papers:
50
Citations:
1.6K

