# lyoubo/fetruth architecture

> Architecture diagram of the GitHub repository lyoubo/fetruth, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lyoubo/fetruth
- Repository: https://github.com/lyoubo/fetruth

## Overview

feTruth detects feature-envy methods in Java projects by analyzing method/class relationships and producing suggested Move Method results. Its primary workflow is project input through preprocessing and model-based classification to a report; the README documents pretrained word2vec assets and output files, but the Python implementation was not sampled. The Java data-generation subsystem mines refactorings from Git history, builds positive and negative training examples, and matches method invocations. Its services and interfaces are evidenced by the tree and excerpts; detailed parser wiring is not fully shown.

Main entry points: [`implementation/feTruth.py`](https://github.com/lyoubo/fetruth/blob/master/implementation/feTruth.py) (Detection CLI), [`dataset/data_generation/src/main/java/org/datageneration/service/TrainingDataServiceImpl.java`](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/service/TrainingDataServiceImpl.java) (Training data service), [`classifier/classifier.py`](https://github.com/lyoubo/fetruth/blob/master/classifier/classifier.py) (Feature classifier), [`dataset/data_generation/src/main/java/org/methodinvocation/service/MethodInvocationServiceImpl.java`](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/methodinvocation/service/MethodInvocationServiceImpl.java) (Invocation matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detect["Detection"]
  node_cli["Detection CLI<br/>[feTruth.py]"]
  node_preprocess["Project preprocessing<br/>[preprocess.py]"]
  node_classifier["Feature classifier<br/>[classifier.py]"]
  node_word2vec["Word2vec assets"]
  node_report["Detection report"]
end

subgraph group_learn["Data generation"]
  node_training_service["Training data service"]
  node_training_parser["Training parser"]
  node_training_store[("Training records")]
  node_invocation_service["Invocation matching"]
  node_invocation_parser["Invocation parser"]
end

subgraph group_miner["Refactoring analysis"]
  node_mining_service["Mining service"]
  node_git["Git history access"]
  node_miner_engine["History miner"]
end

subgraph group_analysis["Java analysis"]
  node_model_diff["UML model diff<br/>[UMLModelDiff.java]"]
  node_java_model["Java UML model<br/>[UMLModel.java]"]
  node_metrics["Coupling metrics<br/>[Metric.java]"]
  node_candidate["Smell candidates"]
end

node_engineer(("Engineer"))
node_java_project["Java project"]

node_engineer -->|"runs analysis"| node_cli
node_java_project -->|"project input"| node_cli
node_cli -->|"preprocesses"| node_preprocess
node_preprocess -->|"supplies features"| node_classifier
node_word2vec -.->|"model assets"| node_classifier
node_classifier -->|"returns predictions"| node_cli
node_cli -->|"writes results"| node_report
node_mining_service -->|"opens repositories"| node_git
node_mining_service -->|"detects commits"| node_miner_engine
node_miner_engine -->|"produces diffs"| node_model_diff
node_model_diff -->|"compares models"| node_java_model
node_training_service -->|"parses projects"| node_training_parser
node_training_service -->|"writes examples"| node_training_store
node_training_service -->|"checks out commits"| node_git
node_invocation_service -->|"finds invocations"| node_invocation_parser
node_invocation_service -->|"matches refactoring records"| node_training_store
node_candidate -->|"uses measures"| node_metrics

click node_cli "https://github.com/lyoubo/fetruth/blob/master/implementation/feTruth.py"
click node_preprocess "https://github.com/lyoubo/fetruth/blob/master/implementation/preprocess.py"
click node_classifier "https://github.com/lyoubo/fetruth/blob/master/classifier/classifier.py"
click node_mining_service "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/refactoringminer/service/RefactoringMinerServiceImpl.java"
click node_git "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/refactoringminer/util/GitServiceImpl.java"
click node_miner_engine "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/refactoringminer/rm1/GitHistoryRefactoringMinerImpl.java"
click node_model_diff "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java"
click node_java_model "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/gr/uom/java/xmi/UMLModel.java"
click node_training_service "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/service/TrainingDataServiceImpl.java"
click node_training_parser "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/parser/TrainingDataParser.java"
click node_training_store "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/service/TrainingDataServiceImpl.java"
click node_invocation_service "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/methodinvocation/service/MethodInvocationServiceImpl.java"
click node_invocation_parser "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/parser/MethodInvocationParser.java"
click node_metrics "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/metrics/Metric.java"
click node_candidate "https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/candidate/SmellCandidate.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_preprocess,node_classifier,node_word2vec,node_report toneBlue
class node_training_service,node_training_parser,node_training_store,node_invocation_service,node_invocation_parser toneAmber
class node_mining_service,node_git,node_miner_engine toneMint
class node_model_diff,node_java_model,node_metrics,node_candidate toneRose
class node_engineer,node_java_project toneIndigo
```

## Components

### Detection

- [Detection CLI](https://github.com/lyoubo/fetruth/blob/master/implementation/feTruth.py): `implementation/feTruth.py`
- [Project preprocessing](https://github.com/lyoubo/fetruth/blob/master/implementation/preprocess.py): `implementation/preprocess.py`
- [Feature classifier](https://github.com/lyoubo/fetruth/blob/master/classifier/classifier.py): `classifier/classifier.py`
- **Word2vec assets**
- **Detection report**

### Data generation

- [Training data service](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/service/TrainingDataServiceImpl.java): `dataset/data_generation/src/main/java/org/datageneration/service/TrainingDataServiceImpl.java`
- [Training parser](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/parser/TrainingDataParser.java): `dataset/data_generation/src/main/java/org/parser/TrainingDataParser.java`
- [Training records](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/service/TrainingDataServiceImpl.java): `dataset/data_generation/src/main/java/org/datageneration/service/TrainingDataServiceImpl.java`
- [Invocation matching](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/methodinvocation/service/MethodInvocationServiceImpl.java): `dataset/data_generation/src/main/java/org/methodinvocation/service/MethodInvocationServiceImpl.java`
- [Invocation parser](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/parser/MethodInvocationParser.java): `dataset/data_generation/src/main/java/org/parser/MethodInvocationParser.java`

### Refactoring analysis

- [Mining service](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/refactoringminer/service/RefactoringMinerServiceImpl.java): `dataset/data_generation/src/main/java/org/refactoringminer/service/RefactoringMinerServiceImpl.java`
- [Git history access](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/refactoringminer/util/GitServiceImpl.java): `dataset/data_generation/src/main/java/org/refactoringminer/util/GitServiceImpl.java`
- [History miner](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/refactoringminer/rm1/GitHistoryRefactoringMinerImpl.java): `dataset/data_generation/src/main/java/org/refactoringminer/rm1/GitHistoryRefactoringMinerImpl.java`

### Java analysis

- [UML model diff](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java): `dataset/data_generation/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java`
- [Java UML model](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/gr/uom/java/xmi/UMLModel.java): `dataset/data_generation/src/main/java/gr/uom/java/xmi/UMLModel.java`
- [Coupling metrics](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/metrics/Metric.java): `dataset/data_generation/src/main/java/org/datageneration/metrics/Metric.java`
- [Smell candidates](https://github.com/lyoubo/fetruth/blob/master/dataset/data_generation/src/main/java/org/datageneration/candidate/SmellCandidate.java): `dataset/data_generation/src/main/java/org/datageneration/candidate/SmellCandidate.java`

### Other components

- **Engineer**
- **Java project**

## Connections

- Engineer → Detection CLI: runs analysis
- Java project → Detection CLI: project input
- Detection CLI → Project preprocessing: preprocesses
- Project preprocessing → Feature classifier: supplies features
- Word2vec assets → Feature classifier: model assets
- Feature classifier → Detection CLI: returns predictions
- Detection CLI → Detection report: writes results
- Mining service → Git history access: opens repositories
- Mining service → History miner: detects commits
- History miner → UML model diff: produces diffs
- UML model diff → Java UML model: compares models
- Training data service → Training parser: parses projects
- Training data service → Training records: writes examples
- Training data service → Git history access: checks out commits
- Invocation matching → Invocation parser: finds invocations
- Invocation matching → Training records: matches refactoring records
- Smell candidates → Coupling metrics: uses measures
