SlideShare a Scribd company logo
C0 : statement coverage C1 : branch coverage C2 : condition coverage
All statements are tested
1 test case
All branches are tested
2 test cases
All condition combinations are tested
22 = 4 test cases
Test Coverage (C0/C1/C2)
Cond. A && Cond. B
Statement X
Cond. A && Cond. B
Statement X
Cond. A && Cond. B
Statement X
Cond. A Cond. B
TRUE TRUE
TRUE FALSE
FALSE TRUE
FALSE FALSE
Cond. A Cond. B
TRUE TRUE
TRUE FALSE
Cond. A Cond. B
TRUE TRUE
Cover area
TRUE
FALSE FALSE FALSE
TRUE TRUE
Test cases
Ad

More Related Content

What's hot (20)

Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
Lee Englestone
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
priya_trivedi
 
Developing Apps With React Native
Developing Apps With React NativeDeveloping Apps With React Native
Developing Apps With React Native
Alvaro Viebrantz
 
Junit
JunitJunit
Junit
FAROOK Samath
 
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
 
Junit 4.0
Junit 4.0Junit 4.0
Junit 4.0
pallavikhandekar212
 
Testing with Spring: An Introduction
Testing with Spring: An IntroductionTesting with Spring: An Introduction
Testing with Spring: An Introduction
Sam Brannen
 
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Edureka!
 
iOS Architecture
iOS ArchitectureiOS Architecture
iOS Architecture
Jacky Lian
 
Workshop unit test
Workshop   unit testWorkshop   unit test
Workshop unit test
Francesco Garavaglia
 
Introduction about Full stack Development
Introduction about Full stack DevelopmentIntroduction about Full stack Development
Introduction about Full stack Development
rajasekarandpm
 
Core java
Core javaCore java
Core java
Sun Technlogies
 
JAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web ServicesJAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web Services
Arun Gupta
 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
Animesh Kumar
 
C#.NET
C#.NETC#.NET
C#.NET
gurchet
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
Pravin Dsilva
 
clean code book summary - uncle bob - English version
clean code book summary - uncle bob - English versionclean code book summary - uncle bob - English version
clean code book summary - uncle bob - English version
saber tabatabaee
 
Enumeration in Java Explained | Java Tutorial | Edureka
Enumeration in Java Explained | Java Tutorial | EdurekaEnumeration in Java Explained | Java Tutorial | Edureka
Enumeration in Java Explained | Java Tutorial | Edureka
Edureka!
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
Nayanda Haberty
 
Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()
Umar Ali
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
Lee Englestone
 
Developing Apps With React Native
Developing Apps With React NativeDeveloping Apps With React Native
Developing Apps With React Native
Alvaro Viebrantz
 
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
 
Testing with Spring: An Introduction
Testing with Spring: An IntroductionTesting with Spring: An Introduction
Testing with Spring: An Introduction
Sam Brannen
 
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Edureka!
 
iOS Architecture
iOS ArchitectureiOS Architecture
iOS Architecture
Jacky Lian
 
Introduction about Full stack Development
Introduction about Full stack DevelopmentIntroduction about Full stack Development
Introduction about Full stack Development
rajasekarandpm
 
JAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web ServicesJAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web Services
Arun Gupta
 
clean code book summary - uncle bob - English version
clean code book summary - uncle bob - English versionclean code book summary - uncle bob - English version
clean code book summary - uncle bob - English version
saber tabatabaee
 
Enumeration in Java Explained | Java Tutorial | Edureka
Enumeration in Java Explained | Java Tutorial | EdurekaEnumeration in Java Explained | Java Tutorial | Edureka
Enumeration in Java Explained | Java Tutorial | Edureka
Edureka!
 
Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()
Umar Ali
 

Test Coverage

  • 1. C0 : statement coverage C1 : branch coverage C2 : condition coverage All statements are tested 1 test case All branches are tested 2 test cases All condition combinations are tested 22 = 4 test cases Test Coverage (C0/C1/C2) Cond. A && Cond. B Statement X Cond. A && Cond. B Statement X Cond. A && Cond. B Statement X Cond. A Cond. B TRUE TRUE TRUE FALSE FALSE TRUE FALSE FALSE Cond. A Cond. B TRUE TRUE TRUE FALSE Cond. A Cond. B TRUE TRUE Cover area TRUE FALSE FALSE FALSE TRUE TRUE Test cases