Choreia

module
v0.0.0-...-293c848 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2022 License: GPL-3.0

README

Choreia

A static analyzer to generate Choreography Automata from Go source.

What is

Aim of this project is to write a complete static analyzer that will parse and extract metadata from a Go source file and from that extrapolate a Choreography Automata, that is a Finite State Automta (FSA) that represents how the different Goroutines interact with each other during the program execution flow.

Some of the use cases of such program could be:

  • Debugging pouposes: The program will output a SVG file that represents Choreography Automata and this can be a visual aid to debugging complex distributed systems
  • Correctness and well-formedness: If the final Choreography Automata fullfills some properties such as Correctness and Well-formedness that in turn allows for some assumption to be made about our program and the interactions occuring between its parts
  • Visual interpretation of protocols: This tool can be used to visualize both standard and proprietary comunication-based protocol, to do so we need only a mock implementation of our protocol in Go and the tool will take care of the visualization

How to

Before running the project you need to install some dependencies with the go get command, after that you can run the project with:

usr@computer:~/Choreia$ go run choreia/main.go -i input_file.go

or optionally build it and then running it as a standalone executable:

usr@computer:~/Choreia$ go build o your_path choreia/main.go
usr@computer:~/Choreia$ ./your_path choreia/main.go -i input_file.go

the latter is especially indicated when parsing large files as the compilation increases the execution speed. In addition -i arg to indicate the input file, other CLI argument are the following:

Shorthand Extended Usage Default
-i --input The path to the Go source file
-o --output The path to where the data wll be saved ./choreia_out
-t --trace Prints to the stdout a trace of the AST while parsing
-h --help Show help message and usage instructions

Credits & Licensing

This project was made by me as Bachelor's degree Thesis for the Computer Science course at University of Bologna. Special thanks to the professor Ivan Lanese and to each contributors of the library used as dependencies.

Directories

Path Synopsis
This is the entry point of the whole program (Choreia).
This is the entry point of the whole program (Choreia).
internal
data_structures/fsa
The only method available from the outside are FSA and its API
The only method available from the outside are FSA and its API
static_analysis
Package static_analysis declares the types used to represent metadata extracted from the Go source.
Package static_analysis declares the types used to represent metadata extracted from the Go source.
transforms
Package transforms declares the types and functions used to transform and work with some type of FSA.
Package transforms declares the types and functions used to transform and work with some type of FSA.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL