Book contents
- Frontmatter
- Contents
- List of figures
- List of Tables
- Preface
- Acknowledgements
- 1 Introduction
- 2 Functional Testing
- 3 Essentials of Graph Theory
- 4 Structural Testing
- 5 Software Verification
- 6 Creating Test Cases from Requirements and Use Cases
- 7 Selection, Minimization and Prioritization of Test Cases for Regression Testing
- 8 Software Testing Activities
- 9 Object Oriented Testing
- 10 Metrics and Models in Software Testing
- 11 Testing Web Applications
- 12 Automated Test Data Generation
- Appendix I
- Appendix II
- Appendix III
- References
- Answers to Multiple Choice Questions
- Index
4 - Structural Testing
Published online by Cambridge University Press: 05 November 2012
- Frontmatter
- Contents
- List of figures
- List of Tables
- Preface
- Acknowledgements
- 1 Introduction
- 2 Functional Testing
- 3 Essentials of Graph Theory
- 4 Structural Testing
- 5 Software Verification
- 6 Creating Test Cases from Requirements and Use Cases
- 7 Selection, Minimization and Prioritization of Test Cases for Regression Testing
- 8 Software Testing Activities
- 9 Object Oriented Testing
- 10 Metrics and Models in Software Testing
- 11 Testing Web Applications
- 12 Automated Test Data Generation
- Appendix I
- Appendix II
- Appendix III
- References
- Answers to Multiple Choice Questions
- Index
Summary
Structural testing is considered more technical than functional testing. It attempts to design test cases from the source code and not from the specifications. The source code becomes the base document which is examined thoroughly in order to understand the internal structure and other implementation details. It also gives insight in to the source code which may be used as an essential knowledge for the design of test cases. Structural testing techniques are also known as white box testing techniques due to consideration of internal structure and other implementation details of the program. Many structural testing techniques are available and some of them are given in this chapter like control flow testing, data flow testing, slice based testing and mutation testing.
CONTROL FLOW TESTING
This technique is very popular due to its simplicity and effectiveness. We identify paths of the program and write test cases to execute those paths. As we all know, path is a sequence of statements that begins at an entry and ends at an exit. As shown in chapter 1, there may be too many paths in a program and it may not be feasible to execute all of them. As the number of decisions increase in the program, the number of paths also increase accordingly.
Every path covers a portion of the program. We define ‘coverage’ as a ‘percentage of source code that has been tested with respect to the total source code available for testing’.
- Type
- Chapter
- Information
- Software Testing , pp. 165 - 229Publisher: Cambridge University PressPrint publication year: 2011