Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swe-amr-abdelaziz/exam-simulator-cpp
A modern C++ console-based exam simulator with OOP, TDD, CI/CD, and Docker support.
https://github.com/swe-amr-abdelaziz/exam-simulator-cpp
builder-pattern clang-format continuous-integration cplusplus cpp data-structures-and-algorithms design-patterns docker dsa github-actions makefile modern-cpp object-oriented-programming oop standard-library tdd test-driven-development
Last synced: 1 day ago
JSON representation
A modern C++ console-based exam simulator with OOP, TDD, CI/CD, and Docker support.
- Host: GitHub
- URL: https://github.com/swe-amr-abdelaziz/exam-simulator-cpp
- Owner: swe-amr-abdelaziz
- Created: 2025-02-01T17:39:29.000Z (10 days ago)
- Default Branch: master
- Last Pushed: 2025-02-09T07:40:34.000Z (2 days ago)
- Last Synced: 2025-02-09T08:19:41.632Z (2 days ago)
- Topics: builder-pattern, clang-format, continuous-integration, cplusplus, cpp, data-structures-and-algorithms, design-patterns, docker, dsa, github-actions, makefile, modern-cpp, object-oriented-programming, oop, standard-library, tdd, test-driven-development
- Language: C++
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Exam Simulator in C++
A **console-based exam simulator** written in **modern C++**, designed with best practices in mind.
It follows **object-oriented principles**, applies **design patterns**, and leverages **test-driven development (TDD)** to ensure high code quality.---
## 🚀 Features & Best Practices
### ✅ **Software Design Principles**
- **Object-Oriented Programming (OOP)**: Utilizes **encapsulation, inheritance, polymorphism, and abstraction**.
- **Modularized Design**: Code is well-structured into **separate modules** for maintainability.
- **Design Patterns**:
- **Builder Pattern**: Used for both **validators** and **question builders** to facilitate unit testing.
- **Abstraction**: Applied to encapsulate complexity and expose only necessary functionality, following one of the core principles of OOP.### 🛠 **Modern C++ Features**
- **Smart Pointers**: Uses `std::unique_ptr` and `std::shared_ptr` for **automatic memory management**.
- **Move Semantics**: Improves performance by **avoiding unnecessary copies**.
- **Standard Library Usage**: Leverages **STL containers and algorithms** (`std::vector`, `std::optional`, etc.).
- **Lambda Expressions**: Used for cleaner, more concise code in various places.### 🔍 **Code Quality & Static Analysis**
- **Code Formatting**: Uses `clang-format` for consistent styling.
- **Static Analysis**: Runs `cppcheck` to detect potential issues early.
- **File & Folder Naming Convention**: Ensures a consistent naming convention across the project.### 📦 **Development & Automation**
- **Test-Driven Development (TDD)**: Implements **unit tests** to verify correctness.
- **Makefile**: Simplifies **compilation, running, testing, and memory leak checks**.
- **Shell Scripts**: Automates common tasks such as **code formatting, and generating test coverage reports**.---
## 🛠 **CI/CD Pipeline**
This project employs **GitHub Actions** for automated **Continuous Integration (CI)**.### 📜 **CI Jobs Workflow**
- **Check Files/Folders Naming Conventions**
- **Check Code Formatting**
- **Static Analysis with cppcheck and Upload cppcheck.xml**
- **Run Unit Tests**
- **Run Memory Leak Checks**
- **Generate Code Coverage and Upload Coverage Report**### 🐳 **Docker Integration**
- The **Dockerfile** is included for demonstration.
- The CI pipeline uses a **pre-built image from Docker Hub** (`amrswe/cpp-utils`) to **optimize build times**.---
## 📌 **How to Build & Run**
### **Build the Project**
```sh
make
```### **Run the Project**
```sh
make run
```### **Run Unit Tests**
```sh
make test
```### **Print Help Menu**
```sh
make help
```