SlideShare a Scribd company logo
1 of 18
Basis Path Testing &
Unit Testing
SHEKH RASEL MASRUR AHMMAD (161-35-1423)
RAIHAN MAHMUD (161-35-1542)
PRASHANTA SARKER (161-35-1539)
ZAKARIA KHAN (161-35-1532)
Program-1
Step-2
Cyclomatic complexity(C.C):
i) Number of Regions = 5.
ii) Pridicate Node + 1 = 4+1 = 5.
iii) Edge – Node + 2 = 21-18+2 = 3+2 = 5.
Step-1
Step-4
Test case:
Step-3
Independent path:
Path – 1: 1 – 2 – 18
Path – 2: 1 – 2 – 3 – 18
Path – 3: 1 – 2 – 3 – 4 – 18
Path – 4: 1 – 2 – 3 – 4 – 5 – 6 – 10 – 11 – 12
Path – 5: 1 – 2 – 3 – 4 – 5 – 7 – 8 – 10 – 11 – 13 – 14
Path – 6: 1 – 2 – 3 – 4 – 5 – 7 – 9 – 10 – 11 – 13 – 15 – 16
Path – 7: 1 – 2 – 3 – 4 – 5 – 7 – 9 – 10 – 11 – 13 – 15 – 17
Path Input Expected Result
1 5 , 4 , 31 Sorry, Try Again!
2 5 , 15 , 2 Sorry, Try Again!
3 5 , 2 , 1 Sorry, Try Again!
4 8 , 8 , 8 It is Equilateral Triangle! Reason:
It’s all sides are equal!
5 9 , 9 , 8 It is Isosceles Triangle! Reason:
It’s two sides are equal!
6 2 , 3 , 4 It is Scalene Triangle! Reason: It’s
all sides have different length!
7 No input available
Unit testing:
Program-2
Step-1 Step-2
Cyclomatic complexity(C.C):
i) Number of Regions = 2.
ii) Pridicate Node + 1 = 1+1 = 2.
iii) Edge – Node + 2 = 4-4+2 = 2.
Step-3
Independent path:
Path-1: 1-2-4
Path-2: 1-2-3-4
Step-4
Test case:
Path Input Expected Result
1 array.Length = 0 0
2 array.Length = 2;
array[i] = 1, 2
3
Step-1
Step-2
Cyclomatic complexity(C.C):
i) Number of Regions = 3.
ii) Pridicate Node + 1 = 2+1 = 3.
iii) Edge – Node + 2 = 6-5+2 = 3.
Step-3
Independent path:
Path-1: 1-2-5
Path-2: 1-2-3-2-5
Path-3: 1-2-3-4-2-5
Step-4
Test case:
Path Input Expected Result
1 array.Length = 0 0
2 array.Length = 1;
array [i] = 0
0
3 array.Length = 2;
array [i] = 2,5
5
Unit testing:
Program-3
Step-1
Step-2
Cyclomatic complexity(C.C):
i) Number of Regions = 5.
ii) Pridicate Node + 1 = 4+1 = 5.
iii) Edge – Node + 2 = 13-10+2 = 3+2 = 5.
Step-3
Independent path:
Path-1: 1-2-4-10
Path-2: 1-2-4-5-10
Path-3: 1-2-3-2-4-5-6-7-9-4-10
Path-4: 1-2-3-2-4-5-6-8-9-4-10
Step-4
Test case:
Path Input Expected Result
1 array.Length = 0 No output
2 No input available
3 array.Length = 2;
array[j] = 2, 4
even, even
sum = 6
ave = 2
4 array.Length = 2;
array[j] = 3, 1
odd, odd
sum = 0
Unit testing:
1st Step:
File >> Add >> New project >> select - Unit Test Project
2nd Step:
Solution Explorer >> select – Unit Test >> click right button >> Add >> Reference
Browse your test project file then >> bin >> Debug >> select 2 item then click “Add” button >> OK
3rd Step:
In UnitTest project declar “unsing” + your project namespace then create your program class object in Unit test class and
declar your method in “Test method” then
Test >> Run >> All Tests.
Program-4
Step-1
Step-2
Cyclomatic complexity(C.C):
i) Number of Regions = 2.
ii) Pridicate Node + 1 = 1+1 = 2.
iii) Edge – Node + 2 = 4-4+2 = 2.
Step-3
Independent path:
Path-1: 1-2-4
Path-2: 1-2-3-2-4
Step-4
Test case:
Path Input Expected Result
1 No input available
2 5 120
Unit testing:
Program-5
Step-1 Step-2
Cyclomatic complexity(C.C):
i) Number of Regions = 3.
ii) Pridicate Node + 1 = 2+1 = 3.
iii) Edge – Node + 2 = 7-6+2 = 3.
Step-3
Independent path:
Path-1: 1-2-4-6
Path-2: 1-2-3-2-4-6
Path-3: 1-2-3-2-4-5-6
Step-4
Test case:
Path Input Expected Result
1 a1.Lehgth = 0;
a2.Lehgth = 0
0
2 a1.Lehgth = 2;
a1.[x] = 2, 1
a2.Lehgth = 0;
3
3 a1.Lehgth = 2;
a1.[x] = 2, 1
a2.Lehgth = 2;
a2.[x] = 4, 5
12
Unit testing:
Basis Path Testing & Unit Testing Methods

More Related Content

Similar to Basis Path Testing & Unit Testing Methods

White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhPankaj Thakur
 
K means clustering
K means clusteringK means clustering
K means clusteringAhmedasbasb
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)ShudipPal
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)ShudipPal
 
Software Engineering : Software testing
Software Engineering : Software testingSoftware Engineering : Software testing
Software Engineering : Software testingAjit Nayak
 
Seii unit6 software-testing-techniques
Seii unit6 software-testing-techniquesSeii unit6 software-testing-techniques
Seii unit6 software-testing-techniquesAhmad sohail Kakar
 
Software Quality Testing
Software Quality TestingSoftware Quality Testing
Software Quality TestingKiran Kumar
 
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test GenerationSung Kim
 
Basis path testing
Basis path testingBasis path testing
Basis path testingHoa Le
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Mr. Jhon
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniquesFincy V.J
 
MLSD18. Unsupervised Learning
MLSD18. Unsupervised LearningMLSD18. Unsupervised Learning
MLSD18. Unsupervised LearningBigML, Inc
 
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdfKrishnaKumar2309
 
Basis path testing
Basis path testingBasis path testing
Basis path testingHoa Le
 
Computer science project
Computer science projectComputer science project
Computer science projectSandeep Yadav
 

Similar to Basis Path Testing & Unit Testing Methods (20)

White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR Chandigarh
 
Path Testing
Path TestingPath Testing
Path Testing
 
K means clustering
K means clusteringK means clustering
K means clustering
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Software Engineering : Software testing
Software Engineering : Software testingSoftware Engineering : Software testing
Software Engineering : Software testing
 
Seii unit6 software-testing-techniques
Seii unit6 software-testing-techniquesSeii unit6 software-testing-techniques
Seii unit6 software-testing-techniques
 
Software Quality Testing
Software Quality TestingSoftware Quality Testing
Software Quality Testing
 
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
 
Quiz 9 cp_sol
Quiz 9 cp_solQuiz 9 cp_sol
Quiz 9 cp_sol
 
Basis path testing
Basis path testingBasis path testing
Basis path testing
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
 
MLSD18. Unsupervised Learning
MLSD18. Unsupervised LearningMLSD18. Unsupervised Learning
MLSD18. Unsupervised Learning
 
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
 
Basis path testing
Basis path testingBasis path testing
Basis path testing
 
EE gate-2016-set-1
EE gate-2016-set-1EE gate-2016-set-1
EE gate-2016-set-1
 
Sbst2018 contest2018
Sbst2018 contest2018Sbst2018 contest2018
Sbst2018 contest2018
 
Computer science project
Computer science projectComputer science project
Computer science project
 
Unsupervised learning networks
Unsupervised learning networksUnsupervised learning networks
Unsupervised learning networks
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 

Basis Path Testing & Unit Testing Methods

  • 1. Basis Path Testing & Unit Testing SHEKH RASEL MASRUR AHMMAD (161-35-1423) RAIHAN MAHMUD (161-35-1542) PRASHANTA SARKER (161-35-1539) ZAKARIA KHAN (161-35-1532)
  • 2. Program-1 Step-2 Cyclomatic complexity(C.C): i) Number of Regions = 5. ii) Pridicate Node + 1 = 4+1 = 5. iii) Edge – Node + 2 = 21-18+2 = 3+2 = 5. Step-1
  • 3. Step-4 Test case: Step-3 Independent path: Path – 1: 1 – 2 – 18 Path – 2: 1 – 2 – 3 – 18 Path – 3: 1 – 2 – 3 – 4 – 18 Path – 4: 1 – 2 – 3 – 4 – 5 – 6 – 10 – 11 – 12 Path – 5: 1 – 2 – 3 – 4 – 5 – 7 – 8 – 10 – 11 – 13 – 14 Path – 6: 1 – 2 – 3 – 4 – 5 – 7 – 9 – 10 – 11 – 13 – 15 – 16 Path – 7: 1 – 2 – 3 – 4 – 5 – 7 – 9 – 10 – 11 – 13 – 15 – 17 Path Input Expected Result 1 5 , 4 , 31 Sorry, Try Again! 2 5 , 15 , 2 Sorry, Try Again! 3 5 , 2 , 1 Sorry, Try Again! 4 8 , 8 , 8 It is Equilateral Triangle! Reason: It’s all sides are equal! 5 9 , 9 , 8 It is Isosceles Triangle! Reason: It’s two sides are equal! 6 2 , 3 , 4 It is Scalene Triangle! Reason: It’s all sides have different length! 7 No input available
  • 5. Program-2 Step-1 Step-2 Cyclomatic complexity(C.C): i) Number of Regions = 2. ii) Pridicate Node + 1 = 1+1 = 2. iii) Edge – Node + 2 = 4-4+2 = 2.
  • 6. Step-3 Independent path: Path-1: 1-2-4 Path-2: 1-2-3-4 Step-4 Test case: Path Input Expected Result 1 array.Length = 0 0 2 array.Length = 2; array[i] = 1, 2 3
  • 7. Step-1 Step-2 Cyclomatic complexity(C.C): i) Number of Regions = 3. ii) Pridicate Node + 1 = 2+1 = 3. iii) Edge – Node + 2 = 6-5+2 = 3. Step-3 Independent path: Path-1: 1-2-5 Path-2: 1-2-3-2-5 Path-3: 1-2-3-4-2-5
  • 8. Step-4 Test case: Path Input Expected Result 1 array.Length = 0 0 2 array.Length = 1; array [i] = 0 0 3 array.Length = 2; array [i] = 2,5 5 Unit testing:
  • 10. Step-2 Cyclomatic complexity(C.C): i) Number of Regions = 5. ii) Pridicate Node + 1 = 4+1 = 5. iii) Edge – Node + 2 = 13-10+2 = 3+2 = 5. Step-3 Independent path: Path-1: 1-2-4-10 Path-2: 1-2-4-5-10 Path-3: 1-2-3-2-4-5-6-7-9-4-10 Path-4: 1-2-3-2-4-5-6-8-9-4-10 Step-4 Test case: Path Input Expected Result 1 array.Length = 0 No output 2 No input available 3 array.Length = 2; array[j] = 2, 4 even, even sum = 6 ave = 2 4 array.Length = 2; array[j] = 3, 1 odd, odd sum = 0
  • 11. Unit testing: 1st Step: File >> Add >> New project >> select - Unit Test Project
  • 12. 2nd Step: Solution Explorer >> select – Unit Test >> click right button >> Add >> Reference Browse your test project file then >> bin >> Debug >> select 2 item then click “Add” button >> OK
  • 13. 3rd Step: In UnitTest project declar “unsing” + your project namespace then create your program class object in Unit test class and declar your method in “Test method” then Test >> Run >> All Tests.
  • 14. Program-4 Step-1 Step-2 Cyclomatic complexity(C.C): i) Number of Regions = 2. ii) Pridicate Node + 1 = 1+1 = 2. iii) Edge – Node + 2 = 4-4+2 = 2. Step-3 Independent path: Path-1: 1-2-4 Path-2: 1-2-3-2-4 Step-4 Test case: Path Input Expected Result 1 No input available 2 5 120
  • 16. Program-5 Step-1 Step-2 Cyclomatic complexity(C.C): i) Number of Regions = 3. ii) Pridicate Node + 1 = 2+1 = 3. iii) Edge – Node + 2 = 7-6+2 = 3. Step-3 Independent path: Path-1: 1-2-4-6 Path-2: 1-2-3-2-4-6 Path-3: 1-2-3-2-4-5-6 Step-4 Test case: Path Input Expected Result 1 a1.Lehgth = 0; a2.Lehgth = 0 0 2 a1.Lehgth = 2; a1.[x] = 2, 1 a2.Lehgth = 0; 3 3 a1.Lehgth = 2; a1.[x] = 2, 1 a2.Lehgth = 2; a2.[x] = 4, 5 12