1 / 13

KUFA UNIVERSITY

KUFA UNIVERSITY. Department of Computer Science. Fundamentals of Software Engineering. Presented By Neamah Hassan. s/w testing. Testing The aim from testing is to identify all defects in a program

rane
Download Presentation

KUFA UNIVERSITY

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. KUFA UNIVERSITY Department of Computer Science

  2. Fundamentals of Software Engineering Presented By Neamah Hassan

  3. s/w testing • Testing • The aim from testing is to identify all defects in a program • It is not possible to get guarantee a program is error free bcz the input data domain of most program is very large • Testing a program involves providing the program with set of test input and check if the program behaves as expected

  4. Some terms related to testing Error Is a mistake committed by development team during any development phase , the mistake committed may be in the requirement , design or code Failure Is a manifestation an error but mere found error not necessarily lead to failure Test case Is the triplet ( I , S , O ) where I is the data input to the system , S is the state of the system , O is the expected output of the system Test suite Set of all test cases with which given S/W product is tested

  5. Verification versus validation Verification Is the process of determining whether the output of one phase conforms to previous phase Validation Is the process of determining whether the fully developed system conforms ti its requirement specification

  6. Basic approach of testing • 1- Black box ( external ) • 2- white box ( glass box , internal ) • Black-box Testing • 1- Test cases are designed using only functional specification of the software . • 2- Without any knowledge of the internal structure of the software • 3- For this reason, black-box testing is also known as functional testing • 4- based on analysis of I/P , O/P behavior • 5- Two main approaches to design black box test cases: • A- Equivalence class partitioning • B- Boundary value analysis

  7. Basic approach of testing • white box ( glass box , internal ) • 1- Requires knowledge about the internal structure of software. • 2- White-box testing is also called structural testing • 3- Based on analysis the code • 4- There exist several popular white-box testing methodologies: • A- Statement coverage • B- Branch coverage • C- Path coverage • D- Condition coverage

  8. white box ( glass box , internal ) • Statement coverage • The aim is that Design test cases so that every statement in the program is executed at least once • Branch coverage • Test cases are designed such that Different branch conditions • Given true and false values in turn • Path coverage • - All linearly independent paths in the program are executed • at least once • - All linearly independent paths can be defined in terms ( CFG) • Condition coverage • Each component of a composite conditional expression Given • both true and false values.

  9. Control flow graph (CFG) To understand the path coverage-based testing : we need to learn how to draw control flow graph of a program. A control flow graph (CFG) describes the sequence in which different instructions of a program get executed How to Draw Control Flow Graph? 1- Number all the statements of a program. 2- Numbered statements Represent nodes of the control flow graph

  10. Control flow graph (CFG) • Sequence: • 1- a=5; • 2- b=a*b-1; • Selection: • 1- if(a>b) then • 2 - c=3; • 3 - else c=5; • 4 - c=c*c; • Iteration: • 1- while(a>b){ • 2 - b=b*a; • 3 - b=b-1;} • 4 - c=b+d; 1 2 1 2 3 1 4 2 3 4

  11. Control flow graph (CFG) int f1(intx,int y){ 1 while (x != y){ 2 if (x>y) then 3 x=x-y; 4 else y=y-x; 5 } 6 return x; } 1 2 3 4 5 6

  12. Next lecture Type of testing Different approach to develop test plan

More Related