bertilmuth/requirementsascode
59.4
Adequate · 22 September 2026
6.3k
lines of production code
Java
primary language
6
measurements over time
What this system is
This system is a 'requirements as code' framework that enables developers to define and execute behavioral models using an actor-based architecture. It provides a fluent builder API and stateful actor models to specify use cases, flows, and system reactions, while also supporting event sourcing patterns. The library includes utilities for model extraction and template rendering, accompanied by diverse examples such as clean architecture, Akka integration, and Spring Boot applications.
How it got here
2016–2017 — Core model and builder API implementation
17 changes.
This period focused on establishing the foundational architecture of the project, including the initialization of the repository and the implementation of the core Actor and Behavior models. Significant work was done to create a fluent builder API for defining use cases and flows, alongside a comprehensive test suite to validate these new features. The period also saw the addition of example implementations, such as Akka integration, and the refactoring of the FreeMarker template engine to support the new model structures.
2018–2021 — Event sourcing and actor examples
12 changes.
This period focused on expanding the library's example suite with new implementations of event sourcing and actor-based architectures. Key additions included a credit card event-sourcing application, interactive actor examples, and a clean architecture demonstration, all accompanied by comprehensive unit tests.
Features
Add Akka Actor model example with remote configuration
A new Akka-based example was added to the requirements-as-code library, featuring a Java class (Akka.java) that demonstrates an Actor model implementation using the ModelRunner to handle user requests for greetings. The example includes an application.conf file that configures Akka's remote actor system with Netty TCP transport on localhost:2552, enabling distributed actor communication.
requirementsascodeexamples/akka · high confidence
Add PizzaVolumeCalculator example with console interface
Added a new example demonstrating a pizza volume calculator, including the core actor logic, command objects for radius and height, and a console-based entry point that allows users to input dimensions and view the calculated volume.
requirementsascodeexamples/pizzavolumecalculator/src/main · high confidence
Add actor interaction examples
New example classes demonstrate how actors can interact with each other. The \InteractingActorsExample\ shows a producer sending messages to a consumer, while \PublishingActorExample\ illustrates a single actor publishing and handling its own messages. Supporting message classes \EnterName\ and \NameEntered\ are also added to facilitate these examples.
requirementsascodeexamples/actor · medium confidence
Add credit card event sourcing controller and persistence layer
Introduced a new REST controller for listing credit cards and an in-memory event store to support event sourcing. The controller exposes a /cards endpoint that retrieves all credit card aggregate roots, while the EventStore repository manages the in-memory storage and retrieval of domain events.
_requirementsascodeexamples/creditcard\_eventsourcing/src/main/java/creditcard\eventsourcing/controller · high confidence
Add cross-cutting concerns example for performance measurement
A new example demonstrates how to implement cross-cutting concerns, specifically measuring the performance of system reactions. The example, located in the \crosscuttingconcerns\ directory, includes a \CrossCuttingConcerns01\ class that uses a \StepToBeRun\ interface to time the execution of a model's behavior, printing the elapsed time in nanoseconds.
requirementsascodeexamples/crosscuttingconcerns · medium confidence
Added clean architecture example for requirements-as-code
A new Java file, CleanArchitectureOutline.java, was added to the cleanarchitecture package, providing a complete example of a clean architecture implementation using the requirements-as-code library. This includes a main entry point, a behavior model, and supporting classes for handling greetings, demonstrating how to structure an application with separate layers for domain, infrastructure, and behavior models.
requirementsascodeexamples/helloworld/src/main/java/cleanarchitecture · high confidence
Added new helloworld examples using the actor syntax
The helloworld examples have been migrated to use the new actor syntax, introducing a suite of example classes (HelloUser, HelloWorld01-07) that demonstrate various use cases such as basic flows, conditional flows, and case-based flows. The changes include new domain classes (Color, Greeting, Person), command classes (EnterText), command handlers (SaveName, SaveAge, GreetWithDefaultName, etc.), and actor implementations (NormalUser, AnonymousUser, ValidUser) that interact with the model builder to define behavior.
requirementsascodeexamples/helloworld/src/main/java/helloworld · high confidence
Introduce event-sourcing example with scheduled simulation
Added a new Spring Boot application that demonstrates event sourcing for a credit card aggregate. The application includes a scheduled task that simulates credit card operations (assigning limits and withdrawals) using command objects, persisting state changes as events.
_requirementsascodeexamples/creditcard\_eventsourcing/src/main/java/creditcard\eventsourcing · high confidence
Introduce new Actor and Behavior model for stateful and stateless behaviors
The core library now defines an explicit Actor and Behavior model. Users can create stateful actors (via the new AbstractActor and Actor classes) that maintain state and run a behavior model, or use the stateless StatelessBehavior for singleton scenarios. The Model class now explicitly manages user and system actors, and the ModelRunner is configured to run against a specific actor. This change enables distinguishing between user and system actors, allowing the framework to enforce that only a connected actor can trigger specific system reactions, and supports recording actor interactions via the new RecordingActor.
requirementsascodecore/src/main/java/org/requirementsascode · high confidence
Introduce new flow position types for step execution control
The library now provides new classes in the flowposition package to control when steps are executed. Users can now use After to check if a specific step was the last one run, with support for multiple steps via orAfter. The Anytime class allows conditions to be checked at any point, while InsteadOf allows replacing a step's execution with a different condition. These changes enable more flexible flow control in requirement-as-code scenarios.
requirementsascodecore/src/main/java/org/requirementsascode/flowposition · high confidence
Introduces a new fluent builder API for defining use cases, flows, and steps
The builder package now provides a comprehensive, fluent API for constructing models, introducing new parts such as FlowPart, FlowConditionPart, FlowlessConditionPart, and StepPart. This enables users to define flows with conditions, specify step execution order using continuesAfter and continuesAt, and handle messages or exceptions via the user/on methods. The ModelBuilder now supports building flows with static methods, allowing for more concise and readable model definitions.
requirementsascodecore/src/main/java/org/requirementsascode/builder · high confidence
New FreeMarker template methods for step parts
Added new FreeMarker template methods to extract specific parts of a step for template rendering: ActorPartOfStep, FlowCondition, FlowlessCondition, InCasePartOfStep, ReactWhileOfStep, SystemPartOfStep, and UserPartOfStep. These methods provide structured access to actor names, flow conditions, case conditions, reaction states, and system/user interactions within the requirements-as-code model.
requirementsascodeextract/src/main/java/org/requirementsascode/extract/freemarker/methodmodel · high confidence
New utility classes for Freemaker model extraction
Added new utility classes, Steps and Words, to the freemarker methodmodel package. The Steps class provides helper methods to extract and analyze Step objects from Freemaker models, including checks for non-default actors, system users, system events, and system reactions. The Words class offers a utility to convert class names into lowercase, space-separated words, likely for generating human-readable labels or identifiers in templates.
requirementsascodeextract/src/main/java/org/requirementsascode/extract/freemarker/methodmodel/util · high confidence
Project initialization and repository structure
The repository is initialized with essential project files: a Travis CI configuration (.travis.yml) for continuous integration, a Code of Conduct (CODE\_OF\_CONDUCT.md), contributor guidelines (CONTRIBUTING.md), and an Apache 2.0 license (LICENSE). The README.md provides an overview of the 'requirements as code' framework, including Maven and Gradle dependencies, usage examples, and links to documentation. Additionally, Gradle wrapper scripts (gradlew, gradlew.bat) and a .gitignore file are added to support the build system.
(repo-wide) · high confidence
Behavioural changes
New exception types for model validation errors
The \org.requirementsascode.exception\ package now includes several new exception classes to handle specific model validation errors. These include \ElementAlreadyInModel\ for duplicate elements, \NoSuchElementInModel\ for missing references, \MoreThanOneStepCanReact\ for ambiguous reactions, \NestedCallOfReactTo\ for invalid handler calls, \InfiniteRepetition\ for stack overflow conditions, and \MissingUseCaseStepPart\ for incomplete steps. These exceptions provide clearer, more specific error messages to help users identify and fix issues in their models.
requirementsascodecore/src/main/java/org/requirementsascode/exception · high confidence
Refactor FreeMarker template engine to use relative package paths
The FreeMarker engine now accepts a base package path for template loading instead of an absolute path, and registers specific method model classes (such as FlowCondition, InCasePartOfStep, and ReactWhileOfStep) directly into the data model. This change simplifies the template processing logic and improves modularity by separating template handling from the core model extraction process.
requirementsascodeextract/src/main/java/org/requirementsascode/extract/freemarker · medium confidence
Refactor system reaction handling with new abstract classes and ignore support
The system reaction logic has been refactored by introducing new abstract classes (AbstractContinues, AbstractContinuesAfter) and concrete implementations (ContinuesAfter, ContinuesAt, IgnoresIt) to manage step continuations and ignored states. This change restructures how the system handles step transitions and ignores specific reactions, providing a more modular approach to defining system behavior in response to events.
requirementsascodecore/src/main/java/org/requirementsascode/systemreaction · medium confidence
Refactored Credit Card model into separate command and event classes
The credit card domain model has been restructured to separate concerns. Command classes (RequestToAssignLimit, RequestWithdrawal, RequestRepay, RequestToCloseCycle) are now distinct classes in the command package, and domain events (LimitAssigned, CardWithdrawn, CardRepaid, CycleClosed) are separate classes in the event package. The CreditCardAggregateRoot and CreditCard classes have been refactored to use these new types, improving readability and maintainability of the eventsourcing implementation.
_requirementsascodeexamples/creditcard\_eventsourcing/src/main/java/creditcard\eventsourcing/model · medium confidence
Updated Gradle wrapper to version 7.1.1
The Gradle wrapper has been updated to version 7.1.1, ensuring that the project uses a consistent and up-to-date version of the Gradle build tool for all developers and CI environments.
gradle · high confidence
Test coverage
Add unit tests for PizzaVolumeCalculator actor; Added Freemaker templates for testing extract functionality; Added comprehensive test coverage for the requirements-as-code core; Added comprehensive tests for the new builder API; Added test coverage for invalid user scenario; Added test for clean architecture example; Added tests for HelloWorld examples using the RecordingActor; Added unit tests for CreditCardAggregateRoot; Added unit tests for the Freemarker engine and related model classes.
Dependencies
Initial Gradle-based build configuration for Requirements as Code
The project introduces a new multi-module Gradle build structure, defining the root, core, and example subprojects. This establishes the build system with Java 8 compatibility, JUnit 5 test support, and Maven Central publishing configuration. Specific examples (actor, akka, creditcard\_eventsourcing, etc.) are configured with their respective dependencies, including Spring Boot 2.5.3 for the credit card example and Akka 2.5.4 for the actor example.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 61 → 59 (-1.2)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 98 → 99 (+0.3)
- Architecture 99 → 99 (+0.7)
- Maturity 57 → 57 (+0.0)
- Readiness 39 → 43 (+3.7)
- Security 100 → 78 (-22.2)
- Domain Modelling 100 → 100 (+0.0)
Resolved (9)
- Change coupling: CreditCard.java ↔ EventStore.java (requirementsascodeexamples/creditcard_eventsourcing/src/main/java/creditcard_eventsourcing/model/CreditCard.java)
- Change coupling: EventsourcingApplication.java ↔ CreditCard.java (requirementsascodeexamples/creditcard_eventsourcing/src/main/java/creditcard_eventsourcing/EventsourcingApplication.java)
- Change coupling: FlowlessStep.java ↔ FlowPart.java (requirementsascodecore/src/main/java/org/requirementsascode/FlowlessStep.java)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (6 lines × 2) (requirementsascodecore/src/main/java/org/requirementsascode/builder/ModelBuilder.java)
- No exposed public API
- Test reliability not included
- single-maintainer — knowledge-concentration (bus factor) risk
New (101)
- Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
- Documentation: no installation or build instructions (README.md)
- Duplicated block (11 lines × 4) (requirementsascodeextract/src/main/java/org/requirementsascode/extract/freemarker/methodmodel/FlowCondition.java)
- Duplicated block (13 lines × 2) (requirementsascodeexamples/helloworld/src/main/java/helloworld/commandhandler/GreetWithDefaultName.java)
- Duplicated block (22 lines × 3) (requirementsascodeexamples/creditcard_eventsourcing/src/main/java/creditcard_eventsourcing/model/event/CardRepaid.java)
- Duplicated block (5 lines × 2) (requirementsascodecore/src/main/java/org/requirementsascode/builder/FlowlessSystemPart.java)
- Duplicated block (5 lines × 2) (requirementsascodecore/src/main/java/org/requirementsascode/builder/ModelBuilder.java)
- Duplicated block (5 lines × 2) (requirementsascodeextract/src/main/java/org/requirementsascode/extract/freemarker/methodmodel/FlowCondition.java)
- No ADRs found
- No SBOM
- No assertions: actorDoesnReactIfActorInModelIsDifferent (requirementsascodecore/src/test/java/org/requirementsascode/ActorWithBehaviorTest.java)
- No assertions: actorReactsIfActorInModelMatches (requirementsascodecore/src/test/java/org/requirementsascode/ActorWithBehaviorTest.java)
- No assertions: actorReactsIfActorInModelMatchesForSecondEvent (requirementsascodecore/src/test/java/org/requirementsascode/ActorWithBehaviorTest.java)
- No assertions: actorReactsToEvent (requirementsascodecore/src/test/java/org/requirementsascode/ActorWithBehaviorTest.java)
- No assertions: actorReactsToFulfilledCondition (requirementsascodecore/src/test/java/org/requirementsascode/ActorWithBehaviorTest.java)
- No assertions: actorReactsToTwoEvents (requirementsascodecore/src/test/java/org/requirementsascode/ActorWithBehaviorTest.java)
- No assertions: continueRecordingAfterRestart (requirementsascodecore/src/test/java/org/requirementsascode/RecordingTest.java)
- No assertions: continuesAfterCalledFromFirstStepOfAlternativeFlowWithRightActor (requirementsascodecore/src/test/java/org/requirementsascode/FlowTest.java)
- No assertions: continuesAfterCalledFromMultipleMutuallyExclusiveAlternativeFlows (requirementsascodecore/src/test/java/org/requirementsascode/FlowTest.java)
- No assertions: continuesAfterCalledFromSecondStepOfAlternativeFlow (requirementsascodecore/src/test/java/org/requirementsascode/FlowTest.java)
- …and 81 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
bertilmuth/requirementsascode was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 22 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f1966c88936511e353bd1f48f4f4a9280af9c47e — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-90d5d2fe38ee.