QUICK REVIEW
[Paper Review] M3: An Open Model for Measuring Code Artifacts
Anastasia Izmaylova, Paul Klint|arXiv (Cornell University)|Dec 4, 2013
Software Engineering Research9 citations
TL;DR
M³ proposes an open, extensible, and composable model for representing source code artifacts using immutable, typed relations and URI-based source locations. Built within the Rascal programming language, it enables language-agnostic code analysis by decoupling parsers from metrics consumers through a standardized, serializable model that supports type inference, source tracing, and incremental composition of code metrics across projects and dependencies.
ABSTRACT
This document details design considerations of M3: a meta model for source code artifacts
Motivation & Objective
- To address the challenge of measuring code quality across diverse programming languages and metrics by creating a unified, extensible model for code artifacts.
- To decouple code extractors (parsers) from metrics and visualization tools through a standardized, language-agnostic model.
- To enable precise traceability of metrics back to source code via physical and logical URI-based locations.
- To support incremental and composable analysis of code across files, projects, and dependencies using immutable, persistent data structures.
- To provide a foundation for reusable, extensible code analysis pipelines in software analytics and evolution research.
Proposed method
- M³ models are built as immutable, typed relations between source code artifacts, using Rascal’s native support for sets, relations, and pattern matching.
- Source locations are modeled as URIs with schemes for physical (e.g., file://, project://) and logical (e.g., java+class://) identifiers, enabling traceability and stability across code movements.
- Core relations include containment (artifact hierarchy), declarations (mapping logical to physical locations), and uses (dependency tracking).
- Abstract syntax trees (ASTs) are reconstructed on-demand from model relations, with nodes annotated by source location and type information.
- Type symbols are modeled as first-class values to support parametric type reasoning and metric computation over generic types.
- Models are composed via explicit union and link operations: union fuses relations, while link updates authority fields to enable cross-project referencing.
Experimental results
Research questions
- RQ1How can a single, extensible model represent source code artifacts across multiple programming languages while preserving traceability to source code?
- RQ2What design principles enable decoupling of code extractors from metrics and visualization tools in a language-agnostic way?
- RQ3How can source location identifiers be designed to be both human-readable and stable under non-functional code changes?
- RQ4What mechanisms support incremental and composable analysis of code metrics across files, projects, and dependencies?
- RQ5How can type systems be modeled uniformly to support metrics involving parametric types and type instantiation?
Key findings
- M³ enables the construction of language-agnostic code analysis pipelines by standardizing on a minimal set of algebraic sorts (Expression, Declaration, Statement, Type, Modifier) for abstract syntax.
- The use of URI-based source locations allows precise, human-readable, and stable linking of derived metrics back to source code, supporting debugging and explanation of results.
- The model supports incremental analysis: volume metrics can be computed before fusing external dependencies, while depth-of-inheritance metrics require post-fusion access to all declarations.
- Type symbols are modeled as first-class values, enabling computation of metrics such as the number of possible instantiations of a generic type.
- The model has been successfully applied in academic courses and research projects at UvA and CWI, demonstrating usability in real-world software analytics workflows.
- Initial support for Java, C#, and PHP is underway, with extensions to control flow and program dependence relations planned.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.