Interview Questions on Test Case Writing
1) What is Test Case?
A set of input values, execution preconditions, expected results and execution
postconditions, developed for a particular objective or test condition, such as to exercise a particular program path or to verify compliance with a specific requirement.
2) Who prepare Test Cases?
In System Testing Level Testers prepare test cases under the guidance of Test Lead.
In Unit Testing Level developers prepare Unit test cases.
3) Give a sample Test Case Template?
Sample Test Case Template:
i) Test Case Id: a Unique name/number (Alphanumeric)
ii) Test Case Name: Name of Test Case
iii) Test Suite ID: Unique name/number (Alphanumeric)
iv) Pre-Condition: Status before Test Case Execution
v) Steps: Steps for Executing the Test Case
vi) Post-Condition: Status After Test Case Execution
vii) Expected Result: Expected Result as per Requirements
viii) Actual Results:
ix) Test Results: Pass / Fail
x) Remarks: Comments (Optional)
Note 1: You prepare this Test Case Template in Excel Sheet
Note 2: Test Case Template may vary from one company from another and one project to another.
Note 3: In the above template Actual Results and Test Results fields can be filled in Test Execution phase, Remaining fields in Test Design phase.
4) What is Test Data?
Data that exists (for example, in a database) before a test is executed, and that affects or is affected by the component or system under test.
5) What is the relation between Test case and Test data?
We use Test data as input for executing test cases
6) How to collect Test Data?
Some test data we (testers) prepare,
Some Test data we collect from Developers,
Some Test Data we collect from Customers and other sources.
7) Is test data mandatory for every test case?
Test Data is not mandatory for every test case.
8) What is Test Procedure?
A document specifying a sequence of actions for the execution of a test. Also known as test script or manual test script.
9) What are Database Test cases?
Database Test cases for verifying Data integrity, Data Manipulations (Add/Edit/Delete), Data comparisons, Data retrievals and search operations
10) How we derive Test cases?
We derive test cases from Test scenarios, Test scenarios derived from Requirements
Another method, we can derive test cases from use cases(if available)
11) How to write good Test cases?
writing good test cases
i. Analyzing requirements
To write a good test case, a tester needs to understand the requirement. In what context the requirement is described and what needs to be tested and how. What must be the expected result etc?
ii. Writing test cases (test designing)
A test case is developed based on the high level scenarios, which are in turn developed from the requirement. So, every requirement must have at least one test case. This test case needs to be wholly concentrated on the requirement.
For ex: Lets take yahoomail.com, in this website, the requirement says that username can accept alphanumeric characters. So, the test case must be written to check for different combinations like testing with only alphabets, only numeric and alphanumeric characters. And the test data what you give for each test case is different for each combination. Like this, we can write any number of test cases, but optimization of these test cases is important. Optimize exactly what all test cases we need and what not.
12) What is Use case?
A sequence of transactions in a dialogue between an actor and a component or system with a tangible result, where an actor can be a user or anything that can exchange information with the system.
13) What is the difference between use case and test case?
Use case is a Business scenario or User scenario, we derive test cases from use cases.
14) What is Test Scenario?
15) What is the difference between test scenario and test case?
A test case is the procedure followed to execute a test, it consists of the details about the input and expected result.
Test scenarios are based on a hypothetical story to help a person to think through a complex program or a system.
Test cases derived from Test Scenarios.
16) What is positive Test case?
It is intended for Verifying a Component or System’s behavior using Valid inputs.
17) What is negative Test case?
It is intended for Verifying a Component or System’s behavior using Invalid inputs.
18) What Test suite?
Series of Test Cases is called Test Suite or Test Batch or Test Set.
19) How to create test batches?
We create Test batches based on sequence and dependencies
20) When we modify Test cases give an example?
If any Modifications are there in Requirements then we modify test cases
21) What is Test Schedule?
A list of activities, tasks or events of the test process, identifying their intended start and finish dates and/or times, and interdependencies.
22) What is Test Session?
An uninterrupted period of time spent in executing tests. In exploratory testing, each test session is focused on a charter, but testers can also explore new opportunities or issues during a session. The tester creates and executes test cases on the fly and records their progress.
23) What is Test Infrastructure?
The organizational artifacts needed to perform testing, consisting of test
environments, test tools, office environment and procedures.
24) What is Test Environment?
An environment containing hardware, instrumentation, simulators, software tools, and other support elements needed to conduct a test.
25) What is Test Condition?
An item or event of a component or system that could be verified by one or
more test cases, e.g. a function, transaction, feature, quality attribute, or structural element.