Package org.egothor.methodatlas
The central component of this package is
MethodAtlasApp, a command-line application
that scans Java source trees, identifies JUnit Jupiter test methods, and
emits per-method metadata describing the discovered tests.
Overview
The application traverses one or more directory roots and discovers test
methods via pluggable TestDiscovery
providers. The default JVM provider uses
JavaParser internally; file selection
follows the conventional *Test.java pattern.
For each detected test method the application reports:
- fully-qualified class name (FQCN)
- test method name
- method size measured in lines of code (LOC)
- JUnit
@Tagannotations declared on the method - text of any
@DisplayNameannotation declared on the method
The resulting dataset can be used for test inventory generation, quality metrics, governance reporting, or security analysis of test coverage.
AI-Based Security Tagging
When enabled via command-line options, the application can augment the
extracted test metadata with security classification suggestions produced by
an AI provider. The AI integration is implemented through the
AiSuggestionEngine abstraction located in
the org.egothor.methodatlas.ai package.
In this mode the application sends each discovered test class to the configured AI provider and receives suggested security annotations, such as:
- whether the test validates a security property
- suggested
@DisplayNamedescribing the security intent - taxonomy-based security tags
- optional explanatory reasoning
These suggestions are merged with the source-derived metadata and emitted alongside the standard output fields.
Output Formats
The application supports two output modes:
- CSV (default)
or, when AI enrichment is enabled:fqcn,method,loc,tags,display_namefqcn,method,loc,tags,display_name,ai_security_relevant,ai_display_name,ai_tags,ai_reason,ai_interaction_score - Plain text, enabled using the
-plaincommand-line option
Typical Usage
java -jar methodatlas.jar /path/to/project
java -jar methodatlas.jar -plain /path/to/project
The command scans the specified source directory recursively and emits one output record per detected test method.
Implementation Notes
- Test method discovery is performed by pluggable
TestDiscoveryproviders loaded viaServiceLoader; the JVM provider ships in themethodatlas-discovery-jvmmodule. - Source file write-back is performed by pluggable
SourcePatcherproviders, also loaded viaServiceLoader. - Test detection in the JVM provider is based on JUnit Jupiter annotations
such as
@Test,@ParameterizedTest,@RepeatedTest,@TestFactory, and@TestTemplate.
Sub-packages
org.egothor.methodatlas.api— platform-neutral SPI contracts:TestDiscovery,SourcePatcher,DiscoveredMethod,ScanRecordorg.egothor.methodatlas.discovery.jvm— Java/JVM test discovery implementation (shipped in themethodatlas-discovery-jvmmodule):JavaTestDiscovery,JavaSourcePatcherorg.egothor.methodatlas.discovery.dotnet— C#/.NET test discovery implementation (shipped in themethodatlas-discovery-dotnetmodule):DotNetTestDiscovery,DotNetSourcePatcherorg.egothor.methodatlas.emit— output emitters:OutputEmitter,SarifEmitter,GitHubAnnotationsEmitter,DeltaEmitterorg.egothor.methodatlas.ai— AI suggestion engine and provider integrationsorg.egothor.methodatlas.command— CLI command handler implementations: one class per CLI mode (ScanCommand,SarifCommand,DiffCommand,ApplyTagsCommand,ApplyTagsFromCsvCommand,GitHubAnnotationsCommand,ManualPrepareCommand), plus focused collaborators that the commands compose (PluginLoader,OverrideLoader,ContentHasher,AiRuntimeBuilder,ScanOrchestrator)
- See Also:
-
ClassDescriptionIn-memory cache of AI classification results loaded from a previous MethodAtlas scan output.Engine that applies annotation changes to source files driven by a reviewed MethodAtlas CSV export.Parsed command-line configuration used to drive a single application run.
Formatterthat emits one JSON object per log record, on a single line, suitable for ingestion by log-aggregation pipelines (Elastic, Splunk, Loki) and for reproducible audit-trail archives.Selects between the two phases of the manual AI workflow.Consume phase: read operator-saved response files and emit enriched CSV.Prepare phase: scan source files and write AI prompt work files and empty response stubs.Command-line application for scanning Java test sources, extracting JUnit test metadata, and optionally enriching the emitted results with AI-generated security tagging suggestions.Immutable record identifying one CLI invocation of MethodAtlas.Thread-local holder for the currentScanRun, the JUL-friendly equivalent of SLF4J's MDC.