This project was developed for the subject LI3 from University of Minho - Software Engineering degree.
The project have some minor bugs due to our skill issues, and after the deadline nobody had the time to fix them, because we were focusing on other projects.
Although the project is not perfect, we are proud with the work we have done.
In some words, the goal of this project was to create a C program that could handle a large dataset of hotels, flights and reservations, and answer to some queries about the data. The solution should follow an encapsulated and modular approach.
If you want, you can read the project statement (in Portuguese).
The main goal of this subject was to learn how to develop a modular and encapsulated code, so we divided the code in some folders.
Represents the entities of the project, like user
, hotel
, flight
, airport
and reservation
. Each user/hotel/...
will have a struct allocated in memory to represent it, but the struct fields will be encapsulated from the remaining project.
Store all the entities of the project. Each catalog will use the data structures that best fits the solutions for the queries. We are using GLib to handle the trees
, lists
, arrays
and hash tables
.
The program flow is represented in the following image.
$ git clone https://github.com/Darguima/Trivial-Booking-LI3.git
$ git clone git@github.com:Darguima/Trivial-Booking-LI3.git
# Debian / Ubuntu / Mint
$ sudo apt-get install libglib2.0-dev libncurses-dev clang-format valgrind doxygen
# Arch
$ sudo pacman -S glib2 clang valgrind doxygen
Start by going to trabalho-pratico
folder:
$ cd Trivial-Booking/trabalho-pratico/
In order to test with "real" data, download our datasets:
$ wget https://github.com/Darguima/Trivial-Booking-LI3/releases/download/phase_1/dataset.zip
$ unzip dataset.zip
$ make
# With debug flags
$ DEBUG=1 make
# Executing program
$ ./programa-principal
$ ./programa-principal <dataset-folder> <input-file>
# Executing performance tests
$ ./programa-testes <dataset-folder> <input-file> <correct-output-folder>
This function clean
, format
and compile
in debug mode and execute
the project
$ make dev
$ make dev <dataset-folder> <input-file>
Will run Valgrind to detect memory leaks. This also compiles the code, and pass default params to the executable.
$ make check-memory
$ make check-memory <dataset-folder> <input-file>
Will run a python script that will check each output of the program with the expected output. (Not 100% accurate if have void file outputs)
$ make test
$ make clean
$ make format