From c06444ba4f8cca0747b0c575fad7aec7b6559da5 Mon Sep 17 00:00:00 2001 From: Doriel Rivalet <100863878+DorielRivalet@users.noreply.github.com> Date: Thu, 20 Apr 2023 01:55:41 -0300 Subject: [PATCH] docs: add documentation for logging and testing --- docs/README.md | 2 ++ docs/deployment.md | 2 +- docs/logging.md | 23 +++++++++++++++++++++++ docs/testing.md | 9 +++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docs/logging.md create mode 100644 docs/testing.md diff --git a/docs/README.md b/docs/README.md index ec1e67e2..0cc52ba9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,6 +7,8 @@ - [Classes](./classes.md): displays the class structure of the software. - [Libraries](./libraries.md): lists the libraries used in this project. - [Palette](./palette.md): gives a list of RGB and hexadecimal color values with their corresponding labels that were used in the source code. +- [Logging](./logging.md): describes our structured logging implementation and goals. +- [Testing](./testing.md): explains our unit testing implementation and objectives. ## Type Hierarchy diff --git a/docs/deployment.md b/docs/deployment.md index 84ce3f56..279a292f 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -6,7 +6,7 @@ The following steps outline the process for releasing and deploying the software ### Releasifying and Deployment Steps -1. Switch to the release branch: Run `git checkout release` to switch to the release branch. +1. Run `git fetch` to check for the latest remote changes. Then switch to the release branch: Run `git checkout release` to switch to the release branch. 2. Pull the latest changes: Run `git pull origin release` to pull the latest changes from the remote release branch. 3. Make changes: Make the necessary changes to the software, and thoroughly test them in-game. Ideally, add unit tests to cover the changes and fix any new bugs with new commits. 4. Bump version: Update the version in the CurrentProgramVersion variable, following SemVer's specifications. diff --git a/docs/logging.md b/docs/logging.md new file mode 100644 index 00000000..5bf13d28 --- /dev/null +++ b/docs/logging.md @@ -0,0 +1,23 @@ +# Structured Logging + +## Overview + +Our software uses structured logging to provide a clear and concise record of events and operations that occur during runtime. To facilitate structured logging, we use [NLog](https://github.com/NLog/NLog), a free logging platform for .NET with rich log routing and management capabilities. + +### Logging with NLog + +We have implemented a labeling system to categorize log messages into three main categories: + +- DATABASE OPERATION: Log messages related to database operations. +- FILE OPERATION: Log messages related to I/O operations. +- PROGRAM OPERATION: Log messages related to any other operations. + +All logs are saved to a file called `logs.log`, which is located in the same directory as the program. In the event of a crash, crash logs will be created with information about the crash, including the date and time, in the file name. + +### Goals + +The main goals of our structured logging implementation are to: + +- Provide clear and concise logs that facilitate debugging and issue resolution. +- Categorize logs into relevant categories to help identify the source of issues. +- Ensure logs are easily accessible and stored in a standardized format. diff --git a/docs/testing.md b/docs/testing.md new file mode 100644 index 00000000..5f3fb028 --- /dev/null +++ b/docs/testing.md @@ -0,0 +1,9 @@ +# Unit Tests + +## Overview + +We use unit testing to ensure that our software performs as expected and to identify and address any issues or bugs before release. To facilitate unit testing, we use [xUnit](https://github.com/xunit/xunit), a free, open-source, community-focused unit testing tool for .NET. + +### Goals + +Our primary goal for unit testing is to achieve a code coverage of 90% or above. We use SonarCloud's shields icons to display the percentage of code coverage.