Faculty of Engineering and Mathematical Sciences 
Not logged in (login)


This forum is provided to promote discussion amongst students enrolled in CITS5501 Software Testing and Quality Assurance.

Before posting a question here, you might like to (1) search the forum for previous posts asking the same question, and (2) read the article How To Ask Questions The Smart Way .
And please keep the discussion civil (as required by UWA's Computer Use Policy, #9).

RSS cloud
Jump to:

project question 2

2 of 124 articles shown, currently no other people reading this forum.
From: Arran S.
Date: Thu 28th May, 10:53am


I was asked:

> for the example of 
> <greetings> ::= "hello" <statement> | "hi" <statement>
> <statement> ::=  "you" | "world"
> Would I be correct in saying there are 4 terminal symbols (eg. hello, hi, you, world)?

Yes, there are four terminal symbols in that grammar - I've labelled them in this image:


> [and 4 productions?]

Yup. You can just think of "production" as meaning a "branch" or "alternative". As you say:  <greetings> has two alternatives, and 
<statement> has two alternatives. So 4 total.

I've labelled them in this image:


So, note that the definition of "production" we're using means there are three productions in the following grammar, let's call it 
grammar A:

<outerthing> := <middlething>
<middlething> := <innerthing>
<innerthing> := "good morning"

But there is only one production in *this* grammar, let's call it grammar B:

<onlything> := "good morning"

So if we want production coverage, grammar A needs more tests than grammar B, even though they ultimately define exactly the same 
language. But that's okay. If we had some reason for using Grammar A instead of Grammar B (maybe we're leaving room in our language 
for future expansion, for instance), well, Grammar A definitely has more "parts" to it where failures might occur in an implementation 
- so we intuitively should expect there to be more tests.



project question 2

From: Arran S.  O.P.
Date: Thu 28th May, 10:56am


Oh, and as a follow-up - in any question where you're asked to give a numeric answer: ALWAYS show your working.

Since if you show your working and state your assumptions, the marker can award part marks, even if your final answer is incorrect.


This Page

Program written by: [email protected]
Feedback welcome
Last modified:  3:57pm Aug 06 2020