DEV Community

Cover image for Test Case Writing In Software Testing
G Gokul
G Gokul

Posted on

Test Case Writing In Software Testing

Software testing:

  • Software testing is the process of evaluating and verifying that a software application functions correctly, securely, and efficiently according to its business and technical requirements.
  • Its primary goal is to identify bugs, reduce operational risks, and ensure high product quality before the code is released to production.

Test case:

  • A test case is a set of conditions, variables, and sequential steps written by QA professionals to verify whether a specific feature of a software application functions correctly and as intended.
  • Essentially, it acts as a detailed roadmap that provides the precise steps, inputs, and expected outcomes required to validate a software requirement.

why test case is needed?
A test case is needed to provide a clear, step-by-step blueprint that verifies if a software system works correctly, meets requirements, and catches hidden bugs before users find them.

when do you write test case?
Test cases are written during the Test Case Design phase of a project, right after requirements are approved and before the software features are fully tested.

how to write test case in software testing?
To write a test case in software testing, you must convert software requirements into a clear, step-by-step set of instructions that verifies whether a specific feature works as intended.

Components of a Test Case:

  1. Test Case ID: A unique identifier used for tracking and documentation.
  2. Description: A brief summary explaining what functionality is being tested.
  3. Preconditions: The required system state before the test can begin.
  4. Test Data: The specific inputs or variables required for the test steps.
  5. Test Steps: Sequential instructions detailing exactly how to execute the test.
  6. Expected Result: The ideal or required outcome the software should display.
  7. Actual Result:The real behavior of the system observed during execution.
  8. Status: Marked as Pass if the actual result matches the expected result, or Fail if they do not.

Types of Test Cases:(TBD)

  1. Functional: Verifies whether a core feature performs correctly based on functional specifications.
  2. UI (User Interface): Checks for visual accuracy, readability, layout, and responsive design elements.
  3. Performance: Evaluates app speed, stability, and scaling behavior under varied user loads.
  4. Security: Targets vulnerabilities to ensure safe data handling and unauthorized access blocks.
  5. Regression: Confirms that new code modifications do not unintentionally break existing, stable functionality.

Test Scenario:

  • A high-level description of a feature or a user journey to be tested.
  • It answers "What to test" from an end-user's perspective.
  • It is usually written as a single line.

Example test case:
I

Task
I

Difference between test case and test scenario:
I

Top comments (0)