# naver/fixture-monkey architecture

> Architecture diagram of the GitHub repository naver/fixture-monkey, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/naver/fixture-monkey
- Repository: https://github.com/naver/fixture-monkey

## Overview

##### Main Components

a. Core Components:
- FixtureMonkey (Central orchestrator)
- ArbitraryBuilder (Object construction)
- Introspectors (Property analysis)
- Generators (Value generation)
- Plugins (Extension system)

b. Integration Components:
- Test Framework Adapters (JUnit, TestNG, Kotest)
- Language Support (Java, Kotlin)
- Validation Framework Integration (Jakarta, Javax)

##### Component Relationships

**[Test Framework Layer]**
**JUnit Jupiter <-> Kotest <-> TestNG**
- ↓          ↓         ↓
**[Core Layer]**
**FixtureMonkey Builder**
- ↓
- FixtureMonkey
- ↓
**ArbitraryBuilder ←→ ObjectBuilder**
- ↓
**[Generation Layer]**
**Introspector System → Property Generator → Arbitrary Generator**
- ↓
**[Plugin Layer]**
**Jackson Plugin ←→ Validation Plugin ←→ Mockito Plugin**
- ↓
**[Foundation Layer]**
**Type System ←→ Property System ←→ Expression System**

##### Specific Implementation Details

a. Core Layer:
**[FixtureMonkey]**
- Options Configuration
- Builder Pattern Interface
- Plugin Management
- ↓
**[ArbitraryBuilder]**
- Property Customization
- Value Generation
- Constraint Handling

b. Generation Layer:
**[Introspector System]**
- Property Analysis
- Type Resolution
- Annotation Processing
- ↓
**[Generator System]**
- Value Generation
- Container Handling
- Constraint Application

##### Key Interactions to Highlight

- How FixtureMonkey interfaces with different test frameworks
- Plugin integration points
- Demonstrate the flow from property specification to object generation
- Validation framework integration

##### Additional Elements

- Notes about configuration options
- Version compatibility information
- Extension points for custom implementations

##### Implementation Flow
**User Request → Builder Configuration → Property Analysis →**
**Value Generation → Validation → Object Construction → Test Framework Integration**

- The modular nature of the system
- Clear separation of concerns
- Plugin architecture
- Test framework integration points
- Language-specific adaptations

Remember to:
- Sufficient technical detail while maintaining clarity
- Both static structure and dynamic interactions
- Extension points and customization options

This architecture reflects Fixture Monkey's role as a test fixture generation library while showing its integration capabilities and extensibility points.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph TestFramework[Test Framework Layer]
        JUnit["JUnit Jupiter"]
        Kotest["Kotest"]
        TestNG["TestNG"]
    end

    subgraph CoreLayer[Core Layer]
        FM["FixtureMonkey"]:::core
        AB["ArbitraryBuilder"]:::core
        OB["ObjectBuilder"]:::core
    end

    subgraph GenLayer[Generation Layer]
        IS["Introspector System"]:::gen
        PG["Property Generator"]:::gen
        AG["Arbitrary Generator"]:::gen
    end

    subgraph PluginLayer[Plugin Layer]
        JP["Jackson Plugin"]:::plugin
        VP["Validation Plugin"]:::plugin
        MP["Mockito Plugin"]:::plugin
    end

    subgraph Foundation[Foundation Layer]
        TS["Type System"]:::foundation
        PS["Property System"]:::foundation
        ES["Expression System"]:::foundation
    end

    %% Relationships
    JUnit <--> Kotest
    Kotest <--> TestNG
    TestFramework --> FM
    FM --> AB
    AB <--> OB
    AB --> IS
    IS --> PG
    PG --> AG
    IS --> PluginLayer
    JP <--> VP
    VP <--> MP
    TS <--> PS
    PS <--> ES

    %% Click events
    click FM "https://github.com/naver/fixture-monkey/blob/main/fixture-monkey/src/main/java/com/navercorp/fixturemonkey/FixtureMonkey.java"
    click AB "https://github.com/naver/fixture-monkey/blob/main/fixture-monkey/src/main/java/com/navercorp/fixturemonkey/ArbitraryBuilder.java"
    click IS "https://github.com/naver/fixture-monkey/tree/main/fixture-monkey-api/src/main/java/com/navercorp/fixturemonkey/api/introspector/"
    click PG "https://github.com/naver/fixture-monkey/tree/main/fixture-monkey-api/src/main/java/com/navercorp/fixturemonkey/api/generator/"
    click JUnit "https://github.com/naver/fixture-monkey/tree/main/fixture-monkey-junit-jupiter/"
    click Kotest "https://github.com/naver/fixture-monkey/tree/main/fixture-monkey-kotest/"
    click VP "https://github.com/naver/fixture-monkey/tree/main/fixture-monkey-jakarta-validation/"
    click ES "https://github.com/naver/fixture-monkey/tree/main/fixture-monkey/src/main/java/com/navercorp/fixturemonkey/expression/"
    click PS "https://github.com/naver/fixture-monkey/tree/main/fixture-monkey-api/src/main/java/com/navercorp/fixturemonkey/api/property/"
    click TS "https://github.com/naver/fixture-monkey/tree/main/fixture-monkey-api/src/main/java/com/navercorp/fixturemonkey/api/type/"

    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef gen fill:#4CAF50,stroke:#2E7D32,color:white
    classDef plugin fill:#FFC107,stroke:#FFA000,color:black
    classDef foundation fill:#9E9E9E,stroke:#616161,color:white
    classDef validation fill:#F44336,stroke:#C62828,color:white

    %% Legend
    subgraph Legend
        C1[Core Components]:::core
        C2[Generation Components]:::gen
        C3[Plugin Components]:::plugin
        C4[Foundation Components]:::foundation
        C5[Validation Components]:::validation
    end
```
