Skip to content

C# personnel management library (HRLib.dll) implementing employee data validation, security features, and processing functions, verified through comprehensive unit testing for software reliability (Software Quality & Reliability, UNIWA).

Notifications You must be signed in to change notification settings

Software-Quality-and-Reliability/HRLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNIWA

UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS


Software Quality and Reliability

Software Development in C# and Reliability using Unit Tests

Vasileios Evangelos Athanasiou
Student ID: 19390005

GitHub · LinkedIn

Georgios Theocharis
Student ID: 19390283

GitHub

Omar Alhaz Omar
Student ID: 19390010

GitHub · LinkedIn

Supervisor: Christos Troussas, Assistant Professor

UNIWA Profile · LinkedIn

Co-Supervisor: Akrivi Krouska, Assistant Professor

UNIWA Profile · LinkedIn

Athens, February 2024


Personnel Management Function Library (DLL)

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.


Table of Contents

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

Core Features

1. Personnel Data Validation

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

2. Security

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.


3. Employee Management

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.


Quality Assurance & Testing

Reliability is ensured through structured testing processes.

Test Case Design

Systematic creation of valid and invalid test data for all functions.

Unit Testing

Automated tests implemented using the [TestMethod] attribute in C# to verify correctness of functionality.

Audit Reporting

Test results include:

  • Error identifiers
  • Descriptions of performed audits
  • Screenshots and reports from Test Explorer

Technical Implementation

  • Language: C#
  • Output: Function Library (DLL)
  • Testing Framework: MSTest / Visual Studio Test Explorer

Conclusion

The Personnel Management Function Library provides validated, secure, and tested functionality for managing employee data, ensuring reliability and maintainability through comprehensive unit testing.


Installation & Setup Guide

HRLib — Personnel Management Function Library (C#)

This guide explains how to install requirements, build the solution, and run the unit tests for the HRLib Personnel Management Library.


1. Prerequisites

To build and run the project, you need:

Required Software

  • 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)

Optional Tools

  • Visual Studio Code (code viewing)
  • NuGet Package Manager (included with Visual Studio)

2. Obtain the Project

Option A — Clone Repository (Recommended)

Open a terminal or Git Bash and run:

git clone https://github.com/Software-Quality-and-Reliability/HRLib.git

Option B — Download ZIP

  1. Open the repository in a browser.
  2. Click Code → Download ZIP.
  3. Extract the archive to a folder on your system.

3. Open the Solution in Visual Studio

  1. Launch Visual Studio.
  2. Select Open a project or solution.
  3. Navigate to:
src/HRLib_Project.sln
  1. Open the solution file.

Visual Studio will automatically load:

  • HRLib class library project
  • Unit test project

4. Restore NuGet Packages

If prompted, restore dependencies automatically.

Or manually:

Tools → NuGet Package Manager → Restore NuGet Packages

5. Build the Solution

To compile the library:

Build → Build Solution

or press:

Ctrl + Shift + B

After building, the compiled DLL appears in:

build/HRLib.dll

or inside the project bin/ folder.

6. Running Unit Tests

Unit tests verify correctness and reliability.

Run Tests in Visual Studio

  1. Open Test Explorer:
Test → Test Explorer
  1. Click Run All Tests. All tests in UnitTestHRLib should execute automatically.

7. Using the HRLib Library in Another Project

To use the compiled library:

  1. Copy HRLib.dll into another project.
  2. Add reference:
Project → Add Reference → Browse
  1. Select HRLib.dll.

Then include namespace:

using HRLib;

8. Expected Build Output

Successful setup provides:

  • Compiled HRLib.dll
  • Passing unit tests
  • Test Explorer execution results
  • Build output without errors

9. Common Issues & Fixes

NuGet Packages Missing

Run:

Restore NuGet Packages

or rebuild solution.

Tests Not Appearing

Ensure:

  • Test project builds successfully.
  • MSTest framework is installed.

Build Errors

Verify:

  • Correct .NET Framework version installed.
  • Visual Studio workloads include .NET desktop tools.

About

C# personnel management library (HRLib.dll) implementing employee data validation, security features, and processing functions, verified through comprehensive unit testing for software reliability (Software Quality & Reliability, UNIWA).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages