Skip to content

vinipx/QUANTAF

Repository files navigation

QUANTAF

High-Frequency Assurance Engine for Testing

Java 21 Gradle License GitHub Actions Docker QuickFIX/J LangChain4j Allure Reports

A robust, enterprise-grade test automation framework for validating complex financial transaction lifecycles across heterogeneous protocols (FIX, SWIFT, MQ, REST) with mathematical precision.


🎯 Overview

QUANTAF is the High-Frequency Assurance Engine designed for testing mission-critical financial systems. It provides a comprehensive, layered architecture that separates protocol handling, business logic, AI/ML features, and test execution into cleanly decoupled, independently testable components.

Perfect For:

  • πŸ“ˆ Trading Platforms β€” End-to-end order execution testing
  • πŸ”„ Settlement Engines β€” Reconciliation and settlement validation
  • πŸ’° Financial Institutions β€” Compliance and regulatory testing
  • ⚑ High-Frequency Systems β€” Load testing with 1000s of transactions/sec
  • πŸ€– AI-Driven Testing β€” NLP-powered scenario generation

πŸ—οΈ Architecture

QUANTAF is structured in 4 Concentric Layers for clean separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Layer 4: Test Definition                               β”‚
β”‚  TestNG | Cucumber BDD | Scenario-Driven Tests          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Layer 3: AI Cortex                                     β”‚
β”‚  NLP-to-FIX | Smart SWIFT | LLM Providers               β”‚
β”‚  LangChain4j | OpenAI | Ollama                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Layer 2: Logic Core                                    β”‚
β”‚  MarketMaker | TradeLedger | Domain Models              β”‚
β”‚  Business Rules | Reconciliation                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Layer 1: Protocol Adapters                             β”‚
β”‚  FIX (4.2/4.4/5.0) | SWIFT | MQ | REST OAuth2          β”‚
β”‚  QuickFIX/J | RestAssured | JMS                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       ↓
            Financial Systems Under Test

πŸ“– Learn More About Architecture β†’


✨ Key Features

Protocol Support 🌐

Protocol Version Features
FIX 4.2, 4.4, 5.0 Full message types, session management, persistence
SWIFT All MT Categories Message validation, schema compliance, stubs
Message Queue ActiveMQ, RabbitMQ, Custom JMS, broker abstraction, pluggable
REST HTTP/HTTPS OAuth2, request/response logging, assertions

AI & Intelligent Features πŸ€–

  • NLP-to-FIX Translation β€” Convert natural language to FIX messages
  • Smart SWIFT Generation β€” Context-aware, realistic SWIFT message stubs
  • Scenario Generation β€” AI-powered edge case and load test generation
  • Pluggable LLMs β€” OpenAI (GPT-4), Ollama (local), custom providers

Testing Modes

  • TestNG β€” Direct Java testing with full IDE support and debugging
  • Cucumber BDD β€” Human-readable feature files for non-technical stakeholders

Enterprise Features

βœ… Rich Reporting β€” Allure Reports with timeline, trends, and analytics
βœ… CI/CD Ready β€” GitHub Actions, Jenkins, GitLab CI/CD integration
βœ… Local Development β€” Docker Compose with pre-configured services
βœ… Container Testing β€” Testcontainers for ephemeral infrastructure
βœ… Security β€” OAuth2, TLS/SSL, encrypted messaging
βœ… Extensibility β€” Custom protocol adapters, business logic, assertions
βœ… Performance β€” Sub-millisecond latency, 1000s of transactions/sec
βœ… Documentation β€” Comprehensive guides and 100+ code examples


πŸ› οΈ Tech Stack

Core Technologies

Category Technology Version
Language Java 21 (LTS)
Build Gradle Latest
FIX Protocol QuickFIX/J 2.3.1
HTTP Client RestAssured 5.4.0
Math/Stats Apache Commons Math 3.6.1
LLM Integration LangChain4j 0.35.0
Test Runners TestNG 7.10.2
BDD Framework Cucumber 7.18.0
Reporting Allure 2.27.0
Messaging Jakarta JMS 3.1.0
Containers Testcontainers 1.20.0
Docker Docker Compose Latest

πŸ“š Full Tech Stack Details β†’


πŸš€ Quick Start

Prerequisites

  • Java 21+ (Install)
  • Gradle (included via gradlew)
  • Docker & Docker Compose (for local services)
  • mkdocs is no longer required β€” documentation uses Docusaurus (requires Node.js β‰₯ 18)

Setup & Run

# 1. Clone the repository
git clone https://github.com/vinipx/QUANTAF.git
cd QUANTAF

# 2. Serve documentation locally
./docs.sh
# Opens http://localhost:3000

# 3. Start local services
docker-compose up -d

# 4. Build project
./gradlew build

# 5. Run tests
./gradlew test

# 6. Generate Allure report
./gradlew allureReport
# Open: build/reports/allure-report/index.html

# 7. Stop documentation server
./docs.sh stop

Simple Example

@Test
public void testBuyOrderExecution() throws IOException {
    // Setup
    FixAdapter adapter = new FixAdapter();
    adapter.connect("localhost", 9876);
    
    // Create order
    FixMessage order = new FixMessageBuilder()
        .setSymbol("AAPL")
        .setOrderQty(1000)
        .setPrice("150.25")
        .setSide("BUY")
        .build();
    
    // Send & verify
    adapter.send(order);
    FixMessage execution = adapter.receive(5000);
    
    assertThat(execution).isNotNull();
    assertThat(execution.getString(35)).isEqualTo("8"); // ExecutionReport
}

πŸ“– More Examples β†’


πŸ“– Documentation

Complete, professional documentation is included and available online:

Core Concepts

  • Overview β€” Purpose, benefits, target audience
  • Architecture β€” 4-layer design with data flow
  • Features β€” Complete feature list and capabilities

Getting Started

  • Tech Stack β€” Dependencies and versions
  • Configuration β€” YAML setup, env vars, multi-environment
  • Examples β€” TestNG, Cucumber, AI-powered scenarios

Advanced

πŸ‘‰ View Full Documentation


🏒 Project Structure

QUANTAF/
β”œβ”€β”€ src/main/java/io/github/vinipx/quantaf/
β”‚   β”œβ”€β”€ core/                 # Business logic (MarketMaker, TradeLedger)
β”‚   β”œβ”€β”€ protocol/
β”‚   β”‚   β”œβ”€β”€ fix/              # FIX protocol adapter
β”‚   β”‚   β”œβ”€β”€ swift/            # SWIFT protocol adapter
β”‚   β”‚   β”œβ”€β”€ mq/               # Message queue adapter
β”‚   β”‚   └── rest/             # REST client with OAuth2
β”‚   β”œβ”€β”€ ai/                   # AI/LLM integration (NLP, scenario gen)
β”‚   β”œβ”€β”€ config/               # Configuration management
β”‚   └── reporting/            # Allure integration
β”‚
β”œβ”€β”€ src/test/java/            # Test suites (TestNG & Cucumber)
β”œβ”€β”€ src/test/resources/
β”‚   β”œβ”€β”€ features/             # Cucumber feature files
β”‚   └── quantaf.yml           # Test configuration
β”‚
β”œβ”€β”€ documentation/            # Documentation site (Docusaurus)
β”‚   β”œβ”€β”€ docs/                 # Documentation source (Markdown)
β”‚   β”œβ”€β”€ src/                  # React components & custom CSS
β”‚   └── docusaurus.config.js  # Site configuration
β”œβ”€β”€ docker-compose.yml        # Local services
β”œβ”€β”€ build.gradle.kts          # Build configuration
β”œβ”€β”€ docs.sh                   # Documentation server launcher
└── README.md                 # This file

πŸ“‚ Development Reference β†’


πŸ”§ Configuration

QUANTAF uses YAML-based configuration with environment variable support:

# src/main/resources/quantaf.yml
fix:
  host: ${FIX_HOST:localhost}
  port: 9876
  sender_id: TEST_CLIENT

rest:
  baseUrl: ${REST_BASE_URL}
  oauth2:
    clientId: ${OAUTH_CLIENT_ID}
    clientSecret: ${OAUTH_CLIENT_SECRET}

ai:
  provider: openai
  openai:
    apiKey: ${OPENAI_API_KEY}
    model: gpt-4

database:
  url: ${DB_URL:jdbc:postgresql://localhost:5432/quantaf}

Environment Variables:

export FIX_HOST=trading-server.example.com
export OPENAI_API_KEY=sk-...
export OAUTH_CLIENT_ID=...

πŸ”§ Full Configuration Guide β†’


πŸ€– AI-Powered Testing

NLP-to-FIX Translation

Convert natural language to FIX messages automatically:

FixScenarioAgent agent = new FixScenarioAgent();
String description = "Send a buy order for 1000 shares of AAPL at $150.25";
FixMessage message = agent.translateNlp(description);
// Automatically generates proper FIX message with all fields

Smart SWIFT Stub Generation

Generate realistic SWIFT messages based on context:

SmartStubGenerator generator = new SmartStubGenerator();
SwiftMessage stub = generator.generate(trade, settlementDetails);
// Creates valid, context-aware SWIFT message

Scenario Generation

Use LLMs to create edge cases and load test scenarios:

List<FixMessage> scenarios = agent.generateScenario(
    "Test partial fills with price slippage and order rejection"
);

πŸ€– AI Features Details β†’


πŸ“Š CI/CD & Automation

GitHub Actions

Automatic build, test, and documentation publish on push:

# .github/workflows/build.yml
- Build project
- Run all tests  
- Generate Allure reports
- Publish docs to GitHub Pages

Docker & Testcontainers

  • Docker Compose for local development
  • Testcontainers for ephemeral infrastructure in CI
  • Automatic service startup and cleanup

Multi-Pipeline Support

βœ… GitHub Actions | βœ… Jenkins | βœ… GitLab CI | βœ… Custom

πŸš€ CI/CD Details β†’


πŸ§ͺ Testing Modes

TestNG (Direct Java)

@Test
public void testTradeExecution() {
    // Full IDE support, debugging, assertions
    Trade trade = tradeLedger.findLatest();
    assertThat(trade.getStatus()).isEqualTo(EXECUTED);
}

Cucumber BDD (Human-Readable)

Feature: Trade Settlement
  Scenario: Successfully settle a trade
    Given a trader sends a buy order for 1000 shares at $150.25
    When the market accepts the order
    Then the trade ledger should record a confirmed trade

πŸ“‹ Examples & Patterns β†’


πŸ“ˆ Reporting

Allure Reports

Rich, interactive HTML reports with:

✨ Timeline View β€” Visualize test execution over time
✨ Trends β€” Historical pass/fail analytics
✨ Severity Filtering β€” Focus on critical tests
✨ Attachments β€” Logs, data, screenshots
✨ Step-by-Step Breakdown β€” Detailed execution traces

./gradlew allureReport
open build/reports/allure-report/index.html

πŸ“Š Reporting Details β†’


πŸ”’ Security

  • OAuth2 β€” Secure REST API testing
  • TLS/SSL β€” Encrypted connections
  • Message Encryption β€” PGP signing support
  • Credential Management β€” Environment variable isolation
  • Regular CVE Scanning β€” Dependency security checks

🎯 Use Cases

Use Case How QUANTAF Helps
Trading System Testing Multi-protocol support, realistic data generation, high-frequency capable
Settlement Validation Reconciliation logic, ledger tracking, end-to-end scenarios
Compliance Testing Edge case generation, regulatory scenario creation, audit trails
Load Testing 1000s transactions/sec, statistical data, performance monitoring
Integration Testing Multi-protocol, Docker services, CI/CD ready
Regression Testing BDD scenarios, detailed reporting, trend analysis

🀝 Contributing

We welcome contributions! Here's how:

  1. Fork the repository
  2. Create a feature branch (feature/amazing-feature)
  3. Code with tests and documentation
  4. Commit with clear messages
  5. Push to your fork
  6. Create a Pull Request

Code Standards

  • Follow Google Java Style Guide
  • Write tests for all features
  • Update documentation
  • Run full test suite before PR

πŸ“ Full Contributing Guide β†’


πŸ“„ License

QUANTAF is distributed under the MIT License β€” free to use, modify, and distribute.

See LICENSE file for full details.


πŸš€ Next Steps


πŸ“ž Support


Built with ❀️ by vinipx for Financial Systems Testing Community

⭐ Star us on GitHub β€’ πŸ“– Read the Docs β€’ πŸ’¬ Discussions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors