A FIX 4.2 protocol-based financial exchange simulator with comprehensive BDD testing framework. Built to demonstrate software testing expertise, test automation, and CI/CD practices.
Crucible is a real-time exchange system that processes orders using the FIX (Financial Information eXchange) protocol. The project includes a complete BDD testing framework, automated CI/CD pipeline, and professional test reporting capabilities.
Key Components:
- FIX 4.2 protocol server for order processing
- Real-time WebSocket dashboard for live market data
- REST API for order management
- SQLite database for persistence
- Optional C++ matching engine for high performance
- Comprehensive BDD test suite with Behave
- Python 3.12 or higher
- Git
git clone https://github.com/Demiserular/CRUCIBLE-EXCHANGE.git
cd CRUCIBLE-EXCHANGE
# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/Mac
# Install dependencies
pip install -r requirements.txtWindows:
.\start_all.batLinux/Mac:
chmod +x start_all.sh
./start_all.shOpen dashboard_minimal.html in your browser to access the trading dashboard.
Server Endpoints:
- Exchange Server (FIX): 127.0.0.1:9878
- WebSocket: ws://127.0.0.1:8765
- REST API: http://127.0.0.1:5000
# Run all tests
behave
# Run specific feature
behave features/order_matching.feature
# Generate Allure report
behave -f allure_behave.formatter:AllureFormatter -o allure-resultsThe test suite includes five comprehensive scenarios:
- Place a buy order - Validates basic order placement via FIX protocol
- Match buy and sell orders - Tests the order matching engine
- Reject invalid symbol - Verifies input validation
- Cancel an order - Tests order cancellation workflow
- Execute market order - Validates market order execution
- FIX protocol message construction and parsing
- Order placement and validation logic
- Order matching engine functionality
- Order cancellation flow
- Market vs. limit order handling
- Database persistence
Generate professional test reports using Allure:
Windows:
scripts\generate_report.batLinux/Mac:
./scripts/generate_report.shReports include test execution history, step-by-step breakdowns, failure analysis, and trend tracking.
The project includes a GitHub Actions workflow that automatically:
- Runs BDD tests on every push and pull request
- Executes code quality checks (pylint, flake8)
- Generates Allure test reports
- Deploys reports to GitHub Pages
View the workflow configuration in .github/workflows/test.yml
Crucible/
├── .github/workflows/ # CI/CD pipeline configuration
├── features/ # BDD test scenarios and step definitions
│ ├── environment.py # Test environment setup
│ ├── order_matching.feature
│ └── steps/
├── src/ # Application source code
│ ├── exchange_server.py # FIX protocol server
│ ├── api_server.py # REST API server
│ ├── fix_engine.py # FIX message handling
│ ├── database_sqlite.py # Database layer
│ └── matching_engine.cpp # Optional C++ matching engine
├── scripts/ # Utility scripts
├── tests/ # Test documentation
├── dashboard_minimal.html # Web-based trading dashboard
└── requirements.txt # Python dependencies
Application:
- Python 3.12
- FIX 4.2 Protocol
- WebSocket for real-time updates
- Flask for REST API
- SQLite for data persistence
- C++ for optional high-performance matching
Testing & Quality:
- Behave (BDD framework)
- Allure (test reporting)
- Pytest (unit testing)
- Pylint, Flake8, MyPy (static analysis)
DevOps:
- GitHub Actions (CI/CD)
- Git (version control)
- Testing Guide - Comprehensive guide for running and writing tests
- API Documentation - REST API reference
- FIX Protocol Guide - FIX message specifications
Tests hang or timeout:
# Ensure servers are running
.\start_all.bat
# Check if ports are available
netstat -ano | findstr :9878Connection refused errors:
# Start servers and wait for initialization
.\start_all.bat
timeout 5 # Wait 5 secondsImport errors:
# Reinstall dependencies
pip install -r requirements.txtContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/YourFeature) - Run tests to ensure everything works (
behave) - Commit your changes (
git commit -m 'Add YourFeature') - Push to your branch (
git push origin feature/YourFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Demiserular
- GitHub: @Demiserular
This project demonstrates proficiency in:
- Behavior-Driven Development (BDD) with Python
- Test automation framework development
- CI/CD pipeline configuration
- Protocol-level testing (FIX 4.2)
- End-to-end system testing
- Database integration testing
- Multi-threaded application testing
- Technical documentation
- DevOps practices
Built as a portfolio project to demonstrate SDET (Software Development Engineer in Test) capabilities including test automation, BDD methodologies, and CI/CD practices.