What's testing in software development?

Mohammad Jawad (Kasir) Barati - Aug 2 - - Dev Community

So The goal of testing is:

  • To test that users can actually use an app.
  • To test that an app doesn't break when:
    • Bad data are entered.
    • Unexpected actions are performed.
  • Anticipating what would happen when a user:
    • Makes a typo.
    • Tries to save an incomplete form.
    • Uses the wrong API.
  • Check if someone can easily compromise data or gain access to a resource they're not supposed to.
  • A good testing suite should try to break your app and help understand its limit.

Tests -- categorized according to their execution type

  • Automated tests: performed by a machine that executes a test script that was written in advance.
  • Manual tests.

Tests categorized according to their execution type

A quick run down for the ones I felt are more common.

Unit testing Integration testing E2E testing Smoke testing
Cost Cheap Expensive Expensive Moderate
Complexity (setup & maintain) Easy Hard Harder Moderate
Objective Individual methods/functions work well Different modules/services work well together Verifies that various user flows work as expected The major features of the system are working as expected.

Learn more about Automated tests here.

Functional tests VS integration tests.

  • An integration test may simply verify that you can query the database.
  • While a functional test would expect to get a specific value from the database as defined by the product requirements.

Tests -- categorized according to their scope

  • Black-box:
    • The tester is not concerned with the implementation details.
    • Focused on validating the functionality based on the provided specifications/requirements.
    • What's input and output.
  • White-box:
    • Focuses on code coverage:
    • Path coverage: 3 / 0 throws an error for an additional operation.
    • Statement coverage: 3 + 3 equals 6 for an additional operation.
    • Analyze the
    • Internal structures the used data structures.
    • Internal design.
    • Code structure.
    • AKA:
    • Open box testing.
    • Glass box testing.
    • Clear box testing.
    • Structural testing.
    • Transparent testing.

Tests categorized according to their scope

Most important aspects of the two, put together side by side.

Black Box Testing White Box Testing
Objective Testing the functionality of the software. Ensuring the internal code is correct and efficient.
Scope Overall behavior. Internal logic.
Performed by QA Developer
Development methodology BDD (Behavior-Driven Development) TDD (Test-Driven Development)
Granularity Just test CBP and the positive scenarios. Go for code coverage -- Do not go overboard, sometimes it does not worth having 100% code coverage.

Learn more.

. . . . . . . . . . . . . . . . . . .