Pa chapter08-testing integrating-the_programs-cs_390
Program Testing +Integration TestingZeeshan Rana
Types of faults and how to clasify them The purpose of testing Unit testing Integration testing strategies Test planning When to stop testing
Wrong requirement: not what the customerwants Missing requirement Requirement impossible to implement Faulty design Faulty code Improperly implemented design
Objective of testing: discover faults A test is successful only when a fault isdiscovered◦ Fault identification is the process of determiningwhat fault caused the failure◦ Fault correction is the process of making changesto the system so that the faults are removed
Purpose Input Expected Output Actual Output Sample Format:
Algorithmic fault Computation and precision fault◦ a formula’s implementation is wrong Documentation fault◦ Documentation doesn’t match what program does Capacity or boundary faults◦ System’s performance not acceptable when certain limitsare reached Timing or coordination faults Performance faults◦ System does not perform at the speed prescribed
An algorithmic fault occurs when acomponent’s algorithm or logic does notproduce proper output◦ Branching too soon◦ Branching too late◦ Forgetting to initialize variable or set loopinvariants◦ Comparing variables of inappropriate data types
Module testing, component testing, or unittesting Integration testing System Testing◦ Function testing◦ Performance testing Acceptance testing Installation testing
Egoless programming: programs are viewedas components of a larger system, not as theproperty of those who wrote them
Independent test team◦ avoid conflict◦ improve objectivity◦ allow testing and coding concurrently
Closed box or black box: functionality of thetest objects◦ Equivalence Class, Boundary Value Analysis,Scenario-based, Decision Table based, StateMachine based… Clear box or white box: structure of the testobjects◦ Control Flow Basis Path, Branch, Statement, Decision…◦ Data Flow Du Path, All-uses Path
Black box: external behavior description State box: black box with state information White box: state box with a procedure
All components integrated at once Locating faults?
Only A is tested by itself Stubs of B, C and D are used at first level N-1 stubs required (N=Number of nodes) Locating faults?
Drivers are used to call the child functions Drivers are relatively intelligent N-leaves drivers Locating faults?
Viewed system as three layers Employ BU wherewriting drivers isnot costly Employ TD wherestubs are easier toWrite Locating faults?
• Adjacency Matrix• NxN matrix that tells which components callthe other components• Pairwise Integration• Test each pair (i.e. each edge)• E testing sessions• Neighborhood based Integration• Integrate each neighborhood• The nodes at one edge distance from thenode to be integrated• N-sink nodes sessions
Establish test objectives Design and Write test cases Test test cases Execute tests Evaluate test results
Test plan explains◦ who does the testing◦ why the tests are performed◦ how tests are conducted◦ when the tests are scheduled
What the test objectives are How the test will be run What criteria will be used to determine whenthe testing is complete
No time left No money left Statistical Criteria◦ Number of defects found per week becomeslower than a set threshold
The Ariane-5’s flight control system wastested in four ways◦ equipment testing◦ on-board computer software testing◦ staged integration◦ system validation tests The Ariane-5 developers relied on insufficientreviews and test coverage
It is important to understand the differencebetween faults and failures The goal of testing is to find faults, not toprove correctness
UCF Slides Software Testing, A Craftsman’s Approach byJorgensen Software Testing Tools by Prasad