Skip to content

As a student in the Master's program in Software and Data Engineering, I am currently enrolled in a Software Analysis course. In this repository, I will share the work we did and the technologies we used in the course.

License

Notifications You must be signed in to change notification settings

24luca24/software-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Software Analysis

As a student of the Software Analysis course, I would like to share what we have done and what technologies we have used in this course.

In this course, we will complete three assignments, each focusing on different software analysis techniques.

📌 Assignments Overview

Assignment Technology Focus
Assignment 1 Dafny Algorithm Verification
🔧 Assignment 2 Infer Project Bug Detection
🔄 Assignment 3 Spin Concurrency Model Checking

Assignment 1: Algorithm Analysis with Dafny Dafny

Dafny is a formal static verification tool that allows you to write and verify programs with mathematical guarantees. It supports specifications such as preconditions, postconditions, and loop invariants.

🧠 What I Did:

The goal of this assignment was to gain hands-on experience with Dafny by analyzing algorithms such as Selection Sort, Insertion Sort, Quicksort, and Mergesort. The algorithms I chose are:

  • Selection Sort (verifying sorted and permuted element properties)
  • Quicksort (verifying only the permuted property)

▶️ How to Run:

After installing Dafny and its extension in VSCode, you can compile and verify an algorithm using the following command:

dafny build algorithmName.dfy

Assignment 2: Project Analysis with Infer Infer

Infer is a static analysis tool developed by Facebook that automatically detects bugs in code before it runs. It can find issues such as null pointer exceptions, resource leaks, and concurrency errors, helping improve software quality by identifying potential problems early.

🧠 What I Did:

In the infer folder, you will find two subfolders: before and after. The before folder contains the original project code, while the after folder contains the same project but improved by fixing the issues that Infer identified. This demonstrates how static analysis can guide bug fixing and enhance code reliability.

To see more about how I execute the project, and what the project is about, go in the folder and you will found a report explain everything I did.

Assignment 3: Model checking with Spin Dafny

Spin is a widely used open-source software model checker designed for verifying the correctness of distributed software models. It uses the Promela (Process Meta Language) modeling language to describe system behaviors and allows formal verification of properties such as safety and liveness expressed in Linear Temporal Logic (LTL).

🧠 What I Did:

The goal of this assignment was to build a Promela model simulating multiple worker threads completing tasks either in ordered or random sequences. Then, I defined and verified several LTL properties using Spin to check correctness, including eventual completion of all tasks and consistency conditions. Counterexamples produced by Spin helped analyze potential violations and improve understanding of concurrent behaviors. (More information about the assignment are in the "Spin" folder, there you can find also my report where I explain what I did in details)

▶️ How to Run:

After installing Promela extention on VSCode, you can run the script.sh, inside the Spin folder, which contain instruction used to run the program and verify the properties.

./script.sh

About

As a student in the Master's program in Software and Data Engineering, I am currently enrolled in a Software Analysis course. In this repository, I will share the work we did and the technologies we used in the course.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •