Skip to content
Back to projects
Cover
Case study

Java testing & TDD feature delivery (Parkit)

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

  1. 1
    Code analysis
    Review of existing project, identification of duration bug and missing features
  2. 2
    Bug fix
    Fixed negative duration calculation for parking stays over 24 hours
  3. 3
    TDD Feature 1
    Tests written first → implemented free 30-minute stay rule
  4. 4
    TDD Feature 2
    Tests written first → implemented 5% recurring user discount with plate lookup
  5. 5
    Unit tests
    Mockito mocks on ParkingService — coverage above 90%
  6. 6
    Integration tests
    ParkingDataBaseIT 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

Screenshot 1