SlideShare a Scribd company logo
2
Most read
8
Most read
16
Most read
Statement Testing and Statement Coverage
                     with




Prepare yourself for the ISTQB exam
Dictionary
statement: an entity in a programming language, which is typically
the smallest indivisible unit of execution.

statement testing: a white box test design technique in which
test cases are designed to execute statements.

statement coverage: the percentage of executable statements
that have been exercised by a test suite.

executable statement: a statement which, when compiled, is
translated into object code, and which will be executed procedurally
when the program is running and may perform an action on data.

code coverage: an analysis method that determines which parts
of the software have been executed (covered) by the test suite and
which parts have not been executed, e.g. statement coverage,
decision coverage or condition coverage.
                          From „Standard glossary of terms used in Software Testing”

 Copyright © 2013
What is…?

Statement coverage is the assessment
of the percentage of executable
statements that have been exercised by a
test case suite.

Statement testing derives test cases to
execute specific statements, normally to
increase statement coverage.

                     From „Certified Tester Foundation Level Syllabus (version 2011)”


Copyright © 2013
Rules




100% branch coverage implies both 100%
decision coverage and 100% statement
coverage.




                   From „Certified Tester Foundation Level Syllabus (version 2011)”


Copyright © 2013
Examples with sequential code
a = b + c
d = e * e
                        In order to cover all
                       statements, you need
                            1 test case.




Copyright © 2013
Examples with IF
IF (wa)
{
  ev = ghd - pkq / cds;     In order to cover all
}                          statements, you need
                                1 test case.




Copyright © 2013
Examples with IF ELSE
IF (weu)
{
  i = o - f;        In order to cover all
}                  statements, you need
ELSE                    2 test cases.
{
  u = gkt * k;
}




Copyright © 2013
Examples with SWITCH
SWITCH (yc)
{
  CASE 0:                   In order to cover all
    epl = o / c;           statements, you need
    break;                      4 test cases.
  CASE 1:
    p = wt * bd;
    break;
  CASE 2:
    fbt = xg + ana - cs;
    break;
  DEFAULT:
    qxn = q / ti;
    break;
}




Copyright © 2013
Examples with WHILE
a = 1;
WHILE (a < 5)
{                   In order to cover all
  b = c;           statements, you need
  a++;                  1 test case.
}




Copyright © 2013
Examples with DO WHILE
DO{
   a = a + 1
} WHILE (a <= 0)    In order to cover all
                   statements, you need
                        1 test case.




Copyright © 2013
Examples with FOR
FOR (a = 5; a > -5; a--)
{
  b = c + 1;                In order to cover all
}                          statements, you need
                                1 test case.




Copyright © 2013
More examples
IF (a)
{
  b = c + d;                In order to cover all
}                          statements, you need
ELSE                            2 test cases.
{
  IF (e)
  {
    b = c - d;
  }
}




Copyright © 2013
More examples
IF (a)
{
  IF (f)                    In order to cover all
  {                        statements, you need
    g = h - i;                  2 test cases.
  }
}
ELSE
{
  IF (e)
  {
    b = c - d;
  }
}




Copyright © 2013
More examples
SWITCH (a)
{
  CASE 0:
    IF (b)                  In order to cover all
    {                      statements, you need
      c;                        3 test cases.
    }
    break;
  CASE 1:
    IF (d)
    {
      e;
    }
    ELSE
    {
      f;
    }
    break;
}



Copyright © 2012
More examples with…
TestCompetence allows you to generate sample pseudocode to pracitse whitebox
techniques including statement coverage…




  Copyright © 2013
More examples with…
TestCompetence allows you to generate sample pseudocode to pracitse whitebox
techniques including statement coverage…

                                                                  Choose the
                                                                   maximum
                                                                   number of
     Choose the                                                   instructions
       level of                                                    per level.
        nested
     statements.                                                    Choose the
                                                                       type of
      Choose the                                                     coverage
        type of                                                         from:
      statement.                                                    statement,
                                                                      decision,
                                                                      codition,
                                                                      multiple
                                                                     condition,
    GENERATE                                                       and modified
   your exercise.                                                    condition.



  Copyright © 2013
More examples with…
You get pseudocode and sample answers just like during a regular ISTQB exam.
Choose the right answer.




     Pseudocode




                                                                        Choose
                                                                       an answer.




  Copyright © 2013
More examples with…
You get pseudocode and sample answers just like during a regular ISTQB exam.
Choose the right answer.




     Pseudocode




                                                                      Your answer




                                                                     Right answer




  Copyright © 2013
How to get it…
Visit TestCompetence.com and get one for only…




                     EURO   /                    USD


       Unlimited number of exercises during 24 hours!




Copyright © 2013
Check also examples for…

• Decision testing and coverage >>

• Condition testing and coverage >>

• Multiple condition testing and
  coverage >>

• Modified condition decision
  combination (MC/CD) coverage >>
 Copyright © 2013
Statement Testing and Statement Coverage. ISTQB whitebox techniques with TestCompetence

More Related Content

PDF
Decision Testing and Decision Coverage. ISTQB Whitebox techniques with TestCo...
PPTX
Unit 2 - Test Case Design
PPTX
Se (techniques for black box testing ppt)
PDF
What is Integration Testing? | Edureka
PPT
Dynamic Testing
PDF
Software testing methods, levels and types
PPT
Textbox n label
Decision Testing and Decision Coverage. ISTQB Whitebox techniques with TestCo...
Unit 2 - Test Case Design
Se (techniques for black box testing ppt)
What is Integration Testing? | Edureka
Dynamic Testing
Software testing methods, levels and types
Textbox n label

What's hot (20)

PPTX
Black box software testing
PPSX
PPTX
Equivalence partinioning and boundary value analysis
PPT
SQLITE Android
PPT
6. Integrity and Security in DBMS
PPTX
Arrays in Java
PPT
Unit 5 testing -software quality assurance
PPTX
Path Testing
PPTX
Equivalence class testing
PPTX
Java swing
PPTX
SQL Functions
PPT
Nondeterministic Finite Automata
PDF
Cause effect graphing.ppt
PPT
Gray box testing
PPT
Path testing, data flow testing
PPTX
PPT
Architecture of .net framework
PPTX
Interface java
PDF
User Interface Testing. What is UI Testing and Why it is so important?
PPT
Software Testing Fundamentals
Black box software testing
Equivalence partinioning and boundary value analysis
SQLITE Android
6. Integrity and Security in DBMS
Arrays in Java
Unit 5 testing -software quality assurance
Path Testing
Equivalence class testing
Java swing
SQL Functions
Nondeterministic Finite Automata
Cause effect graphing.ppt
Gray box testing
Path testing, data flow testing
Architecture of .net framework
Interface java
User Interface Testing. What is UI Testing and Why it is so important?
Software Testing Fundamentals
Ad

Similar to Statement Testing and Statement Coverage. ISTQB whitebox techniques with TestCompetence (20)

PDF
Condition Determination Testing and Coverage. ISTQB White-box Techniques with...
PPTX
Test design techniques: Structured and Experienced-based techniques
PPTX
Programming Fundamentals Lecture 04 Hamdard University
PPT
Cprogrammingprogramcontrols
PDF
Programming in C Session 1
PDF
Evolving The Java Language
PPTX
Building high productivity applications
PPS
Lesson 2....PPT 1
PPT
QTP VB Script Trainings
PDF
Na50 enus devi_14
PPTX
Java basics and java variables
PPTX
lecture 6 bca 1 year-1.pptx
PDF
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
PPTX
Repair dagstuhl jan2017
PDF
Clean code
PDF
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
PDF
Journey's diary developing a framework using tdd
PPT
Chapter 4 flow control structures and arrays
PPT
Code coverage in theory and in practice form the do178 b perspective
PPT
Code Coverage in Theory and in practice form the DO178B perspective
Condition Determination Testing and Coverage. ISTQB White-box Techniques with...
Test design techniques: Structured and Experienced-based techniques
Programming Fundamentals Lecture 04 Hamdard University
Cprogrammingprogramcontrols
Programming in C Session 1
Evolving The Java Language
Building high productivity applications
Lesson 2....PPT 1
QTP VB Script Trainings
Na50 enus devi_14
Java basics and java variables
lecture 6 bca 1 year-1.pptx
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
Repair dagstuhl jan2017
Clean code
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Journey's diary developing a framework using tdd
Chapter 4 flow control structures and arrays
Code coverage in theory and in practice form the do178 b perspective
Code Coverage in Theory and in practice form the DO178B perspective
Ad

More from Radoslaw Smilgin (20)

PDF
Automatyzacja w praktyce. Praktyka automatyzacji
PPTX
Accessibility for all platforms and all people
PDF
Kwestionowanie ISTQB
PDF
Transformacja od formalnego do eksploracyjnego testowania. Moja historia
PDF
Testerska edukacja dzisiaj
PDF
Tester eksploracyjny. Ostatni zawód na świecie.
PPTX
Eksploracja w kulturze Agile i DevOps czyli o zwinnym testowaniu eksploracyjnym
PDF
Testy eksploracyjne. Wyższy poziom testowania.
PDF
Testy eksploracyjne - podstawy i przykłady
PDF
TestingCup 2017 - historia i nowości
PPT
60 minut testowania - czyli co tester może osiągnąć w jedną godzinę przy pomo...
PDF
TestingCup 2016
PDF
Context Driven School of testing w prostych przykładach
PDF
TestArena Instrukcja obsługi dla wersji 3.0.929
PPTX
Zawód tester - spotkanie z autorem książki
PDF
AutoMagicTest – automatyzacja bez kodowania?
PDF
Continuous performance management with Gatling
PDF
Budowanie biznesu w testerskiej niszy
PDF
Zawód testerka. Proste drogi do zawodu.
PDF
TestingCup 2015 - prezentacja wprowadzająca do zawodów.
Automatyzacja w praktyce. Praktyka automatyzacji
Accessibility for all platforms and all people
Kwestionowanie ISTQB
Transformacja od formalnego do eksploracyjnego testowania. Moja historia
Testerska edukacja dzisiaj
Tester eksploracyjny. Ostatni zawód na świecie.
Eksploracja w kulturze Agile i DevOps czyli o zwinnym testowaniu eksploracyjnym
Testy eksploracyjne. Wyższy poziom testowania.
Testy eksploracyjne - podstawy i przykłady
TestingCup 2017 - historia i nowości
60 minut testowania - czyli co tester może osiągnąć w jedną godzinę przy pomo...
TestingCup 2016
Context Driven School of testing w prostych przykładach
TestArena Instrukcja obsługi dla wersji 3.0.929
Zawód tester - spotkanie z autorem książki
AutoMagicTest – automatyzacja bez kodowania?
Continuous performance management with Gatling
Budowanie biznesu w testerskiej niszy
Zawód testerka. Proste drogi do zawodu.
TestingCup 2015 - prezentacja wprowadzająca do zawodów.

Statement Testing and Statement Coverage. ISTQB whitebox techniques with TestCompetence

  • 1. Statement Testing and Statement Coverage with Prepare yourself for the ISTQB exam
  • 2. Dictionary statement: an entity in a programming language, which is typically the smallest indivisible unit of execution. statement testing: a white box test design technique in which test cases are designed to execute statements. statement coverage: the percentage of executable statements that have been exercised by a test suite. executable statement: a statement which, when compiled, is translated into object code, and which will be executed procedurally when the program is running and may perform an action on data. code coverage: an analysis method that determines which parts of the software have been executed (covered) by the test suite and which parts have not been executed, e.g. statement coverage, decision coverage or condition coverage. From „Standard glossary of terms used in Software Testing” Copyright © 2013
  • 3. What is…? Statement coverage is the assessment of the percentage of executable statements that have been exercised by a test case suite. Statement testing derives test cases to execute specific statements, normally to increase statement coverage. From „Certified Tester Foundation Level Syllabus (version 2011)” Copyright © 2013
  • 4. Rules 100% branch coverage implies both 100% decision coverage and 100% statement coverage. From „Certified Tester Foundation Level Syllabus (version 2011)” Copyright © 2013
  • 5. Examples with sequential code a = b + c d = e * e In order to cover all statements, you need 1 test case. Copyright © 2013
  • 6. Examples with IF IF (wa) { ev = ghd - pkq / cds; In order to cover all } statements, you need 1 test case. Copyright © 2013
  • 7. Examples with IF ELSE IF (weu) { i = o - f; In order to cover all } statements, you need ELSE 2 test cases. { u = gkt * k; } Copyright © 2013
  • 8. Examples with SWITCH SWITCH (yc) { CASE 0: In order to cover all epl = o / c; statements, you need break; 4 test cases. CASE 1: p = wt * bd; break; CASE 2: fbt = xg + ana - cs; break; DEFAULT: qxn = q / ti; break; } Copyright © 2013
  • 9. Examples with WHILE a = 1; WHILE (a < 5) { In order to cover all b = c; statements, you need a++; 1 test case. } Copyright © 2013
  • 10. Examples with DO WHILE DO{ a = a + 1 } WHILE (a <= 0) In order to cover all statements, you need 1 test case. Copyright © 2013
  • 11. Examples with FOR FOR (a = 5; a > -5; a--) { b = c + 1; In order to cover all } statements, you need 1 test case. Copyright © 2013
  • 12. More examples IF (a) { b = c + d; In order to cover all } statements, you need ELSE 2 test cases. { IF (e) { b = c - d; } } Copyright © 2013
  • 13. More examples IF (a) { IF (f) In order to cover all { statements, you need g = h - i; 2 test cases. } } ELSE { IF (e) { b = c - d; } } Copyright © 2013
  • 14. More examples SWITCH (a) { CASE 0: IF (b) In order to cover all { statements, you need c; 3 test cases. } break; CASE 1: IF (d) { e; } ELSE { f; } break; } Copyright © 2012
  • 15. More examples with… TestCompetence allows you to generate sample pseudocode to pracitse whitebox techniques including statement coverage… Copyright © 2013
  • 16. More examples with… TestCompetence allows you to generate sample pseudocode to pracitse whitebox techniques including statement coverage… Choose the maximum number of Choose the instructions level of per level. nested statements. Choose the type of Choose the coverage type of from: statement. statement, decision, codition, multiple condition, GENERATE and modified your exercise. condition. Copyright © 2013
  • 17. More examples with… You get pseudocode and sample answers just like during a regular ISTQB exam. Choose the right answer. Pseudocode Choose an answer. Copyright © 2013
  • 18. More examples with… You get pseudocode and sample answers just like during a regular ISTQB exam. Choose the right answer. Pseudocode Your answer Right answer Copyright © 2013
  • 19. How to get it… Visit TestCompetence.com and get one for only… EURO / USD Unlimited number of exercises during 24 hours! Copyright © 2013
  • 20. Check also examples for… • Decision testing and coverage >> • Condition testing and coverage >> • Multiple condition testing and coverage >> • Modified condition decision combination (MC/CD) coverage >> Copyright © 2013