Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Types of Testing | Testing in Development
Java JUnit Library. Types of Testing
course content

Contenido del Curso

Java JUnit Library. Types of Testing

Java JUnit Library. Types of Testing

1. Testing in Development
2. Unit Tests
3. Exceptions

bookTypes of Testing

Let's take a look at the main types and levels of testing. There are many types, but we will only discuss the fundamental ones that are important for you and that you will use.

Types

  • Functional Testing: This type of testing is a check to ensure that the program meets the expected result and performs all the functions it is supposed to. Tools used for functional testing:
    Selenium (for testing web applications), JUnit, TestNG.
    Example of functional testing:
  • Database Testing: As you've already understood, such a test verifies the correctness of working with and storing data in the database. For example, a test like this involves loading test data into the database before starting the application testing.

Note

We will discuss what databases are, how to use them in Java code, and how to connect them correctly in a separate course. For now, you can think of a database as a Collection from the data structures course.

  • Performance Testing: This type of testing assesses the performance level of a program. We won't delve into this type of testing in detail, but it's worth being aware of its existence. In brief, performance testing involves measuring system performance under specific load conditions.
    Tools used: Apache JMeter, Gatling.

Levels

Testing levels are the layers of testing that will be employed when using one of the testing types. There are a total of 4 levels, one of which we will be studying in detail in this course: Unit Testing, Integration Testing, System Testing, and Acceptance Testing.

Let's take a closer look at unit and integration testing:

  • Unit Testing: This is the testing of individual program modules(units) for correct functionality. Such testing ensures that each module operates correctly in isolation from other modules. Unit testing is utilized in every programming language and is a minimum requirement for testing one's application.
    Unit tests in Java are written using tools like JUnit and TestNG. However, we will use the JUnit library.
    Example of a unit test:

Note

For now, there's no need to pay much attention to the syntax; we will delve into it further in this course. However, you can understand that this code is testing the add() method of the MathUtils class.

  • Integration Testing: This level of testing verifies the functionality of interactions between individual units or components of the program. In other words, if other modules are used in one module, integration tests will check the functionality of such modules. This level of testing is related to unit testing but serves as a separate layer of testing.
    Tools used for integration testing: JUnit, TestNG, Mockito.
    Example of usage:

This chapter is introductory. In this course, we will exclusively focus on unit testing, while other levels and types of testing will be discussed only theoretically.

These are the primary types of testing used in Java. There are many other types of testing, such as Smoke testing, End-to-End testing, and so on, but these are not our current focus. Such testing is more in the realm of QA engineers. In this course, we will be covering two main testing methods: Unit Testing and Integration Testing. These are the tests that every junior developer should be able to write.

1. What is the primary goal of Unit Testing in Java?
2. Which testing level focuses on assessing the interaction between various modules or components in a Java program?
3. In Functional Testing of a Java application, which tool is commonly used for testing web applications?
4. Which tool is commonly used for Performance Testing of Java web applications?
5. What is the primary focus of Database Testing in Java?
What is the primary goal of Unit Testing in Java?

What is the primary goal of Unit Testing in Java?

Selecciona la respuesta correcta

Which testing level focuses on assessing the interaction between various modules or components in a Java program?

Which testing level focuses on assessing the interaction between various modules or components in a Java program?

Selecciona la respuesta correcta

In Functional Testing of a Java application, which tool is commonly used for testing web applications?

In Functional Testing of a Java application, which tool is commonly used for testing web applications?

Selecciona la respuesta correcta

Which tool is commonly used for Performance Testing of Java web applications?

Which tool is commonly used for Performance Testing of Java web applications?

Selecciona la respuesta correcta

What is the primary focus of Database Testing in Java?

What is the primary focus of Database Testing in Java?

Selecciona la respuesta correcta

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 2
We're sorry to hear that something went wrong. What happened?
some-alt