EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

Decision Coverage

By Priya PedamkarPriya Pedamkar

Home » Software Development » Software Development Tutorials » Software Testing Tutorial » Decision Coverage

Decision Coverage

Introduction to Decision Coverage

Decision coverage is a frequently used code testing method which is used to validate the exposure of the limitations of various decision trees in the program. The decision trees are typically derived from the conditional statements, the looping statements and the Boolean expressions or values in the program. The testing process in this case is carried out by validating all the possible execution flow through the said conditions and looping statements. Hence the name ‘Decision Coverage’ testing was given to this process. In other words, the Decision Coverage testing is a requisite for certifying the modular code to have included the potential functional endpoints.

How Decision Coverage Testing is Performed?

The Decision Coverage Testing is expected to be implemented on every single one line of the program, and identify the possible decision making stream in the codes. This track of code testing is known to be an important step in the application development and program building process. Skipping this step can create a big hole in the efficiency of the program in the respective module. Any failure or defect identified in the Decision Coverage testing will have a big impact on the application’s performance.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

  • The first step in the decision coverage testing is to scan the end to end operation of the program, and to locate the decision indicators throughout the code. The decisions here are nothing but the code that gives more than one outcome, that can have two or more possible path for the execution flow to pass through, and that can produce one or more products at the end of the code execution process.
  • The proceeding steps involve the process of assembling a logical decision making flowchart and to list the results or outcomes of the various decisions instilled in the application’s code. It can most likely have more than one conclusion, as one consistent code execution flow doesn’t need to involve any logical decision to be made.
  • The last and final step in the Decision Coverage testing process is to evaluate logical decision indications gathered and designed in the previous steps of this testing process. The end points in the various logics are subjected to the necessary validation and verification methods. The testing process is said to be passed if the acquired end result matches with the planned result, which should be directly proportional to the data given by the client in the form of functional specification documentation.

How to Calculate Decision Coverage?

The purpose of implementing the Decision Coverage Testing on the application program code is to validate the every possible logical and functional flow, and to ensure the program is impeccable. Also, this process is used to confirm the operations performed in the program are going as it is supposed to be functioning. The below formula gives a numerical value for the Decision Coverage evaluation,

Decision Coverage % = ((Number of decision products implemented) / (Total number of decision products) * 100) %,

where the total number of decisions will be the count of the logical decisions identified in the program and the number of decisions implemented out of them will give the Decision Coverage percentage value.

Examples to Implement of Decision Coverage

Below are the examples of Decision Coverage:

Example #1

The below sample code shows that the ‘if’ condition is giving out more than one decision

Popular Course in this category
Sale
All in One Software Development Bundle (600+ Courses, 50+ projects)600+ Online Courses | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (3,144 ratings)
Course Price

View Course

Related Courses
Software Testing Training (9 Courses, 2 Projects)Penetration Testing Training Program (2 Courses)TestNG Training (4 Courses, 2 Project)

Code:

Read X
Read ‘Answer1’
IF X = ‘Answer1’ THEN
Print "X is the correct Answer"
ENDIF
If X != ‘Answer1’ THEN
Print "Your Answer is wrong"
ENDIF

The above code shows that an automated question -answer simulator can validate the answers provided by the person undergoing the evaluation process. It has the variable X assigned to each answer given by the candidate. It is then validated by matching the answers against the answer key pre-loaded in the system. If the match is faultless, then the message ‘<answer> is the correct answer’ will be displayed. If the results are unmatched, then the message ‘Your answer is wrong’ will be displayed. Hence this code consists of two possible logical decisions, and testing the scope of this code can be called as the Decision Coverage Testing.

Example #2

The below sample code shows that the flowchart for validating the age of the patient, and determining if the person is a senior citizen or not,

Decision Coverage

In this example (fig. 01), the variable X is assigned to the age of the patient. The decision box here is used to evaluate if the age is greater than or equal to the number ‘60’. If the age is less than provided value, that is 60, then the patient is not labelled as a senior citizen. And, if the condition is met and found to be true, then the patient can be marked as a senior citizen. The process of performing this evaluation in terms of the modular functionality, without any leakage, can be defined as the practice of the Decision Coverage validation.

Advantages & Disadvantages of Decision Coverage

Below are the advantages and disadvantages of the Decision Coverage operation:

Advantages:

  1. It is a process of evaluating the complete code and the performance of the logical units in the program by testing if the operations are meeting the requirements stated by the client, customer, or business professionals.
  2. This code coverage testing method is used as abet to maintain the quality of the program and the logical decisions employed on it.
  3. It plays a role as a supporting agent for keeping in check that there are no unfinished or obsolete pieces of code or functionalities left unnoticed in the application.

Disadvantages:

  1. This method is pertinent to hold the test execution timelines, as it needs special attention apart from the regular unit testing and code coverage testing, and it takes additions efforts from the development team along with the testing professionals’ assistance.
  2. This method is not proficient amongst the software professionals, as it does not get approval from the management many times.

Conclusion

Decision Coverage Evaluation acts as a crucial test coverage method as this code coverage method is one step above other coverage testing methods. It gives a better perception of the operations hidden under the program against the functionality that is expected by the client. As it can include the Boolean operations, it is most often chosen over the Branch coverage process.

Recommended Articles

This is a guide to Decision Coverage. Here we discuss the Introduction and how to Calculate Decision Coverage along with advantages and disadvantages. You can also go through our suggested articles to learn more –

  1. Programmers vs Software Engineering
  2. Software Design Principles
  3. Statement Coverage
  4. Branch Coverage

All in One Software Development Bundle (600+ Courses, 50+ projects)

600+ Online Courses

3000+ Hours

Verifiable Certificates

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Primary Sidebar
Software Testing Tutorial
  • Advance
    • Cyclomatic Complexity
    • Decision Table Testing
    • Decision Tree Algorithm
    • What is Continuous Integration
    • Mantis Bug Tracker
    • Equivalence Partitioning
    • Gantt Chart Software
    • Acceptance Testing Types
    • Load testing tools
    • Install TestNG
    • Install Unity
    • Defect Management Process
    • Test Plan Template
    • Testing Interview Questions
    • Testing of Mobile application
    • What is Test Automation Frameworks
    • Test Automation Framework
    • Application of Automation
    • Test Automation Process
    • Automation Testing Roles and Responsibilities
    • What is Instruction Cycle?
    • What is Cucumber?
    • 15 Best Popular Bug Reporting Tools
    • What is Automated Testing?
    • Software Maintenance Types
    • Types of Penetration Testing
    • Software Reliability
    • Best Gantt Chart Software
    • Code Coverage
    • Branch Coverage
    • Decision Coverage
    • Statement Coverage
    • What is Test Case
    • Types of Test Case
    • What is Test Scenario
    • Formal Review
    • Alpha Beta Pruning
    • What is Cyclomatic Complexity?
    • Test Coverage
    • How to Write Test Case
    • Testing Documentation
    • Performance Testing Life Cycle
    • What is Xpath
    • Test Harness
    • Test Strategy
    • Software Incident Management
    • What is Debugging
    • What is Defect?
    • Listeners in TestNG
  • Basics
    • What is Software Testing
    • Careers in Software Testing
    • Defect Life Cycle in Software Testing
    • Levels of Software Testing
    • Software Testing Life Cycle
    • Software Tester Work
    • Software Testing Principles
    • Software Testing Services
    • Testing Methodologies
    • Test Approaches
    • Grey Box Testing
    • Types of Software Testing
    • What is a Bug in Software Testing
    • Benefits of Automation Testing
    • What is Automation Testing?
    • Types of Automation
    • Automation Testing Process
    • Mobile Automation Testing
    • Automation Testing Life Cycle
    • Software Quality Assurance
    • Software Quality Assurance
    • What is Test Environment?
    • Verification and Validation Testing
  • Types of Testing
    • Adhoc Testing
    • Types of System Testing
    • Manual Testing Types
    • Unit Testing Types
    • Unit Testing Benefits
    • Agile Testing
    • What is Agile Testing
    • Acceptance Testing
    • Stress Testing Types
    • Alpha and Beta Testing
    • Application Testing
    • Automation Testing
    • Automation Testing Advantages
    • Benchmark Testing
    • Black Box Testing
    • Domain Testing
    • Dynamic Testing
    • Ecommerce Testing
    • Fuzz Testing
    • Gray Box Testing
    • GUI Testing
    • Installation Testing
    • Interface Testing
    • Interoperability Testing
    • Mainframe Testing
    • Manual Testing
    • Mutation Testing
    • Monkey Testing
    • Negative Testing
    • Penetration Testing
    • Penetration testing phases
    • Penetration testing framework
    • Protocol Testing
    • Recovery Testing
    • Regression Testing
    • Mobile Penetration Testing
    • Accessibility Testing
    • Sanity Testing
    • Scalability Testing
    • Security Testing
    • Spike Testing
    • Stability Testing
    • State Transition Testing
    • Static Testing
    • Gatling Load Testing
    • System Integration Testing
    • Structural Testing
    • Locust Load Testing
    • System Testing
    • Control Flow Testing
    • Unit Testing
    • Cypress testing
    • Volume Testing
    • Web Testing Application
    • What is Exploratory Testing
    • What is Stress Testing
    • What is Usability Testing
    • White Box Testing
    • Types of White Box Testing
    • Compatibility Testing?
    • Use Case Testing
    • Beta Testing
    • Integration Testing
    • Non Functional Testing
    • Non Functional Testing Types
    • What is Functional Testing
    • Functional testing types
    • Cookie Testing
    • Alpha Testing
    • Boundary Value Testing
    • Equivalence Class Testing
    • Glass Box Testing
    • SOA Testing
    • Smoke Testing
    • Visual Testing
    • Visual Paradigm
    • Model-Based Testing
  • Testing techniques
    • Software Testing Methodologies
    • Black Box Testing Techniques
    • Static Testing Techniques
    • Test Case Design Techniques
    • What is Static Analysis
  • Testing tools
    • Manual Testing Tools
    • Visual Testing Tools
    • Automation Testing Tools
    • Functional Testing Tools
    • GUI Testing Tools
    • Penetration Testing Tools
    • Performance Testing Tools
    • SOA Testing Tools
    • Accessibility Testing Tools
    • What is QTP
    • Regression Testing Tools
    • Security Testing Tools
    • Test Management Tools
    • Defect Management Tools
    • Code Coverage Tools
    • Test Coverage Tools
    • Defect Tracking Tools
    • Continuous Integration Tools
    • Install Bugzilla
    • Test data generation tool
    • Unit Testing Tools
    • Web Testing Tools
    • Stress Testing Tools
    • Performance Monitoring Tools
    • Mobile Testing Tools
    • Responsive Testing Tool
    • Cross Browser Testing Tools
    • Risk Based Testing
    • Database Testing Tools
    • WinRunner
    • What is Squish?
    • CubicTest
    • What is WinRM?
    • Bugzilla Tool
    • Code review tools
    • Penetration Testing Open Source Tools
  • Inteview Questions
    • Automation Testing Interview Questions
    • Manual Testing Interview Questions
    • ISTQB Interview Questions
    • Cucumber Interview Questions
    • Software Testing Interview Questions
    • Penetration Testing Interview Questions

Related Courses

Software Testing Course

Penetration Training Course

TestNG Training Course

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Special Offer - All in One Software Development Bundle (600+ Courses, 50+ projects) Learn More