RyanSchlomer.com

Sr QA Consultant

Testing for Beginners: Structured Testing vs Ad Hoc Testing

Posted by:

|

On:

|

,
Ad Hoc Testing

Welcome back to the “Testing for Beginners” series. In previous articles, we’ve covered the basics of testing, the Software Development Life Cycle (SDLC), writing bug reports, boundary testing, and input validation. Today, let’s look at Structured Testing and Ad Hoc Testing and see the differences and advantages.

What is Structured Testing?

Structured testing is a systematic approach where test cases are carefully designed before testing begins. This approach usually follows a well-defined test plan and is carried out with the aid of test scripts. The objective is to validate that the software meets predefined requirements and complies with certain specifications. Structured testing often employs test cases that are repeatable, which makes it easier to rerun the same tests for regression analysis in future development cycles.

Test Cases in Structured Testing

In structured testing, test cases are usually prepared by referring to the software’s requirements documentation. These test cases outline the specific conditions or variables under which the software will be examined. Here’s a simplified example:

  • Test Case: Validate the login functionality.
  • Preconditions: User must be registered.
  • Test Steps:
    1. Open the login page.
    2. Enter a valid username.
    3. Enter a valid password.
    4. Click the “Login” button.
  • Expected Result: User is successfully logged in and redirected to the dashboard.

What is Ad Hoc Testing?

Ad hoc testing, or exploratory testing, is a less structured approach. It’s carried out without a formal test plan or predefined test cases. The testers explore the application freely and investigate any issues or peculiarities they come across. The primary objective here is to find defects that structured testing might overlook, such as usability or performance issues.

Exploratory Nature of Ad Hoc Testing

In ad hoc testing, testers often rely on their expertise, intuition, and understanding of the system. They might try actions like:

  • Entering invalid data to see how the system responds.
  • Trying to perform unauthorized actions.
  • Rapidly switching between different functionalities to test system robustness.

Key Differences

Predictability

  • Structured Testing: Test Cases can be reviewed.
  • Ad Hoc Testing: Minimal Test Cases, if any.

Coverage

  • Structured Testing: Good for requirement-based coverage.
  • Ad Hoc Testing: Good for discovering hidden issues not covered by Test Cases

Time and Resources

  • Structured Testing: Requires more time and resources for test preparation.
  • Ad Hoc Testing: Generally quicker and needs fewer resources.

Conclusion

Both structured and ad hoc testing have their merits and are often used complementarily in a balanced testing strategy. Structured testing assures that all requirements are verified systematically, while ad hoc testing offers a safety net to catch what structured methods might miss. Understanding the strengths and weaknesses of each can help you make informed decisions in your testing activities.