Testing Approaches

  1. Black Box Testing 🖤

    • You don’t look inside the system.

    • You just test the input and output.

    • Example: You enter your username & password and check if login works — without caring how the code is written.

  2. White Box Testing 🤍

    • You look inside the code and test it.

    • You check logic, loops, conditions, and flows.

    • Example: You test if an if-else condition in the login function works correctly.

  3. Grey Box Testing 🩶

    • A mix of both.

    • You know some details of the code (not everything).

    • Example: You know the login system uses encryption, so you test both the functionality (black box) and a bit of the inner working (like encryption handling).

  • Black box = Only outside view (functionality).

  • White box = Only inside view (code).

  • Grey box = A mix of both.

Let’s use an ATM machine example:

  • Black Box Testing

    • You insert your card, enter PIN, withdraw money.

    • You don’t know how the ATM is processing your request inside.

    • You just check if the machine gives you the right amount of cash.

  • White Box Testing

    • Imagine you are the engineer who built the ATM software.

    • You open the code and test things like:

      • Is the PIN validation working correctly?

      • Is the balance check logic right?

      • Is the withdrawal logic secure?

  • Grey Box Testing

    • You are not a customer, but not the full developer either.

    • Maybe you’re a bank’s tester who knows the ATM uses a database and encryption.

    • You test not only the cash withdrawal but also check:

      • Is the database updated after withdrawal?

      • Is the encryption working for PIN storage?

  • Black box = Customer using ATM

  • White box = Developer testing ATM software code

  • Grey box = Bank tester with partial knowledge of inner system