Activity: Syntax-based testing (Grammar)

(no submission)

Purpose: Understand the basic concept of syntax-based testing (focus on Grammar-based mutation); get ready to work on homework assignment, and prepare for the final exam.

You may make a copy of a worksheet and complete this activity, or type your answers in any text editor.

You may work alone or with at most two other students in this course.


Consider the following BNF and answer the questions
  A ::= MO | MB | MOB
  M ::= "1" | "2" | "3" | "4" 
  O ::= "e" | "a" | "t" 
  B ::= "h" | "u" | "n" | "g" | "r" | "y" | "w"   
  1. How many nonterminal symbols are in the grammar?
  2. How many terminal symbols are in the grammar?
  3. Write two strings that are valid according to the BNF
  4. For each of your two strings, give two valid mutants of the string
  5. For each of your two strings, give two invalid mutants of the string

Copyright © 2025 Upsorn Praphamontripong
Released under the Creative Commons License CC-BY-NC-SA 4.0 license.
Last updated 2025-11-01 18:21