Skip to main content

Description of the method

Task 1

sectionDecision 9.3.1,testing partbelongs 1. Translateto the belowfamily textof logical coverages, as it's concerned with the values of logical predicates in deciding instructions. The other name for the technique comes from there: predicate coverage. A decision is simply a logical statement that can take the value of true or false.


Decision result – an output of a decision, determining the branch to follow


Examples of deciding instructions:

  • if conditional instruction: if (decision) then …;

  • while instruction condition: while (decision) do …;

  • do-while instruction condition: do … while (decision);

  • switch-case instruction;

  • for loop instruction condition: for (initialization; decision; incrementation) do condition …;

Decision testing requires that every instruction in the program takes the logical value of true and deletefalse at least once each. For example if the picturefollowing instruction exists in a program:

image.png

if (x > 0 and y == 0) then …


then the (x > 0 ∧y = 0) condition must be true at least once and must be false at least once. The result can be forced to be true by for example assuming that: x = 1 and y = 0, and to be false by having: x = 1 and y = 1.

 

Task 2

section 9.3.1, part 2. Translate the below text and delete the picture

image.png

Task 3

section 9.3.1, part 3. Translate the below text and delete the picture

image.png

Task 4

Decision

section Cover9.3.1, part results4. of results that have been developed byTranslate the testbelow set.text 100%and decision coverage implies 100% transformation coverage Test conditions -> CFG vertices representing decisions Coverage elements -> CFG edges ofdelete the decision result Coverage criterion -> critical decision resolution once confirmed meaning of true coverage and once false value Coverage → p = number of CFG decision edges covered by tests / number of all CFG decision edges * 100% (In the case of CFG with 1 block 0% or 100% as a result of application of the instruction)

picture

image.png