SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testing
ikhwanhayat
 
Unit 2 - Test Case Design
Unit 2 - Test Case DesignUnit 2 - Test Case Design
Unit 2 - Test Case Design
Selvi Vts
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
suhasreddy1
 
Condition Determination Testing and Coverage. ISTQB White-box Techniques with...
Condition Determination Testing and Coverage. ISTQB White-box Techniques with...Condition Determination Testing and Coverage. ISTQB White-box Techniques with...
Condition Determination Testing and Coverage. ISTQB White-box Techniques with...
Radoslaw Smilgin
 
C++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing FrameworkC++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing Framework
Humberto Marchezi
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
Adam Stephensen
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
Confiz
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques
Ashutosh Garg
 
Testing techniques
Testing techniquesTesting techniques
Testing techniques
RaginiRohatgi
 
ISTQB / ISEB Foundation Exam Practice - 4
ISTQB / ISEB Foundation Exam Practice - 4ISTQB / ISEB Foundation Exam Practice - 4
ISTQB / ISEB Foundation Exam Practice - 4
Yogindernath Gupta
 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
Pina Parmar
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
Pragya Rastogi
 
Unit testing
Unit testing Unit testing
Unit testing
Mani Kanth
 
Test organization
Test organizationTest organization
Test organization
Vaibhav Dash
 
Testing
TestingTesting
Testing
Sonali Chauhan
 
Testing methodology
Testing methodologyTesting methodology
Testing methodology
Dina Hanbazazah
 
ISTQB Foundation Level Basic
ISTQB Foundation Level BasicISTQB Foundation Level Basic
ISTQB Foundation Level Basic
Erol Selitektay
 
Non-Functional testing
Non-Functional testingNon-Functional testing
Non-Functional testing
Kanoah
 
Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
Mohamed Zeinelabdeen Abdelgader Farh jber
 
2nd MODULE Software Requirements _ SW ENGG 22CSE141.pdf
2nd MODULE  Software Requirements   _ SW ENGG  22CSE141.pdf2nd MODULE  Software Requirements   _ SW ENGG  22CSE141.pdf
2nd MODULE Software Requirements _ SW ENGG 22CSE141.pdf
Jayanthi Kannan MK
 
Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testing
ikhwanhayat
 
Unit 2 - Test Case Design
Unit 2 - Test Case DesignUnit 2 - Test Case Design
Unit 2 - Test Case Design
Selvi Vts
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
suhasreddy1
 
Condition Determination Testing and Coverage. ISTQB White-box Techniques with...
Condition Determination Testing and Coverage. ISTQB White-box Techniques with...Condition Determination Testing and Coverage. ISTQB White-box Techniques with...
Condition Determination Testing and Coverage. ISTQB White-box Techniques with...
Radoslaw Smilgin
 
C++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing FrameworkC++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing Framework
Humberto Marchezi
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
Adam Stephensen
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
Confiz
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques
Ashutosh Garg
 
ISTQB / ISEB Foundation Exam Practice - 4
ISTQB / ISEB Foundation Exam Practice - 4ISTQB / ISEB Foundation Exam Practice - 4
ISTQB / ISEB Foundation Exam Practice - 4
Yogindernath Gupta
 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
Pina Parmar
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
Pragya Rastogi
 
ISTQB Foundation Level Basic
ISTQB Foundation Level BasicISTQB Foundation Level Basic
ISTQB Foundation Level Basic
Erol Selitektay
 
Non-Functional testing
Non-Functional testingNon-Functional testing
Non-Functional testing
Kanoah
 
2nd MODULE Software Requirements _ SW ENGG 22CSE141.pdf
2nd MODULE  Software Requirements   _ SW ENGG  22CSE141.pdf2nd MODULE  Software Requirements   _ SW ENGG  22CSE141.pdf
2nd MODULE Software Requirements _ SW ENGG 22CSE141.pdf
Jayanthi Kannan MK
 

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

Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrols
teach4uin
 
Programming in C Session 1
Programming in C Session 1Programming in C Session 1
Programming in C Session 1
Prerna Sharma
 
Evolving The Java Language
Evolving The Java LanguageEvolving The Java Language
Evolving The Java Language
QConLondon2008
 
Building high productivity applications
Building high productivity applicationsBuilding high productivity applications
Building high productivity applications
Hutomo Sugianto
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
bhushan Nehete
 
QTP VB Script Trainings
QTP VB Script TrainingsQTP VB Script Trainings
QTP VB Script Trainings
Ali Imran
 
Na50 enus devi_14
Na50 enus devi_14Na50 enus devi_14
Na50 enus devi_14
thurmond
 
Java basics and java variables
Java basics and java variablesJava basics and java variables
Java basics and java variables
Pushpendra Tyagi
 
lecture 6 bca 1 year-1.pptx
lecture 6 bca 1 year-1.pptxlecture 6 bca 1 year-1.pptx
lecture 6 bca 1 year-1.pptx
classall
 
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
Introduction to computer programming (C)-CSC1205_Lec5_Flow controlIntroduction to computer programming (C)-CSC1205_Lec5_Flow control
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
ENGWAU TONNY
 
Repair dagstuhl jan2017
Repair dagstuhl jan2017Repair dagstuhl jan2017
Repair dagstuhl jan2017
Abhik Roychoudhury
 
Clean code
Clean codeClean code
Clean code
Khou Suylong
 
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Effective and pragmatic test driven development by Andrew Rendell, Principal ...Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Valtech UK
 
Journey's diary developing a framework using tdd
Journey's diary   developing a framework using tddJourney's diary   developing a framework using tdd
Journey's diary developing a framework using tdd
eduardomg23
 
Chapter 4 flow control structures and arrays
Chapter 4 flow control structures and arraysChapter 4 flow control structures and arrays
Chapter 4 flow control structures and arrays
sshhzap
 
Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective   Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective
Engineering Software Lab
 
Code coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspectiveCode coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspective
Engineering Software Lab
 
Java căn bản - Chapter8
Java căn bản - Chapter8Java căn bản - Chapter8
Java căn bản - Chapter8
Vince Vo
 
Chapter 8 - Exceptions and Assertions Edit summary
Chapter 8 - Exceptions and Assertions  Edit summaryChapter 8 - Exceptions and Assertions  Edit summary
Chapter 8 - Exceptions and Assertions Edit summary
Eduardo Bergavera
 
Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJ
TANUJ ⠀
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrols
teach4uin
 
Programming in C Session 1
Programming in C Session 1Programming in C Session 1
Programming in C Session 1
Prerna Sharma
 
Evolving The Java Language
Evolving The Java LanguageEvolving The Java Language
Evolving The Java Language
QConLondon2008
 
Building high productivity applications
Building high productivity applicationsBuilding high productivity applications
Building high productivity applications
Hutomo Sugianto
 
QTP VB Script Trainings
QTP VB Script TrainingsQTP VB Script Trainings
QTP VB Script Trainings
Ali Imran
 
Na50 enus devi_14
Na50 enus devi_14Na50 enus devi_14
Na50 enus devi_14
thurmond
 
Java basics and java variables
Java basics and java variablesJava basics and java variables
Java basics and java variables
Pushpendra Tyagi
 
lecture 6 bca 1 year-1.pptx
lecture 6 bca 1 year-1.pptxlecture 6 bca 1 year-1.pptx
lecture 6 bca 1 year-1.pptx
classall
 
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
Introduction to computer programming (C)-CSC1205_Lec5_Flow controlIntroduction to computer programming (C)-CSC1205_Lec5_Flow control
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
ENGWAU TONNY
 
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Effective and pragmatic test driven development by Andrew Rendell, Principal ...Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Valtech UK
 
Journey's diary developing a framework using tdd
Journey's diary   developing a framework using tddJourney's diary   developing a framework using tdd
Journey's diary developing a framework using tdd
eduardomg23
 
Chapter 4 flow control structures and arrays
Chapter 4 flow control structures and arraysChapter 4 flow control structures and arrays
Chapter 4 flow control structures and arrays
sshhzap
 
Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective   Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective
Engineering Software Lab
 
Code coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspectiveCode coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspective
Engineering Software Lab
 
Java căn bản - Chapter8
Java căn bản - Chapter8Java căn bản - Chapter8
Java căn bản - Chapter8
Vince Vo
 
Chapter 8 - Exceptions and Assertions Edit summary
Chapter 8 - Exceptions and Assertions  Edit summaryChapter 8 - Exceptions and Assertions  Edit summary
Chapter 8 - Exceptions and Assertions Edit summary
Eduardo Bergavera
 
Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJ
TANUJ ⠀
 
Ad

More from Radoslaw Smilgin (20)

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

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