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:

Production Coverage

1 of 124 articles shown, currently no other people reading this forum.
From: Arran S.
Date: Wed 20th May 2020, 11:25am



# Meaning of "production"

The terminology here is not terribly intuitive.

But for our purposes, "production" is probably best thought of as meaning "branch" or 

So there are two productions for <integer>: an integer can either be <digit>, or it can be 
<integer><digit>. That is, there are two "possible ways of re-writing <integer>".

And there are 10 productions for <digit> (the 10 alternatives listed).

So that means there are 10 + 2 or 12 different productions, and 12 tests are needed for 
production coverage. 

(If you check the relevant textbook section, you'll note that it says that production 
coverage is a lot like "edge coverage" for graphs. For graphs, that would mean we've tried 
all branches out from a node for a graph. For grammars, it means we've tried all 
"branches" or "alternatives" out from a given non-terminal.)

# Meaning of "rule"

The textbook terminology says that "rule" and "production" mean exactly the same thing. 
But I would suggest ignoring that. Most people would say that the following is two rules:

<integer> ::= <digit>|<integer><digit>
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" |
            "7" | "8" | "9"

i.e., two things with a left-hand side and right-hand side.

And if you wanted a form of coverage that used all the rules once, you'd need two tests. I 
think this is what you have in mind?

Now, that sort of coverage doesn't have a name (so far as I know), but you could call it 
"non-terminal coverage" (since every non-terminal is used once). Or you could 
hypothetically call it "rule coverage" (if you use "rule" in the sense most people use 
it), but it's probably best not to call it that, since it contradicts the definition of 
"rule" given in the textbook.

Does that clarify things at all? If not, let me know, and I'll try writing up a slightly 
more extensive explanation and adding it to the "resources" page.




> In the slides there's an example of a syntax like so 
> <integer> ::= <digit>|<integer><digit>
> <digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" |
> "7" | "8" | "9"
> Terminal Symbol Coverage is fairly straightforward to see.
> However a Production is defined as "each possible re-writing of a non-terminal". 
> How come terminals are included in the definition of a production since they can't 
> possibly be re-written any further e.g. why is the number of Product Coverage tests 
> 12 and not 2?
> Thanks in advance

Related articles

Production Coverage (all 4) RSS
├─ original   Wed 20th May 2020, 8:03am, ANONYMOUS
├─ THIS   Wed 20th May 2020, 11:25am, Arran S.
├─ reply 2   Wed 20th May 2020, 12:34pm, David S.
└─ reply 3   Wed 20th May 2020, 12:35pm, David S.
This Page

Program written by: [email protected]
Feedback welcome
Last modified: 11:27am Sep 21 2020