Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Software Testing

Lecture 7

Test Case, Static Test

Chapter 4: Static Test


Agenda for today
 Test Case
 Why we write test cases
 Test case format and example
 How to write good test cases
 Test case pro and cons
 Test case management tools
 Static testing with example
 Dynamic testing with example
 Static vs Dynamic Testing
Test Case
• A test case is a set of conditions or variables under which a tester will
determine whether a system under test satisfies requirements or works
correctly.
• A typical test case is laid out in a table, and includes:
 A unique name and number
 A requirement which this test case is exercising
 Preconditions
 Steps
 Expected Results

• There can be 1:1 or 1:N or N:1 or N:N relationship between requirements


and Test cases
• The level of details specified in test cases will vary depending on
Organizations, Projects etc
Why we write test cases?
• Validate the testing coverage of the application
• Test coverage measures the amount of testing performed by a set of
test.
• Finding issues or gaps in the requirements
• You can simulate 'real' end user scenarios
• Helps you to validate expectations and customer requirements
• When test cases are written for test execution, the test engineer's work
will be organized better and simplified
Test Case, Test Scenarios, Test Script 
Test Scenarios:  A Test Scenario is any functionality that can be tested.
It is also called Test Condition or Test Possibility.
Test Case:  It is a document that contains the steps that has to be
executed, it has been planned earlier.
Test Case vs Test scenario:
Test Case includes test steps, data, expected results for testing whereas
Test Scenario includes an end to end functionality to be tested.
Test Script:  A written set of steps that should be performed manually.
Test Case Format
Test case ID: The Unique_ID of the test case
Test case Scenario The objective or summary of the test case

Preconditions: Any preconditions which need to be executed before starting the


test
Test steps: Procedure to execute the test.
Test data: Data required while executing the test
Expected Result: The expected output of the test
Actual Result: The actual output of the test

Test Case Status: Pass, Fail, ‘Not executed’ when test case is not executed and
‘Blocked’ when high severity bug is found
Created By: Name of the person who wrote the test case
Date of creation: The date on which the test case was authored
Executed By: Name of the person who ran or executed the test case
Date of execution: The date on which the test case was executed
Test Case Example’s
Test Test Test Steps Test Data Expected Actual Pass/
Case Scenario Results Results Fail
ID
TC01 Check 1.Go to Userid = User should As Pass
Customer site http://faculty.co test123 Login into Expected
Login with msats.edu.pk Password = application
valid Data 2.Enter UserId pass123
3.Enter Password
4.Click Submit

TC02 Check 1.Go to site Userid = User should As Pass


Customer http://faculty.comsa test123 not Login Expected
Login with ts.edu.pk Password = into
invalid Data 2.Enter UserId pass123 application
3.Enter Password
4.Click Submit
How to write good Test Cases?
• Customer Requirement
• Straightforward, Simple and Clear
• Do NOT assume
• Unique test cases
• Should NOT be repeated
• Assure 100% test coverage
• Implementation of Testing Techniques
• Peer Review of Test Cases
Test Cases Advantages
• Better Consistency 
• Avoid training 
• No dependency
• Writing test cases will keep track of all the steps for a particular scenario
• Test cases will ensure that complete functional and non functional testing will
be done
• To ensure that it satisfies the BRS and SRS
• Test cases will ensure that every functionality working as expected in every
possible scenario.
• Test cases will ensure that all the requirements have been met as per the
customer requirement document.
Test Cases Disadvantages
• Creating test cases can be time and effort consuming.
• If any feature becomes obsolete then the associated test cases should
be cleaned
Test Case Management Tools
• For documenting Test Cases
• Execute the Test Case and Record the results
• Automate the Defect Tracking:
• Traceability: 
• Protecting Test Cases
Test Management Tools are:
 qTest
 PractiTest
 QAComplete
 Aqua …… and many others
Static Testing
• Static testing techniques summarize various methods, that do not
execute the component or the system that is being tested.
Static testing include:
Reviews (manual activity)
Static analysis (mostly tool based activity)

• Static examinations, like reviews, tool supported document and code


analyses, can be successfully used for quality improvement
• Test object is not executed here, but it is analyzed instead
• Objective is defect prevention at early stage
• Example: verifying a document
Static Testing
• Static testing involves manual or automated reviews of the documents.
• This review, is  done during initial phase of testing to catch  defect early in
STLC. It examines work documents and provides review
comments
• Work document can be of following:
Requirement specifications
Design document
Source Code
Test Plans
Test Cases
Test Scripts
Help or User document
Web Page content      
Dynamic Testing
• It’s a software testing process that is performed in an environment
where the code is actually executed.
• Dynamic analysis refers to the examination of the physical response
from the system to variables that are not constant and change with
time.
• It’s also called as Execution technique or validation testing.
• It finds and fixes the defects
• Example: Login Page where we have two fields say "Username" and
"Password" and the Username is restricted to Alphanumeric.
Static Testing vs Dynamic Testing
Static Testing Dynamic Testing
Testing done without executing the program Testing done by executing the program
This testing does verification process Dynamic testing does validation process  
Static testing is about prevention of defects Dynamic testing is about finding and fixing the defects

Static testing gives assessment of code and Dynamic testing gives bugs/bottlenecks in the software
documentation system.

Static testing involves checklist and process to be Dynamic testing involves test cases for execution
followed

This testing can be performed before compilation Dynamic testing is performed after compilation
Cost of finding defects and fixing is less Cost of finding and fixing defects is high
More reviews  comments are highly More defects are highly recommended for good quality.
recommended for good quality

Requires loads of meetings Comparatively requires lesser meetings


Thank you

You might also like