Software Engineering Principles and Practices / Software Testing

Levels of Testing

In software engineering, we don't just test the finished product. We test at every stage of construction. This is organized into Levels of Testing, often visualized as the Testing Pyramid.

As you move up the levels, the tests become more complex, take longer to run, and involve more of the system's "big picture."


🧱 Unit Testing (Level 1)

This is the "atomic" level of testing. It focuses on the smallest testable parts of the software, such as individual functions, methods, or classes.

  • Who: Usually done by Developers.

  • Goal: To verify that each piece of logic (e.g., a tax calculation function) works correctly in isolation.

  • Technique: Primarily White Box Testing.

🖇️ Integration Testing (Level 2)

Once individual units are tested, they are combined and tested as a group. This level focuses on the interfaces and communication between modules.

  • Goal: To find "interaction bugs" (e.g., Module A sends a date in DD/MM format, but Module B expects MM/DD).

  • Strategies:

    • Top-Down: Start from the high-level UI and work down.

    • Bottom-Up: Start from the low-level utilities and work up.

    • Big Bang: Connect everything at once (generally avoided!).

🖥️ System Testing (Level 3)

This is the first time the entire integrated software is tested as a whole. The goal is to verify that the system meets the original requirements specified in the SRS.

  • Who: Usually done by a dedicated QA (Quality Assurance) Team.

  • Focus: Functional requirements (features) and Non-functional requirements (security, performance, stress).

  • Technique: Primarily Black Box Testing.

✅ Acceptance Testing (Level 4)

The final level before the software "goes live." It determines whether the system is ready for release and satisfies the business needs.

  • Alpha Testing: Done by internal staff at the developer’s site.

  • Beta Testing: Done by a small group of actual users in their own environment.

  • Goal: To get the final "sign-off" from the customer.


📊 Summary Table: Comparing the Levels

Level

Focus

Primary Goal

Done By

Unit

Single code module

Find logic errors in code

Developer

Integration

Communication between modules

Find interface errors

Developer/Tester

System

Entire software product

Verify SRS requirements

Independent QA

Acceptance

Business needs

Get approval for release

End User/Customer


💡 The Testing Pyramid Strategy

A healthy project follows the "Pyramid" rule:

  1. Many Unit Tests: They are fast and cheap.

  2. Fewer Integration Tests: They are more complex.

  3. Very Few Manual/UI Tests: These are the most expensive and slowest to run.