EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • Featured Skills
    • New & Trending
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Log in
  • Sign Up
Home Software Development Software Development Tutorials Software Testing Tutorial Decision Coverage
 

Decision Coverage

Priya Pedamkar
Article byPriya Pedamkar

Updated April 4, 2023

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.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

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.

  • 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

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

Primary Sidebar

Footer

Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

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

EDUCBA

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

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA

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

Web development, programming languages, Software testing & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

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

EDUCBA Login

Forgot Password?

🚀 Limited Time Offer! - ENROLL NOW