# On Microservice Analysis and Architecture Evolution:
## 5 Results and Discussion
### RQ4: Future Research Directions  
We have assessed the identified literature for future work and open challenges. This section mentions our observations on static analysis, dynamic analysis, anomaly detection, prediction, migration from monoliths to microservices, and other topics we found open for research, such as visualization, architecture evolution, and benchmarks. The first significant conclusion we make is that all forms of static analysis seemed under-represented in the current literature. There is currently a greater focus on forms of dynamic analysis when analyzing microservices, leaving a gap for targeting statically defined artifacts. This kind of analysis can be done earlier in the development pipeline as the system does not need to be deployed for the analysis to take place, and it is less prone to false positives that may plague dynamic sources of information. However, the greatest challenge to address is to cope with distributed system nature and heterogeneity of system modules that may include distinct platforms, different versions and dependencies, or different development styles. Thus, future tools cannot just naively only consider Java as is the case for many works. Rather, a broad spectrum of languages such as Python, NodeJS, Go, C++, etc., must be considered to be well. The large amount of research involving graph-based architectural analysis has opened up many new avenues for future research. One such avenue could be using graph-based static-code analysis to identify the potential for architectural degradation early on. Deriving the system into a graph brings needed abstraction. Such an approach could be beneficial when resolving degradation, which is difficult to prevent, or at least it could identify it early on. With respect to dynamic analysis, we found multiple obstacles. There is considerable data collection overhead to collect metrics. In fact, a huge number of traces are produced at runtime, which makes it challenging to capture the required information in real time. In particular, the trace data need to be efficiently processed to produce aggregated trace representations of different levels of quality, and such detailed information of specific traces might need to be available on-demand. Even if we manage that, we need to store the data and analyze them. Thus, research must consider tracing microservices at a massive scale. This is rarely the case because of lacking benchmarks, which we mention later. Researchers questioned which metrics should be monitored and whether the metrics' accuracy or their impact on performance has been considered at large scales. Dynamic analysis is often involved in anomaly detection and especially root cause analysis. In this context, [PERSON] et al. [47] highlighted the need for taking into account a time dimension, where the evolution of the system during a time window can be compared instead of single snapshots. However, what remains a challenge is the comparison between generated graphs representing the snapshots. This can be parallelized, but the search space and the response time need to be reduced for real-time processing. They proposed one way to address by transforming graphs into vectors to feed machine learning models dealing with anomaly detection, but this was just their vision for future work. Given machine learning, multiple works suggested the use of machine learning in this context, while statistical analysis can also be used for root cause analysis. We also found little relevant research on using machine learning as a primary method for microservice analysis. The only notable work that used machine learning as a primary method of analysis was written by [PERSON] et al. [43], where a Robust Component Principal Analysis algorithm was used alongside dynamic analysis to detect anomalies. [PERSON] et al. [45] briefly mention the potential of using machine learning-based algorithms for improving fault localization. Other than the mentions in these articles, there were not any other notable instances of machine learning used as a primary method.