Using LLMs to Extract OCL Specifications from Java and Python Programs:An Empirical Study

This paper presents a comprehensive study of the application of several open-source Large Language Models (LLMs) for abstracting Object Constraint Language (OCL) specifications from source code. We aim to provide researchers and developers with insights into the capabilities and limitations of using different LLMs to abstract OCL specifications from code.<br/>We evaluate a collection of open-source LLMs of comparable size (StarCoder2, LLaMA, CodeLlama, Mistral, and DeepSeek) by prompting them to generate OCL specifications for both Java and Python programs. The results show that both Mistral and DeepSeek outperform other LLMs in abstracting OCL specifications from both languages.

Authors

Publication Details

Journal
Research Portal (King's College London)
Published
2025-06-10
Primary Topic
Model-Driven Software Engineering Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Using LLMs to Extract OCL Specifications from Java and Python Programs:An Empirical Study

Kevin; id_orcid 0000-0002-9706-1410 Lano, Hanan; id_orcid 0009-0003-4693-8707 Siala
Research Portal (King's College London)
Model-Driven Software Engineering Techniques
article

Using LLMs to Extract OCL Specifications from Java and Python Programs:An Empirical Study

Kevin; id_orcid 0000-0002-9706-1410 Lano, Hanan; id_orcid 0009-0003-4693-8707 Siala
article en

Abstract

This paper presents a comprehensive study of the application of several open-source Large Language Models (LLMs) for abstracting Object Constraint Language (OCL) specifications from source code. We aim to provide researchers and developers with insights into the capabilities and limitations of using different LLMs to abstract OCL specifications from code.<br/>We evaluate a collection of open-source LLMs of comparable size (StarCoder2, LLaMA, CodeLlama, Mistral, and DeepSeek) by prompting them to generate OCL specifications for both Java and Python programs. The results show that both Mistral and DeepSeek outperform other LLMs in abstracting OCL specifications from both languages.

Research Portal (King's College London)
Openalex Percentile: Top 27%
Model-Driven Software Engineering Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Using LLMs to Extract OCL Specifications from Java and Python Programs:An Empirical Study — Kevin; id_orcid 0000-0002-9706-1410 Lano, Hanan; id_orcid 0009-0003-4693-8707 Siala · Research Portal (King's College London) (2025) | TGRS Research Map | TGRS