SlideShare a Scribd company logo
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”.
Software testing methodolgy with the control flow analysis
Software testing methodolgy with the control flow analysis
•   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

More Related Content

PPT
Seii unit6 software-testing-techniques
PPTX
States, state graphs and transition testing
PPTX
Mathematic iii test case
PPT
11 whiteboxtesting
PPTX
Mathematic iii
PDF
0520 th m10.4
PDF
Hypersafe (Introducing in japanese by third party)
Seii unit6 software-testing-techniques
States, state graphs and transition testing
Mathematic iii test case
11 whiteboxtesting
Mathematic iii
0520 th m10.4
Hypersafe (Introducing in japanese by third party)

Similar to Software testing methodolgy with the control flow analysis (20)

PPT
Software Engineering (Testing techniques)
PPT
Software Engineering (Testing techniques)
PPTX
SE UNIT 5 part 2 (1).pptx
PPT
SOFTWARE ENGINEERING unit4-2 CLASS notes in pptx 2nd year
PPTX
White Box Testing And Control Flow & Loop Testing
PPT
Newsoftware testing-techniques-141114004511-conversion-gate01
PPT
Chapter 14 software testing techniques
PPSX
White Box testing by Pankaj Thakur, NITTTR Chandigarh
PPT
New software testing-techniques
PPT
software quality Assurance-lecture26.ppt
PPT
Software Testing Techniques
PPT
Test Techniques
PDF
ST Module 3 vtu prescribed syllabus and scheme
PPTX
Test case techniques
PPT
CS8494 SOFTWARE ENGINEERING Unit-4
PPSX
Test Case Design and Technique
PPSX
Test Case Design and Technique
PPTX
Test Case Design & Technique
PPTX
Test Case Design and Technique
PPTX
Test Case Design
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
SE UNIT 5 part 2 (1).pptx
SOFTWARE ENGINEERING unit4-2 CLASS notes in pptx 2nd year
White Box Testing And Control Flow & Loop Testing
Newsoftware testing-techniques-141114004511-conversion-gate01
Chapter 14 software testing techniques
White Box testing by Pankaj Thakur, NITTTR Chandigarh
New software testing-techniques
software quality Assurance-lecture26.ppt
Software Testing Techniques
Test Techniques
ST Module 3 vtu prescribed syllabus and scheme
Test case techniques
CS8494 SOFTWARE ENGINEERING Unit-4
Test Case Design and Technique
Test Case Design and Technique
Test Case Design & Technique
Test Case Design and Technique
Test Case Design
Ad

More from RQK Khan (16)

PPTX
The latest interface designs
TXT
GAT NTS SAMPLE PAPERS MATERIAL PART 12 Website links-for-gat-questions
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 11
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 10
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 9
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 8
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 7
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 6
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 5
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 4
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 3
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 2
PDF
GAT NTS SAMPLE PAPERS MATERIAL PART 1
PPTX
Data mining Tag Clouds
PPTX
Microkernel architecture
PPTX
Monolithic kernel vs. Microkernel
The latest interface designs
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 10
GAT NTS SAMPLE PAPERS MATERIAL PART 9
GAT NTS SAMPLE PAPERS MATERIAL PART 8
GAT NTS SAMPLE PAPERS MATERIAL PART 7
GAT NTS SAMPLE PAPERS MATERIAL PART 6
GAT NTS SAMPLE PAPERS MATERIAL PART 5
GAT NTS SAMPLE PAPERS MATERIAL PART 4
GAT NTS SAMPLE PAPERS MATERIAL PART 3
GAT NTS SAMPLE PAPERS MATERIAL PART 2
GAT NTS SAMPLE PAPERS MATERIAL PART 1
Data mining Tag Clouds
Microkernel architecture
Monolithic kernel vs. Microkernel
Ad

Recently uploaded (20)

PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
master seminar digital applications in india
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Lesson notes of climatology university.
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Pre independence Education in Inndia.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
O5-L3 Freight Transport Ops (International) V1.pdf
PPH.pptx obstetrics and gynecology in nursing
GDM (1) (1).pptx small presentation for students
master seminar digital applications in india
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Lesson notes of climatology university.
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Insiders guide to clinical Medicine.pdf
Cell Structure & Organelles in detailed.
Abdominal Access Techniques with Prof. Dr. R K Mishra
Final Presentation General Medicine 03-08-2024.pptx
Renaissance Architecture: A Journey from Faith to Humanism
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Pre independence Education in Inndia.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial diseases, their pathogenesis and prophylaxis
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...

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”.
  • 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.