Introducing Go-Architect
Tags: go, architecture, guidelines, codequality
Published: 2023-12-22 14:50:27

## Summary
In this article, I will introduce you to a tool called [Go-Architect](https://go-architect.github.io/), we will see its main features and how it can be used to analyze the architecture of a project in Go language.

### TL/DR
You can find the complete project documentation at [https://go-architect.github.io/](https://go-architect.github.io/)

## What is Go-Architect?
Go-Architect is a Software Architecture Analysis Tool for projects written in Go language. You can use this tool to analyze the design of your artifacts in order to ease decisions related to refactoring your code, fixing issues or evolving the artifact's features. 

![Go-Architect First View](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/af8vhnfi3pwceoixkaqh.png)

### Why we should use an Architecture Analysis Tool?
Software Architecture Analysis Tool are used to improve quality and maintainability of software architectures.

There are some benefits for using this kind of tools, like:
- _**Early Detection of Design Flaws:**_ Architecture analysis tools can help identify design flaws, inconsistencies,
or violations of architectural principles before they become critical issues, saving time and resources by addressing problems
when they are easier and cheaper to fix.
- _**Quality Assurance:**_ These kind of tools can enforce best practices, coding standards and clean architecture concepts, ensuring that the software architecture adheres to established guidelines.
- _**Enhance Maintainability:**_ Ensuring that our architecture adheres to established architectural guidelines over time.
- _**Architectural Evolution Analysis:**_ This tools offers several ways to analyze (in different ways) the changes in software architecture over the time.

## Features
Go-Architect Provides the following set of analysis tools.
![Analysis Tools](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdrg9b5hkjkur6ws5fju.png)

### Project Metrics
This Tool display common metrics used to have a quick idea of the size and complexity of our project.
![Project Metrics Tool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9b5wpcvz8yfzbvmfqtc.png)

### Dependencies Graph
The Dependency Graph is a visual representation that illustrates the relationships and dependencies between packages in a software artifact. It helps developers and maintainers understand packages relations, which is crucial for managing and building complex software projects.
![Dependencies Graph Tool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0l82sitwzqw742gfesj.png)

### Dependency Structure Matrix
The Dependency Structure Matrix (DSM) Tool is a graphical representation used to visualize and analyze dependencies between packages in a Project.
![Dependency Structure Matrix Tool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ww29eg7iqmu6ckjxs1fy.png)

### Instability & Abstractness
The Instability v/s Abstractness Graph is a powerful tool used to analyze how maintainable, flexible, and easy to understand is an artifact.
![Instability and Abstractness Tool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2rdc92818pc2t0f0m6s.png)

### Dependency Coupling Analysis
Dependency Coupling Tool helps us to detect how coupled is our artifact with a specific dependency, that can be an internal, same organization, external or a standard package. 
![Dependency Coupling Tool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q84hzzdqx8qkyfyhtuc9.png)

### VCS Analysis
This tool is focused on analyze the VCS history of the artifact, displaying some information about contributions and changes over packages/files in the artifact.
![VCS Analysis Tools](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u43sx2b59bqli1abg8o7.png)

## Installation

### Requirements
- Go v1.19 (https://go.dev/doc/install)
- GoCyclo (https://pkg.go.dev/github.com/fzipp/gocyclo) for Cyclomatic complexity metrics
- GoCognit (https://pkg.go.dev/github.com/uudashr/gocognit) for Cognitive complexity metrics

### Installation Process
At the moment, installing Go-Architect can only be done manually, by executing the following commands:
```bash
git clone https://github.com/go-architect/go-architect
cd go-architect
make install
```


## Conclusion
In this article, we have explored the basics of Go-Architect, an Architecture Analysis Tool for Go projects that can be used to improve maintainability, detect design flaws and ensure quality in your project.

You can find the project documentation at [https://go-architect.github.io/](https://go-architect.github.io/)