Skip to content

Testing

Fredrik Jonathan Marjoni edited this page Apr 21, 2026 · 6 revisions

Overview

Testing has been an important part of the development of Help-Me-Help.
We have focused on ensuring that the core functionality of the system is reliable, secure, and behaves as expected under different conditions.

The project uses JUnit 6 for automated testing.


Test Structure

All test classes are located in:

src/test/java/edu/group5/app/

The test structure mirrors the main project structure. This makes it easier to maintain tests and ensures that each component is properly covered.


What We Tested

We have implemented tests for the following parts of the system:

Model Layer

  • Entity classes (e.g., User, Organization, Donation)
  • Business logic in service classes
  • Data access via repository classes

Database Layer

  • DbWrapper for:
    • User data storage
    • Donation persistence
  • Ensures correct interaction with the H2 database

API & Web Scraping

  • OrgApiWrapper for fetching organization data
  • OrganizationScraper for retrieving descriptions and logos

Utility Classes

  • ParameterValidator to ensure correct input handling

Test Types

We have focused on:

  • Unit Testing

    • Testing individual methods and classes in isolation
    • Verifying correct outputs for given inputs
  • Positive Tests

    • Ensuring the system works correctly with valid input
  • Negative Tests

    • Ensuring the system handles invalid input gracefully

User Testing

In addition to automated testing, we conducted basic user testing to evaluate the usability of the application.

Participants were asked to perform common tasks such as creating an account, browsing organizations, and completing a donation. This helped us observe how real users interact with the system without prior knowledge.

The testing provided insight into navigation flow, clarity of features, and overall user experience. Based on feedback, we made small improvements to UI elements, feedback messages, and usability to ensure the application is intuitive and easy to use.


Running the Tests

To run all tests, use the following command:

mvn clean test

This will:

  1. Compile the project
  2. Compile the test classes
  3. Execute all JUnit tests

Test Reports

After running the tests, reports are generated in:

target/surefire-reports/

These reports include:

  • Test results (passed/failed)
  • Execution time
  • Error messages and stack traces

Reliability and Coverage

  • Tests cover the core business logic of the application
  • Both expected and edge cases are tested
  • High coverage in critical components such as:
    • Organization data handling
    • Donation processing
    • User authentication

UI components and the main application entry point (App.java) are minimally tested, as they are primarily visual and event-driven.


Summary

The testing strategy ensures that:

  • Core functionality works as intended
  • Errors are handled safely
  • The system behaves predictably under different scenarios

This contributes to a more stable and maintainable application.