Sobes.tech
Junior — Middle

How was testing carried out in your last project?

sobes.tech AI

Answer from AI

In my latest Java project, testing was carried out at several levels:

  1. Unit testing — using JUnit to write tests for individual classes and methods to verify business logic correctness.

  2. Integration testing — using Spring Test to check component interactions and database operations in a test environment.

  3. Functional testing — automating UI tests with Selenium to verify user scenarios.

  4. Continuous integration — tests were run automatically on each commit via Jenkins, allowing for quick error detection.

Example of a simple JUnit test:

import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;

class CalculatorTest {
    @Test
    void testAdd() {
        Calculator calc = new Calculator();
        assertEquals(5, calc.add(2, 3));
    }
}