How musfiqurr661/sqa-test-parking-system-testpart_v2 works
1. Repository purpose
- This is not a production parking app; it is a Java codebase for a unit-testing assignment around a parking-slot booking domain with intentional defects.
- The main “product” is the set of domain classes in src/, and the main deliverable is the JUnit 5 test suite in test/.
2. Core domain model
- The architecture is centered on five business objects: Vehicle, Wallet, ParkingSlot, Booking, and ParkingSystem.
- Two enums, VehicleType and ParkingSlotType, define the controlled categories used by the model.
- A third enum, BookingStatus, likely captures booking lifecycle states.
3. Object boundaries
- Vehicle represents the customer’s vehicle identity/classification.
- Wallet represents stored balance and payment-related behavior.
- ParkingSlot represents a physical parking resource with type and occupancy state.
- Booking links a vehicle to a slot and tracks reservation status.
- ParkingSystem is the orchestration layer that coordinates slots, bookings, and billing-like behavior.
4. Expected data flow
- A typical flow is: create a Vehicle → check/allocate an appropriate ParkingSlot via ParkingSystem → create a Booking → update slot and booking status → potentially charge or deduct from Wallet.
- The model is likely stateful: slot availability, booking status, and wallet balance are all mutable and interact through method calls.
5. Service/orchestration boundary
- ParkingSystem is the main boundary between business rules and the rest of the application.
- It likely owns the booking workflow: slot selection, validation of vehicle/slot compatibility, reservation, and release/cancellation logic.
- If there are defects, they are likely to surface here because it aggregates the other entities.
6. Supporting value types
- The enum classes define architectural constraints and reduce invalid states:
- VehicleType constrains what kind of vehicles exist.
- ParkingSlotType constrains slot categories.
- BookingStatus constrains booking lifecycle transitions.
- These types are important for diagrams because they represent shared rules used across multiple classes.
7. Test architecture
- The test/ directory mirrors the source model with one test file per class: VehicleTest, WalletTest, ParkingSlotTest, BookingTest, and ParkingSystemTest.
- This indicates a class-by-class testing strategy rather than a single end-to-end suite.
- The assignment explicitly asks for tests that both validate intended behavior and expose defects.
8. Documentation/reporting layer
- documentation.md is referenced by the README as the source of assignment-specific details.
- samplereport.md and the generated *_unit_test_report.md files are reporting artifacts, not runtime components.
- These files matter as part of the deliverable process, but they do not participate in application execution.
9. Static/global-state concern
- The README warns about order independence and static global state, which implies some classes may share mutable state across tests or instances.
- For an architecture diagram, this means the system may not be purely stateless; there may be class-level state inside ParkingSystem or related classes that affects test isolation.
10. Technology/runtime boundary
- The repository is a plain Java project with JUnit 5 tests.
- There is no evidence of web, database, messaging, or external-service integration in the repository structure.
- The architecture is therefore a local in-memory domain model plus tests.
11. Likely responsibility separation
- Vehicle, Wallet, ParkingSlot, and Booking are domain entities/value objects.
- ParkingSystem is the application/domain service that applies business rules.
- The enums are shared constants that provide type safety and rule enforcement.
12. What to show in an architecture diagram
- Show ParkingSystem at the center, connected to Vehicle, ParkingSlot, Booking, and Wallet.
- Show VehicleType, ParkingSlotType, and BookingStatus as shared classifiers used by the entities.
- Show test/ as a separate boundary that depends on all source classes but does not feed back into them.
- Show the documentation/report files as non-executable artifacts alongside the codebase.
13. Main repository boundary
- The entire repository is self-contained: source code, tests, and assignment documentation all live in the same project.
- The only meaningful dependency boundary is from tests to production classes; there are no external system integrations visible in the tree.
Main entry points: ParkingSystem.java ParkingSystem · Booking.java Booking · ParkingSystemTest.java ParkingSystemTest · ParkingSlot.java ParkingSlot
Components 16
Source model
Core in-memory parking domain and orchestration layer.
- ParkingSystem · Coordinates slot allocation, booking flow, and domain rules.
src/ParkingSystem.java - Booking · Links a vehicle to a parking slot and tracks reservation state.
src/Booking.java - ParkingSlot · Represents an individual slot and its occupancy state.
src/ParkingSlot.java - Vehicle · Represents the booked vehicle and its classification.
src/Vehicle.java - Wallet · Stores balance and supports payment-like behavior.
src/Wallet.java - VehicleType · Controlled set of vehicle categories used by the model.
src/VehicleType.java - SlotType · Controlled set of parking slot categories.
src/ParkingSlotType.java - BookingStatus · Controlled set of booking lifecycle states.
src/BookingStatus.java
Test suite
JUnit 5 class-by-class tests for the domain model.
- VehicleTest · Unit tests for vehicle behavior and classification.
test/VehicleTest.java - WalletTest · Unit tests for wallet balance and payment behavior.
test/WalletTest.java - ParkingSlotTest · Unit tests for slot state and compatibility rules.
test/ParkingSlotTest.java - BookingTest · Unit tests for booking state transitions and linkage.
test/BookingTest.java - ParkingSystemTest · Integration-style unit tests for orchestration and workflow.
test/ParkingSystemTest.java
Docs & reports
Assignment guidance and generated reporting artifacts.
- README · Top-level assignment and project guidance.
README.md - documentation · Assignment-specific notes referenced by the README.
documentation.md - sample report · Example reporting output for the assignment.
samplereport.md
Connections 23
- ParkingSystem → Vehicle: uses · Accepts vehicle data to drive booking decisions.
- ParkingSystem → ParkingSlot: allocates · Selects and updates parking slots during booking.
- ParkingSystem → Booking: creates · Orchestrates booking creation and lifecycle changes.
- ParkingSystem → Wallet: charges · Coordinates payment or balance deduction behavior.
- Booking → Vehicle: links · Associates a booking with a specific vehicle.
- Booking → ParkingSlot: reserves · Connects the booking to a slot reservation.
- Vehicle → VehicleType: classifies · Uses vehicle type to constrain behavior.
- ParkingSlot → SlotType: classifies · Uses slot type to constrain compatibility.
- Booking → BookingStatus: tracks · Stores the lifecycle state of a booking.
- ParkingSystem → VehicleType: validates · Checks vehicle type rules during allocation.
- ParkingSystem → SlotType: validates · Checks slot type rules during allocation.
- ParkingSystem → BookingStatus: transitions · Applies booking state changes across the workflow.
- VehicleTest → Vehicle: tests · Verifies vehicle behavior.
- WalletTest → Wallet: tests · Verifies wallet behavior.
- ParkingSlotTest → ParkingSlot: tests · Verifies slot behavior.
- BookingTest → Booking: tests · Verifies booking behavior.
- ParkingSystemTest → ParkingSystem: tests · Verifies end-to-end system workflow.
- ParkingSystemTest → Vehicle: covers · Uses vehicle inputs in system scenarios.
- ParkingSystemTest → ParkingSlot: covers · Exercises slot allocation scenarios.
- ParkingSystemTest → Booking: covers · Exercises booking lifecycle scenarios.
- ParkingSystemTest → Wallet: covers · Exercises payment-related scenarios.
- README → documentation: references · README points to documentation for assignment details.
- documentation → sample report: guides · Documentation relates to reporting/output artifacts.