Testing - makstron/info GitHub Wiki

Agile testing pyramid

Agile testing pyramid



Unit testing

Focuses on individual pieces of code—the smaller the better. This enables you to get a detailed view of the code’s quality and performance. And because these units require limited functionality to run, you get feedback fast. As such, it makes sense to automate these tests. Furthermore, automated unit testing makes it easier to pinpoint where the problems are, so you can more quickly remediate them.

  • Isolates individual units of code (functions, classes, modules) to verify their correctness independently.
  • Focuses on internal logic and behavior, ensuring each unit functions as intended.

Typically involves mocking dependencies to control external interactions.

Examples: Testing a sorting algorithm, validating a calculation function, checking error handling in a class.


Component testing

Comes after the unit testing and tests objects independently, such as modules, classes, and programs. These tests are more thorough than unit testing and often need access to a database or other components, so are slower than unit tests. That said, because you can define inputs and expected outputs, you can easily create automated tests without involving the user interface (UI).

Automating unit and component tests makes the testing process faster, more predictable, and repeatable.

  • Internal logic and behavior: Component tests concentrate on verifying the internal functionality and expected behavior of a specific component.
  • Isolation: Components are usually tested in isolation, minimizing dependencies on other parts of the system. This allows for precise testing and identification of individual component issues.

Approaches:

  • Unit testing: For code-level components like classes and functions, unit testing frameworks are often used to write isolated tests and mock dependencies.
  • UI testing: Testing UI components (buttons, forms, etc.) can involve specialized frameworks that interact with the UI elements directly or simulate user interactions.

Integration testing

Integration testing combines the individual software modules and tests them together as a group. It verifies whether or not the modules and services that make up your software work well together while exposing any defects in how they interact. This is especially important when different developers have worked on different components.

  • Checks how multiple units or components interact together.
  • Focuses on interfaces and data flow between components, ensuring they work together correctly.

Can involve testing modules, subsystems, or entire applications.

Examples: Testing data transfer between a database and a web service, verifying communication between modules in a system.


System testing

Verifies the overall system behavior and functionality, including interactions with external systems.

  • Focuses on end-to-end functionality, performance, and usability.
  • Often involves testing non-functional requirements such as security, reliability, and compatibility.

Examples: Testing a complete web application, validating a software installation process, performing load testing.

⚠️ **GitHub.com Fallback** ⚠️