← Back to projects



Case study
Java testing & TDD feature delivery (Parkit)
Bug fixes, TDD unit tests and JUnit integration tests for the Park'it application at Move'it.
Context
Move'it is developing Park'it, an automated parking payment system. The previous developer, Tek, left several critical bugs and unimplemented features. Mission: fix the existing errors, deliver 2 new features using strict TDD, and reach test coverage above 70% validated by JaCoCo and Surefire.
Problem Scope
- Critical bug: incorrect duration calculation for stays over 24h (producing negative values)
- Missing feature: first 30 minutes of parking free of charge
- Missing feature: 5% recurring customer discount
- Insufficient test coverage on ParkingService
- No integration tests against the real database
Solution & Deliverables
- Duration bug fix: replaced broken calculation logic for stays exceeding 24h
- TDD Feature 1: tests written first → price = 0 for parking stays under 30 minutes
- TDD Feature 2: tests written first → 5% discount applied after license plate lookup
- ParkingService unit tests with Mockito — coverage above 90%
- ParkingDataBaseIT integration tests on real database — global coverage above 70%
- JaCoCo and Surefire reports generated and validated by jury
Stack & Technologies
- Java + Maven — build and dependency management
- JUnit 5 — unit testing framework
- Mockito — mocks (TicketDAO, ParkingSpotDAO, InputReaderUtil)
- JaCoCo — code coverage report
- Surefire — test execution report
- MySQL — database for integration tests
- Git — versioning with feature/fix branches
Project Timeline
- 1Code analysisReview of existing project, identification of duration bug and missing features
- 2Bug fixFixed negative duration calculation for parking stays over 24 hours
- 3TDD Feature 1Tests written first → implemented free 30-minute stay rule
- 4TDD Feature 2Tests written first → implemented 5% recurring user discount with plate lookup
- 5Unit testsMockito mocks on ParkingService — coverage above 90%
- 6Integration testsParkingDataBaseIT on real database — global coverage above 70%, defense validated 4/4
Defense Results
4/4
Skills validated
>70%
Global coverage (JaCoCo)
>90%
ParkingService coverage
2
TDD features delivered
Screenshots
