What is Semantic testing
Semantic testing is a test technique with as goal to test the relationship between data. The relationship can exist in three different ways:
§ Relationship between input data on 1 screen
§ Relationship between input data on different screens
§ Relationship between input data on data already existing in the system
The outcome of this test technique might reveal that a relationship is missing or that a relationship was incorrectly implemented.
How to create a semantic test?
Identify the relationships to check
Search the test basis for relationships. Test bases containing useful information for this technique are for instance: data model, graphical user interface specifications (screen descriptions), functional requirement specifications.
These are examples of data relationships in a functional requirement specification document for travel booking system:
§ The user cannot check out if his shopping basket is empty
§ If the user orders at least 2 item on the "product overview" screen, he/she can enter a reduction code on the "check out" screen.
§ The delivery date can't be in the past (relationship between delivery date and system date)
§ The user has only access if his/her personal data is known by the system (relationship between sign-in name and information in the database)
Develop the relationships to check
Write down the relationships in a simple structure:
IF A
THEN B
ELSE C
Example:
If the user orders at least 2 item on the "product overview" screen, he/she can enter a reduction code on the "check out" screen. Reduction codes can only be used on Sunday. On other days a message is shown to promote shopping on Sundays.
IF day = Sunday
THEN
IF items ordered >= 2
THEN reduction code field is available
ELSE reduction code field is not available
ELSE Sunday shopping promotion message
Create test cases
Every line where a THEN or an ELSE statement is placed but not IF statement, forms an end-point of a test pathway. For above example, we can find back three pathways:
IF day = Sunday
THEN
IF items ordered >= 2
THEN reduction code field is available (-> pathway 1)
ELSE reduction code field is not available (-> pathway 2)
ELSE Sunday shopping promotion message (-> pathway 3)
For each pathway a test case can be created:
Test case 1: on Sunday order 5 items
Expected result: reduction code is available
Test case 2: on Sunday order 1 item
Expected result: reduction code is not available
Test case 3: on Thursday order 5 items
Expected result: reduction code is not available
Where to apply semantic testing?
Semantic testing is a black-box test technique which is useful at System testing level and Acceptance testing level. An authentication procedure for instance is a typical example requiring semantic testing.
No comments:
Post a Comment