# Roadmap to Reasoning in Microservice Systems: A Rapid Review
## 4 Architecture Reconstruction
### Analysis Techniques
#### 4.1.3 Hybrid Analysis  
Some representations can be constructed either statically or dynamically as shown in Table 1. A Service Dependency Graph (SDG) shows the dependencies between microservices. Static analysis techniques can extract full dependencies from the codebase artifacts, while the dynamic analysis techniques process the logs and tracing data to construct the executed dependency graph [1; 6]. It is the same for the Control Flow Graph (CFG), which is also known as the static call graph, and Method Collaboration Network (MCN) [32; 33]. The static analysis uses the source code to depict the internal process flows of the service, while the dynamic analysis uses runtime instrumental information to record all calls and returns that occur in a service's execution [35]. The constructed runtime paths group together the sequence of calls that correspond to a given request. Thus, the static analysis can extract the complete call network of the system. \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Representation** & **Definition** & **Technique** & **Level** \\ \hline \multirow{4}{*}{AST} & The Abstract Syntax Tree is a tree representation that conveys the structure of the source code. It is used by compilers to read code and generate the target binaries [21]. & Static & Service \\ \hline \multirow{4}{*}{CFG} & The Control Flow Graph is also called Static Call Graph and, for object-oriented software systems, is known as a Method Collaboration Network [32; 33]. Each CFG is associated with its semantic meaning in the system, where nodes are methods and edges are calls between these methods [34]. & Hybrid & Service \\ \hline \multirow{4}{*}{Models} & Class Collaboration Network (CCN): It represents the collaboration of classes and interfaces to reference each other. & Class Collaboration Network (PCN): It models the package collaboration, such that two packages are connected when a package contains a class that references at least one class belonging to the other package. & Static & Service \\ \cline{2-4}  & Domain Model: It is a conceptual model of the domain that incorporates both behavior and data relations. Both domain models and bounded context models are also part of a service description [28]. & Static & Service \\ \hline Technology Stack & It presents the programming language and technologies that are used in each microservice [1]. & Hybrid & Interaction \\ \hline \multirow{4}{*}{SDG} & The Service Invocation Chain indicates a sequence of service invocations between multiple microservices. It provides supplementary information to SDG to identify the system request paths [6]. & Hybrid & Interaction \\ \hline \multirow{4}{*}{Deployment Topology} & It represents the deployment distributions of microservices in a system. It shows information about physical infrastructure and which service instances are deployed onto which machine [1]. & Dynamic & Infrastructure \\ \cline{1-1} \cline{2-4}  & & & \\ \cline{1-1} \cline{2-4}  & & & \\ \cline{1-1} \cline{2-4}  & & & \\ \cline{1-1} \cline{2-4}  & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Intermediate representations summary. Service Invocation Chain (SIC) inspects request-related endpoints. The static analysis techniques can construct the SIC by assessing semantic control flows in the source code. On the other hand, it is straightforward to extract these dynamically through tracing data. However, the dynamic analysis can provide information about the strength of service interactions, which is essential to identify those services that must be scaled together [1; 3]. The collaboration between static and dynamic analysis techniques is necessary for extracting information as unused endpoints. Comparing the extracted full API description with the actual endpoint calls from the dynamic traces data [1]. It is also possible to identify the barely used or unused microservices. This could enhance the microservice system performance and size by removing these unused microservices instead of keeping them maintainable [1].