SlideShare ist ein Scribd-Unternehmen logo
1 von 27
SOFTWARE TESTING METHODOLGY
WITH THE CONTROL FLOW ANALYSIS
      WEN-CHANG PAI, CHI-MING
   CHUNG, CHING-TANG HSIEH, CHUN-
  CHIA WANG, AND YING-HONG WANG
PRESENTED BY:
REEMA QAISER KHAN
     MS(SE)-2
• This paper provides a method for analyzing the control-flow
  of a program.
• The authors define a number of command types and test
  data generating rules based on the control-flow of the
  program.
• An algorithm to scan program and analysis testing paths is
  provided.
• This will allow testers to recover the program’s
  design, understand the software structure, and assist
  software maintenance.
AN OVERVIEW OF PROGRAM TESTING
• In a program P, we say a statement block B = (s1, s2, …, sn)
   is a maximal subset of contiguous statements of P such that
   statement si is the unique successor of si-1 and si-1 is the
   unique predecessor of si, for all
  i = 1, 2, …, n.
• A program graph G = {nodes, edges} contains a set of nodes
   and edges
• A node without a predecessor is a start node.
• A node without a successor is an exit node.
• A complete path is a path whose initial node is the start
  node of G and whose final node is an exit node of G.
• A well known logic coverage criterion is decision coverage
  or branch coverage. Examples of branch or decision
  statements are IF statements, WHILE statements, and
  SWITCH statement.
• This criterion states that each branch direction must be
  traversed at least once.
• In software testing technologies, boundary testing (or
  boundary value analysis; BVA) is a good test case design. It
  selects test data at the boundary of the input domain.
• Experience shows that test data selected with BVA have a
  higher payoff than other data.
• More errors tend to occur at the boundaries of the input
  domain.
AUTOMATICALLY GENERATING TEST
              DATA
• The steps involved in the method are described in the
   following:
1) Choosing Adequacy Testing Criteria:
  The branch coverage criterion is adopted in this paper to
   generate test data for testing a program.
2) Defining Command Types:
   We define three typical statement types in a program:
   (1) sequential commands, (2)conditional commands, and
   (3) loop commands.
   Each command type essentially corresponding to a block or
   some blocks in a program. In this paper, we will generate
   test data for each of the command types to enter every
   branch of a program.
3) Scanning the Program and Generating Test Data:
  The test data are generated from the input domain, which is
   derived through boundary value analysis with the Branch
   coverage criterion.
4) Analyzing Test Paths and Testing :
  Finally, testers analyze the testing paths and test the
   program with the results obtained in step 3.
TEST DATA GENERATING RULES
• Type 1. Sequential Command Set :

• The Sequential commands, such as
  OPEN, READ, WRITE, and CLOSE statements, are usually
  written in the form
• ‘C1; C2’,
Rule 4.1 :
The set S1, S2, …, Sn is a contiguous sequence of
statements of a program P, such that a corresponding block
B exists in P. A node N also exists in the program graph G.
• Type 2. Conditional Command Set :

• A conditional command, such as an If-Then-End
  statement, If-Then-Else-End statement, Switch-Case-With-
  Default statement, or Switch-Case-Without-Default
  statement, has a number of subcommands, from which
  exactly one is chosen to be executed. Conditional
  commands typically have the form

• If CON1 then B1
  Else if CON2 then B2
  …
  else if CONn then Bn
  end if
Rule 4.2 :
Set S′ is a set of Switch statements of a program P, such
that a number of corresponding blocks B1, B2, …, Bk
exist in S′. A number of nodes S, N1, N2, …, Nk, and E
also exist in the program graph G.
• Type 3. Loop Command Set :
• Loop commands, such as For-loop statements, While-loop
  statements, and Repeat- loop statements, have a number
  of subcommands that are executed repeatedly until some
  conditions are true. Loop commands typically have the
  form

 While CON do
     B
  End while
    OR

   Repeat
     B
  Until CON
Rule 4.3 :
Set S′ is a Loop statement s of a program P, such that a
corresponding block B exists in P. A number of nodes, S, N,
and E, also exist in the program graph G.
TEST PATH ANALYSIS ALGORITHM
• The algorithm analyzes the path to search for the command
  types and the apply rules 4.1 to 4.3 accordingly.
• We can transform each statement of a program to its
  corresponding flow. The paths are analyzed and test data
  are generated after the program has been completely
  scanned.
•   Algorithm PATH_ANALYSIS
•   begin
•   get PROGRAM
•   set START_NODE
•   set NEW_NODE
•   move POINTER to NEW_NODE
•   while not END_OF_PROGRAM
•   read next INSTRUCTION
•   search INSTRUCTION_TABLE
•   switch (INSTRUCTION)
•   case “Switch Statement Set”
•   set NEW_NODE (or NODES) /* according to the rule 4.2 */
•   move POINTER to NEW_NODE /* according to the rule 4.2 */
•   case “Loop Statement Set”
•   set NEW_NODE (or NODES) /* according to the rule 4.3 */
•   move POINTER to NEW_NODE /* according to the rule 4.3 */
•   case “Sequence Statement Set” /* according to the rule 4.1 */
•   skip
•   end {switch}
•   end {while}
•   set END_NODE
•   end {PATH_ANALYSIS}
AN EXAMPLE
TEST CASES USING BOUNDARY VALUE
              ANALYSIS
• We have three loop commands, and one conditional
   command.
• Test Cases for the first Loop Command
  (WHILE LOP=“F”) using boundary value analysis:
1- Test Case with test data of character F, to check input
   domain LOP=“F”.
2- Test Case with test data can be any character except F, to
   check input domain LOP<>“F” e.g. LOP=“A”,LOP=“B”, etc.
• Test Cases for the Second Loop Command
  (WHILE ANS<> “Y” and ANS<> “y”) using boundary value
   analysis:
1- Test Case with test data can be any character except “Y” or
   “y”, to check input domain ANS<> “Y” and ANS<> “y”, e.g.
   ANS=“A” or ANS=“a”, ANS=“B”or ANS=“b”, etc.
2- Test Case with test data “Y” and “y” , to check input domain
   ANS=“Y” or ANS=“y”.
• Test Cases for the Third Loop Command
  (WHILE ANS<> “Y” and ANS<> “y”) using boundary value
   analysis:
1- Test Case with test data can be any character except “Y” or
   “y”, to check input domain ANS<> “Y” and ANS<> “y”, e.g.
   ANS=“A” or ANS=“a”, ANS=“B”or ANS=“b”, etc.
2- Test Case with test data “Y” and “y” , to check input domain
   ANS=“Y” or ANS=“y”.
• Test Cases for the First Conditional Command
  (IF ANS<> “Y” and ANS<> “y”) using boundary value
   analysis:
1- Test Case with test data can be any character except “Y” or
   “y”, to check input domain ANS<> “Y” and ANS<> “y”, e.g.
   ANS=“A” or ANS=“a”, ANS=“B”or ANS=“b”, etc.
2- Test Case with test data “Y” and “y” , to check input domain
   ANS=“Y” or ANS=“y”.
•   From Table 1, we have the following testing paths:
•   <S, 1, 2, 13, E>
•   <S, 1, 2, 3, 4, 5, 4, 6, 7, 8, 7, 9, 10, 11, 12, 2, 13, E>
•   <S, 1, 2, 3, 4, 5, 4, 6, 7, 8, 7, 9, 10, 12, 2, 13, E>
•   <S, 1, 2, 3, 4, 6, 7, 8, 7, 9, 10, 11, 12, 2, 13, E>
•   <S, 1, 2, 3, 4, 6, 7, 8, 7, 9, 10, 12, 2, 13, E>
•   <S, 1, 2, 3, 4, 5, 4, 6, 7, 9, 10, 11, 12, 2, 13, E>
•   <S, 1, 2, 3, 4, 5, 4, 6, 7, 9, 10, 12, 2, 13, E>
•   <S, 1, 2, 3, 4, 6, 7, 9, 10, 11, 12, 2, 13, E>
•   <S, 1, 2, 3, 4, 6, 7, 9, 10, 12, 2, 13, E>
CONCLUSION
• The researchers have defined a number of command
  types flows and given some test data generation rules.
  These have been derived based on a branch coverage
  testing path selection criterion and boundary value
  analysis. We have also provided an algorithm and used
  an example to illustrate the methodology and show
  that it is practicable.
• The proposed methodology allows maintainers to
  recover a program’s structure and conduct software
  maintenance. The method proposed in this paper can
  help testers recognize and test programs more
  efficiently.
REFERENCE
• http://www.iis.sinica.edu.tw/page/jise/2005/
  200511_07.pdf
THANKYOU

Weitere ähnliche Inhalte

Ähnlich wie Software testing methodolgy with the control flow analysis

White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
Ankit Mulani
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01
Mr. Jhon
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
Fincy V.J
 

Ähnlich wie Software testing methodolgy with the control flow analysis (20)

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)
 
SE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxSE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptx
 
White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01
 
Chapter 14 software testing techniques
Chapter 14 software testing techniquesChapter 14 software testing techniques
Chapter 14 software testing techniques
 
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
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
 
Test Techniques
Test TechniquesTest Techniques
Test Techniques
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
 
CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design
Test Case DesignTest Case Design
Test Case Design
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design & Technique
Test Case Design & TechniqueTest Case Design & Technique
Test Case Design & Technique
 
Class9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdfClass9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdf
 
Automating Speed: A Proven Approach to Preventing Performance Regressions in ...
Automating Speed: A Proven Approach to Preventing Performance Regressions in ...Automating Speed: A Proven Approach to Preventing Performance Regressions in ...
Automating Speed: A Proven Approach to Preventing Performance Regressions in ...
 
Path testing, data flow testing
Path testing, data flow testingPath testing, data flow testing
Path testing, data flow testing
 

Mehr von RQK Khan

Mehr von RQK Khan (16)

The latest interface designs
The latest interface designsThe latest interface designs
The latest interface designs
 
GAT NTS SAMPLE PAPERS MATERIAL PART 12 Website links-for-gat-questions
GAT NTS SAMPLE PAPERS MATERIAL PART 12 Website links-for-gat-questionsGAT NTS SAMPLE PAPERS MATERIAL PART 12 Website links-for-gat-questions
GAT NTS SAMPLE PAPERS MATERIAL PART 12 Website links-for-gat-questions
 
GAT NTS SAMPLE PAPERS MATERIAL PART 11
GAT NTS SAMPLE PAPERS MATERIAL PART 11GAT NTS SAMPLE PAPERS MATERIAL PART 11
GAT NTS SAMPLE PAPERS MATERIAL PART 11
 
GAT NTS SAMPLE PAPERS MATERIAL PART 10
GAT NTS SAMPLE PAPERS MATERIAL PART 10GAT NTS SAMPLE PAPERS MATERIAL PART 10
GAT NTS SAMPLE PAPERS MATERIAL PART 10
 
GAT NTS SAMPLE PAPERS MATERIAL PART 9
GAT NTS SAMPLE PAPERS MATERIAL PART 9GAT NTS SAMPLE PAPERS MATERIAL PART 9
GAT NTS SAMPLE PAPERS MATERIAL PART 9
 
GAT NTS SAMPLE PAPERS MATERIAL PART 8
GAT NTS SAMPLE PAPERS MATERIAL PART 8GAT NTS SAMPLE PAPERS MATERIAL PART 8
GAT NTS SAMPLE PAPERS MATERIAL PART 8
 
GAT NTS SAMPLE PAPERS MATERIAL PART 7
GAT NTS SAMPLE PAPERS MATERIAL PART 7GAT NTS SAMPLE PAPERS MATERIAL PART 7
GAT NTS SAMPLE PAPERS MATERIAL PART 7
 
GAT NTS SAMPLE PAPERS MATERIAL PART 6
GAT NTS SAMPLE PAPERS MATERIAL PART 6GAT NTS SAMPLE PAPERS MATERIAL PART 6
GAT NTS SAMPLE PAPERS MATERIAL PART 6
 
GAT NTS SAMPLE PAPERS MATERIAL PART 5
GAT NTS SAMPLE PAPERS MATERIAL PART 5GAT NTS SAMPLE PAPERS MATERIAL PART 5
GAT NTS SAMPLE PAPERS MATERIAL PART 5
 
GAT NTS SAMPLE PAPERS MATERIAL PART 4
GAT NTS SAMPLE PAPERS MATERIAL PART 4GAT NTS SAMPLE PAPERS MATERIAL PART 4
GAT NTS SAMPLE PAPERS MATERIAL PART 4
 
GAT NTS SAMPLE PAPERS MATERIAL PART 3
GAT NTS SAMPLE PAPERS MATERIAL PART 3GAT NTS SAMPLE PAPERS MATERIAL PART 3
GAT NTS SAMPLE PAPERS MATERIAL PART 3
 
GAT NTS SAMPLE PAPERS MATERIAL PART 2
GAT NTS SAMPLE PAPERS MATERIAL PART 2 GAT NTS SAMPLE PAPERS MATERIAL PART 2
GAT NTS SAMPLE PAPERS MATERIAL PART 2
 
GAT NTS SAMPLE PAPERS MATERIAL PART 1
GAT NTS SAMPLE PAPERS MATERIAL PART 1 GAT NTS SAMPLE PAPERS MATERIAL PART 1
GAT NTS SAMPLE PAPERS MATERIAL PART 1
 
Data mining Tag Clouds
Data mining Tag CloudsData mining Tag Clouds
Data mining Tag Clouds
 
Microkernel architecture
Microkernel architecture Microkernel architecture
Microkernel architecture
 
Monolithic kernel vs. Microkernel
Monolithic kernel vs. MicrokernelMonolithic kernel vs. Microkernel
Monolithic kernel vs. Microkernel
 

Kürzlich hochgeladen

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

Software testing methodolgy with the control flow analysis

  • 1. SOFTWARE TESTING METHODOLGY WITH THE CONTROL FLOW ANALYSIS WEN-CHANG PAI, CHI-MING CHUNG, CHING-TANG HSIEH, CHUN- CHIA WANG, AND YING-HONG WANG
  • 3. • This paper provides a method for analyzing the control-flow of a program. • The authors define a number of command types and test data generating rules based on the control-flow of the program. • An algorithm to scan program and analysis testing paths is provided. • This will allow testers to recover the program’s design, understand the software structure, and assist software maintenance.
  • 4. AN OVERVIEW OF PROGRAM TESTING • In a program P, we say a statement block B = (s1, s2, …, sn) is a maximal subset of contiguous statements of P such that statement si is the unique successor of si-1 and si-1 is the unique predecessor of si, for all i = 1, 2, …, n. • A program graph G = {nodes, edges} contains a set of nodes and edges
  • 5. • A node without a predecessor is a start node. • A node without a successor is an exit node. • A complete path is a path whose initial node is the start node of G and whose final node is an exit node of G. • A well known logic coverage criterion is decision coverage or branch coverage. Examples of branch or decision statements are IF statements, WHILE statements, and SWITCH statement. • This criterion states that each branch direction must be traversed at least once.
  • 6. • In software testing technologies, boundary testing (or boundary value analysis; BVA) is a good test case design. It selects test data at the boundary of the input domain. • Experience shows that test data selected with BVA have a higher payoff than other data. • More errors tend to occur at the boundaries of the input domain.
  • 7. AUTOMATICALLY GENERATING TEST DATA • The steps involved in the method are described in the following: 1) Choosing Adequacy Testing Criteria: The branch coverage criterion is adopted in this paper to generate test data for testing a program. 2) Defining Command Types: We define three typical statement types in a program: (1) sequential commands, (2)conditional commands, and (3) loop commands. Each command type essentially corresponding to a block or some blocks in a program. In this paper, we will generate test data for each of the command types to enter every branch of a program.
  • 8. 3) Scanning the Program and Generating Test Data: The test data are generated from the input domain, which is derived through boundary value analysis with the Branch coverage criterion. 4) Analyzing Test Paths and Testing : Finally, testers analyze the testing paths and test the program with the results obtained in step 3.
  • 9. TEST DATA GENERATING RULES • Type 1. Sequential Command Set : • The Sequential commands, such as OPEN, READ, WRITE, and CLOSE statements, are usually written in the form • ‘C1; C2’,
  • 10. Rule 4.1 : The set S1, S2, …, Sn is a contiguous sequence of statements of a program P, such that a corresponding block B exists in P. A node N also exists in the program graph G.
  • 11. • Type 2. Conditional Command Set : • A conditional command, such as an If-Then-End statement, If-Then-Else-End statement, Switch-Case-With- Default statement, or Switch-Case-Without-Default statement, has a number of subcommands, from which exactly one is chosen to be executed. Conditional commands typically have the form • If CON1 then B1 Else if CON2 then B2 … else if CONn then Bn end if
  • 12. Rule 4.2 : Set S′ is a set of Switch statements of a program P, such that a number of corresponding blocks B1, B2, …, Bk exist in S′. A number of nodes S, N1, N2, …, Nk, and E also exist in the program graph G.
  • 13. • Type 3. Loop Command Set : • Loop commands, such as For-loop statements, While-loop statements, and Repeat- loop statements, have a number of subcommands that are executed repeatedly until some conditions are true. Loop commands typically have the form While CON do B End while OR Repeat B Until CON
  • 14. Rule 4.3 : Set S′ is a Loop statement s of a program P, such that a corresponding block B exists in P. A number of nodes, S, N, and E, also exist in the program graph G.
  • 15. TEST PATH ANALYSIS ALGORITHM • The algorithm analyzes the path to search for the command types and the apply rules 4.1 to 4.3 accordingly. • We can transform each statement of a program to its corresponding flow. The paths are analyzed and test data are generated after the program has been completely scanned.
  • 16. Algorithm PATH_ANALYSIS • begin • get PROGRAM • set START_NODE • set NEW_NODE • move POINTER to NEW_NODE • while not END_OF_PROGRAM • read next INSTRUCTION • search INSTRUCTION_TABLE • switch (INSTRUCTION) • case “Switch Statement Set” • set NEW_NODE (or NODES) /* according to the rule 4.2 */ • move POINTER to NEW_NODE /* according to the rule 4.2 */ • case “Loop Statement Set” • set NEW_NODE (or NODES) /* according to the rule 4.3 */ • move POINTER to NEW_NODE /* according to the rule 4.3 */ • case “Sequence Statement Set” /* according to the rule 4.1 */ • skip • end {switch} • end {while} • set END_NODE • end {PATH_ANALYSIS}
  • 18. TEST CASES USING BOUNDARY VALUE ANALYSIS • We have three loop commands, and one conditional command. • Test Cases for the first Loop Command (WHILE LOP=“F”) using boundary value analysis: 1- Test Case with test data of character F, to check input domain LOP=“F”. 2- Test Case with test data can be any character except F, to check input domain LOP<>“F” e.g. LOP=“A”,LOP=“B”, etc.
  • 19. • Test Cases for the Second Loop Command (WHILE ANS<> “Y” and ANS<> “y”) using boundary value analysis: 1- Test Case with test data can be any character except “Y” or “y”, to check input domain ANS<> “Y” and ANS<> “y”, e.g. ANS=“A” or ANS=“a”, ANS=“B”or ANS=“b”, etc. 2- Test Case with test data “Y” and “y” , to check input domain ANS=“Y” or ANS=“y”.
  • 20. • Test Cases for the Third Loop Command (WHILE ANS<> “Y” and ANS<> “y”) using boundary value analysis: 1- Test Case with test data can be any character except “Y” or “y”, to check input domain ANS<> “Y” and ANS<> “y”, e.g. ANS=“A” or ANS=“a”, ANS=“B”or ANS=“b”, etc. 2- Test Case with test data “Y” and “y” , to check input domain ANS=“Y” or ANS=“y”.
  • 21. • Test Cases for the First Conditional Command (IF ANS<> “Y” and ANS<> “y”) using boundary value analysis: 1- Test Case with test data can be any character except “Y” or “y”, to check input domain ANS<> “Y” and ANS<> “y”, e.g. ANS=“A” or ANS=“a”, ANS=“B”or ANS=“b”, etc. 2- Test Case with test data “Y” and “y” , to check input domain ANS=“Y” or ANS=“y”.
  • 22.
  • 23.
  • 24. From Table 1, we have the following testing paths: • <S, 1, 2, 13, E> • <S, 1, 2, 3, 4, 5, 4, 6, 7, 8, 7, 9, 10, 11, 12, 2, 13, E> • <S, 1, 2, 3, 4, 5, 4, 6, 7, 8, 7, 9, 10, 12, 2, 13, E> • <S, 1, 2, 3, 4, 6, 7, 8, 7, 9, 10, 11, 12, 2, 13, E> • <S, 1, 2, 3, 4, 6, 7, 8, 7, 9, 10, 12, 2, 13, E> • <S, 1, 2, 3, 4, 5, 4, 6, 7, 9, 10, 11, 12, 2, 13, E> • <S, 1, 2, 3, 4, 5, 4, 6, 7, 9, 10, 12, 2, 13, E> • <S, 1, 2, 3, 4, 6, 7, 9, 10, 11, 12, 2, 13, E> • <S, 1, 2, 3, 4, 6, 7, 9, 10, 12, 2, 13, E>
  • 25. CONCLUSION • The researchers have defined a number of command types flows and given some test data generation rules. These have been derived based on a branch coverage testing path selection criterion and boundary value analysis. We have also provided an algorithm and used an example to illustrate the methodology and show that it is practicable. • The proposed methodology allows maintainers to recover a program’s structure and conduct software maintenance. The method proposed in this paper can help testers recognize and test programs more efficiently.