RSSAmplifier

Blog

Modular Moose | Blog

modularmoose.orgRSS feed ↗20 posts

Latest posts

Building an ownership cartography of a system - Part 2

When you share your work with others, such as the previous blog post, you can get feedback and suggestions for improvement. And this is exactly what happened. “The last step I wanted to investigate is to visualize the ownership of a system. I did not create a visualisation dedicated to this point yet.” You mean something like the Distribution Map? 😉 And by Distribution Map, we are talking about a…

Building an ownership cartography of a system

Context When managing a software system, it is important to know who is responsible for which part of the system. This information can be useful for various reasons, such as identifying potential bottlenecks, understanding the impact of changes, and improving collaboration among team members. One major threat could, for example, come from a developer leaving the team. This is often referred to as…

Improving the generation of visitors

Context Recently, I needed to implement a feature in FAST-Python requiring a visitor for my metamodel. People knowing me knows that I if I can automatize a task to save time and to keep the code coherant with the model, I’ll go for it. Nicolas Anquetil and Clotilde Toullec recently started to implement a visitor generator, so I tried it. Since it was a POC, I encountered some problems. I’ll…

Introducing Java initializers

In Java, we can define behavior that is executed exclusively at the initialization of an instance. For now, our metamodel represented these behaviors as methods. This evolution represents them as Initializers . What are initializers? We consider as initializers the following elements: Constructors: they are called when creating a new instance. When a constructor is called, if no explicit call is…

Speed up models creation: application to JSON/MSE parsing

Context In order to be able to work with Moose there is a prerequisite we cannot avoid: we need a model to analyze. This can be archieved in 2 principal ways: Importing an existing JSON/MSE file containing a model Importing a model via a Moose importer such as the Pharo importer or Python importer While doing this, we create a lot of entities and set a lot of relations. But this can take some…

Testing your algo on a java project

When developping algorithm on top of the Moose platform, we can easily hurt a wall during testing. To do functional (and sometimes unit) testing, we need to work on a Moose model. Most of the time we are getting this model in two ways: We produce a model and save the .json to recreate this model in the tests We create a model by hand But those 2 solutions have drawbacks: Keeping a JSON will not…

Generation of new FAST-Language metamodel using Pharo-Tree-Sitter project

If you’re here, you’re probably interested in creating a new FAST metamodel and expanding Moose to represent the AST (Abstract Syntax Tree) of an additional language. In this post, we explain to you how to generate a “First version” of a new FAST-Language metamodel using the project Pharo-Tree-Sitter. To be able to understand that, we assume you are already familiar with: Tree-Sitter…

Visualizing java dependencies between microservices

In July, I had to analyze the dependencies between microservices for Berger-Levrault . To do so, I chose to use the Moose tool. Here is the simple but effective process I followed. About the project structure The backend I analyzed follows a common pattern. In the git repository, there is a folder api containing the microservices, and a folder lib with resources for each microservice. There is…

Building a Famix importer with TreeSitterFamixIntegration

Analyzing source code starts with parsing and for this you need semantic understanding of how symbols in the code relate to each other. In this post, we’ll walk through how to build a C code importer using the TreeSitterFamixIntegration framework. Important The goal of this blog post is to provide a starting point on how to use the TreeSitterFamixIntegration framework to build a Famix importer.…

Parametrics next generation

How do we represent the relation between a generic entity, its type parameters and the entities that concretize it? The Famix metamodel has evolved over the years to improve the way we represent these relations. The last increment is described in a previous blogpost . We present here a new implementation that eases the management of parametric entities in Moose. The major change between this…

Creating an importer for an alien grammar

In this blog-post, we see some tricks to create a visitor for an alien AST. This visitor can allow, for example, to generate a Famix model from an external AST. In a previous blog-post, we saw how to create a parser from a tree-sitter grammar . This parser gives us an AST (Abstract Syntax Tree) which is a tree of nodes representing any given program that the parser can understand. But the…

Creating a Parser based on Tree-Sitter grammar

Moose is a huge consumer of language parsers. Relying on external tools help us with this. We are always looking into integrating new programming languages into the platform. There are two main requirements for this: create a parser of the language, to “understand” the source code create a meta-model for the language, to be able to represent and manipulate the source code Creating the meta-model…

First look at GitProjectHealth

When it comes to understand a software system, we are often focusing on the software artifact itself. What are the classes? How they are connected with each other? In addition to this analysis of the system, it can be interesting to explore how the system evolves through time. To do so, we can exploit its git history. In Moose, we developed the project GitProjectHealth that enables the analysis of…

Control Flow Graph for FAST Fortran

A Control Flow Graph analysis for FAST Fortran Control Flow Graphs (CFG) are a common tool for static analyzis of a computation unit (eg. a method) and find some errors (unreachable code, infinite loops) It is based on the concept of Basic Block : a sequence of consecutive statements in which flow of control can only enter at the beginning and leave at the end. Only the last statement of a basic…

Some tools on FAST models

The package FAST-Core-Tools in repository https://github.com/moosetechnology/FAST offers some tools or algorithms that are running on FAST models. These tools may be usable directly on a specific language FAST meta-model, or might require some adjustements by subtyping them. They are not out-of-the-shelf ready to use stuff, but they can provide good inspiration for whatever you need to do. Dumping…

A real example on using tags

A real example on using tags Tags can be a powerful tool to visualize things on legacy software and perform analyses. For example, tags can be used to create virtual entities and see how they “interact” with the real entities of the system analyzed. In the article Decomposing God Classes at Siemens we show how tags can be used to create virtual classes and see their dependencies to real classes.…

Generating a visitor infrastructure for a given meta-model

This post is part of a serie dedicated to Famix Tools Once we have a model of a program in Famix, we often find ourselves wanting to ¨ go through it” to apply some systematic analysis or modification. For example one could want to export the model as source-code https://github.com/moosetechnology/FAMIX2Java . The Visitor design pattern is well adapted for these tasks. Note that the double-dispatch…

Transformation journey (3/3) : Visualize and apply code transformations

Once again, let me welcome you to the final blog post in those three blog posts about code transformations! During the first blog post, we used queries and tools to locate the entities we seek to transform, before implementing the actual transformation logic in the second blog post. In this third post, we will use a visualisation window allowing us to check the source code of our entity before and…

Transformation journey (2/3) : Copying FASTs and creating nodes

Welcome back to the little series of blog posts surrounding code transformation! In the previous post, we started to build a transformation tool using a basic fictional transformation use case on the software ArgoUML. In this post, we will add behavior to the class we created previously, to achieve the actual transformation while making sure that we do not modify the original model in the process.…

Transformation journey (1/3) : Locating entities and nodes

Sometimes we have to perform several similar edits on our source code. This can happen in order to fix a recurring bug, to introduce a new design pattern or to change the architecture of a portion of a software. When many entities are concerned or when the edits to perform are complicated and take too much time, it can be interesting to consider building a transformation tool to help us and make…