UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
Software Quality and Reliability
Vasileios Evangelos Athanasiou
Student ID: 19390005
Georgios Theocharis
Student ID: 19390283
Omar Alhaz Omar
Student ID: 19390010
Supervisor: Christos Troussas, Assistant Professor
Co-Supervisor: Akrivi Krouska, Assistant Professor
Athens, February 2024
This project involves the development of a C# class library (HRLib.dll) designed for personnel management tasks. It includes functions for data validation, encryption, and employee information processing, all verified through rigorous unit testing to ensure software reliability.
| Section | Folder/File | Description |
|---|---|---|
| 1 | assign/ |
Assignment instructions and lab material |
| 1.1 | assign/Lab Assignment- Part II.pdf |
Assignment description (English) |
| 1.2 | assign/Εργασία Εργαστηρίου- Μέρος ΙΙ.pdf |
Assignment description (Greek) |
| 2 | build/ |
Compiled project outputs |
| 2.1 | build/HRLib.dll |
Compiled HRLib library |
| 3 | docs/ |
Documentation and learning material |
| 3.1 | docs/Software-Development-in-C#-and-Reliability-using-Unit-Tests.pdf |
Documentation (English) |
| 3.2 | docs/Ανάπτυξη-Λογισμικού-σε-C#-και-Αξιοπιστία-με-Χρήση-Unit-Tests.pdf |
Documentation (Greek) |
| 4 | src/ |
Source code of the solution |
| 4.1 | src/HRLib/ |
Main HR library project |
| 4.1.1 | src/HRLib/Properties/ |
Assembly metadata configuration |
| 4.1.2 | src/HRLib/HRLib.csproj |
HRLib project configuration |
| 4.1.3 | src/HRLib/Personnel.cs |
Core personnel management implementation |
| 4.2 | src/UnitTestHRLib/ |
Unit test project for HRLib |
| 4.2.1 | src/UnitTestHRLib/packages.config |
NuGet package configuration |
| 4.2.2 | src/UnitTestHRLib/UnitTestHRLib.csproj |
Unit test project configuration |
| 4.2.3 | src/UnitTestHRLib/UnitTestPersonnel.cs |
Unit tests for Personnel functionality |
| 4.3 | src/HRLib_Project.sln |
Visual Studio solution file |
| 5 | README.md |
Repository overview and usage instructions |
ValidName(string Name)
Validates that an employee's name:
- Contains exactly two parts (First and Last name)
- Uses Latin characters only
- Follows capitalization rules (first letter uppercase, remaining letters lowercase)
ValidPassword(string Password)
Ensures passwords meet security requirements:
- Length between 12 and 24 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one digit
- At least one special character
CheckPhone(...)
Validates Greek phone numbers:
- Must contain exactly 10 digits
- Distinguishes landline numbers (starting with
2) - Distinguishes mobile numbers (starting with
69) - Identifies geographic zone or provider when applicable
EncryptPassword(string Password, ref string EncryptedPW)
Implements password encryption using a Caesar Cipher with an ASCII shift of 5, applied only after successful password validation.
InfoEmployee(...)
Calculates:
- Employee age
- Years of service
Business rules enforced:
- Employee age must be between 18 and 70 years.
LiveInAthens(Employee Empls)
Counts employees living in the Athens–Piraeus metropolitan area based on landline prefixes starting with 21.
Reliability is ensured through structured testing processes.
Systematic creation of valid and invalid test data for all functions.
Automated tests implemented using the [TestMethod] attribute in C# to verify correctness of functionality.
Test results include:
- Error identifiers
- Descriptions of performed audits
- Screenshots and reports from Test Explorer
- Language: C#
- Output: Function Library (DLL)
- Testing Framework: MSTest / Visual Studio Test Explorer
The Personnel Management Function Library provides validated, secure, and tested functionality for managing employee data, ensuring reliability and maintainability through comprehensive unit testing.
This guide explains how to install requirements, build the solution, and run the unit tests for the HRLib Personnel Management Library.
To build and run the project, you need:
- Windows OS (recommended for Visual Studio compatibility)
- Visual Studio 2019 or newer
- Workload: .NET desktop development
- .NET Framework Developer Pack (version required by project)
- Git (optional, for cloning the repository)
- Visual Studio Code (code viewing)
- NuGet Package Manager (included with Visual Studio)
Open a terminal or Git Bash and run:
git clone https://github.com/Software-Quality-and-Reliability/HRLib.git- Open the repository in a browser.
- Click Code → Download ZIP.
- Extract the archive to a folder on your system.
- Launch Visual Studio.
- Select Open a project or solution.
- Navigate to:
src/HRLib_Project.sln- Open the solution file.
Visual Studio will automatically load:
- HRLib class library project
- Unit test project
If prompted, restore dependencies automatically.
Or manually:
Tools → NuGet Package Manager → Restore NuGet PackagesTo compile the library:
Build → Build Solutionor press:
Ctrl + Shift + BAfter building, the compiled DLL appears in:
build/HRLib.dllor inside the project bin/ folder.
Unit tests verify correctness and reliability.
- Open Test Explorer:
Test → Test Explorer- Click Run All Tests.
All tests in
UnitTestHRLibshould execute automatically.
To use the compiled library:
- Copy
HRLib.dllinto another project. - Add reference:
Project → Add Reference → Browse- Select
HRLib.dll.
Then include namespace:
using HRLib;Successful setup provides:
- Compiled
HRLib.dll - Passing unit tests
- Test Explorer execution results
- Build output without errors
Run:
Restore NuGet Packagesor rebuild solution.
Ensure:
- Test project builds successfully.
- MSTest framework is installed.
Verify:
- Correct .NET Framework version installed.
- Visual Studio workloads include .NET desktop tools.
