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.

Related Posts by Categories

Comments

6 Responses to "What is semantic testing?"

Robin said... March 12, 2009 at 3:12 PM

you slipped a little bit in your logic, your test cases state that on thursday the reduction code is available although when you start your explanation you state that the reductions are only available on Sundays. Also multiple items should be ordered and not one to benefit from the reduction.

Steven Machtelinckx said... March 12, 2009 at 5:25 PM

Indeed, you are right, I slipped a bit :-) I switched the days in the test case part and forgot to update the #days switch. Meanwhile I fixed the error in the test cases. Thanks Robin!

semantic alley said... April 20, 2011 at 11:29 AM

Robin was right , but this is a very usefull Article anyway Steven!

suhasini konduru said... February 29, 2012 at 10:04 AM

Nice article

TestWithUs said... May 7, 2013 at 6:40 AM

SWIFT Interview questions on

http://testwithus.blogspot.in/p/swift.htm

For selenium solution visit
http://testwithus.blogspot.in/p/blog-page.html


For QTP interview questions

http://testwithus.blogspot.in/p/qtp-questions.html


www.searchyourpolicy.com




Hemal Shrimarkar said... August 2, 2013 at 9:04 AM

Nice article!!! If you are looking for Software Testing then we provide all the information on Software Testing Services.

Post a Comment

Recent Articles

Top Commenters

Recent Comments