Upload
softwarecentral
View
16
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
Software Testing
Readings: Ron Patton ch 3, 4, 15, 16 & Daniel Galin ch 9.1
What is Software testing ?
●Examination of a software unit, several integrated software units or an entire software package by running it.
● execution based on test cases● expectation – reveal faults as failures
●Failure incorrect execution of the system● usually consequence of a fault
●Fault/defect/bug result of a human error
Objective of testing
● To find defects before they cause a production system to fail.
● To bring the tested software, after correction of the identified defects and retesting, to an acceptable level of quality.
●To perform the required tests efficiently and effectively, within the limits budgetary and scheduling limitation.
●To compile a record of software errors for use in error prevention (by corrective and preventive actions)
When does a fault occur ?
1. Software doesn't do something that the specification says it should do
2. Software does something that the specification says it shouldn't do
3. Software does something that the specification doesn't mention
4. Software doesn't do something that the specification doesn't mention but should
5. Software is difficult to understand, hard to use, slow, or – in the software tester's eyes – will be viewed by the end user as just plain not right
Testing Axioms
● It's impossible to test a program completely– large input space– large output space– large state space– large number of possible execution paths– subjectivity of specifications
Testing Axioms
Large Input/State space
int exFunction(int x, int y) { ...}
● Exhaustive testing ⇒ trying all possible combination of x an y
Testing Axioms
● Large number of possible execution paths
...for (int i = 0; i < n; ++i) { if (a.get(i) == b.get(i)) x[i] = x[i] + 100; else x[i] = x[i]/2;}...
Number of paths = 2n
N Number of paths1 32 53 9
10 102520 104857760 1.15E+018
With sec per test case need since bigbang for n = 36
10−3
Testing Axioms
● Upper limit to total number of tests (Binder)
– n number of decisions– Li number of times a decision can loop– X number of decisions that cause loops– Vi number of all the possible values each input
variable could have – Y number of input variables.
2n×L1×L2×⋯×L X ×V1×V 2×⋯×V Y !
Testing Axioms
● Software testing is a riskbased exercice– need to balance cost and risk of missing bugs
● Testing can't prove the absence of bugs● The more bugs you find, the more bugs there are● The pesticide paradox
– a system tends to build resistance to a particular testing technique
Testing Axioms● Not all bugs found are fixed● Difficult to say when a bug is a bug
– only when observed (latent otherwise)● Product specifications are never final● Software testers aren't the most popular members
of a project team● Software testing is a disciplined technical
profession that requires training
What Testing can accomplish
● Reveal faults that would be too costly or impossible to find using other techniques
● Show the system complies with its stated requirements for a given test suite
● Testing is made easier and more effective by good software engineering practices
Types of testing● Unit testing● Black box testing based on specification
● White box testing based on internal logic
● Gray box testing based on design model
● Integration testing
● System testing includes● Function testing● Performance testing
● Acceptance testing– Alpha testing
– Beta testing
● Regression testing
Testing is a ProcessTest
Planning
Test Design
Test Implementation
Test Execution
ResultsVerification
Test LibraryManagement
● Planning include completion criteria (coverage goal)
● Design approaches for test case selection to achieve coverage goal● Implementation find for test cases
● input/output data● state before/after● test procedure
● Execution – run tests● Result verification – pass or fail?● Test Library Management – maintain relationships keeping track, etc.
Testing Automation
● Use of automated tools is essential – provide speed, efficiency, accuracy, precision, etc
– allow repeatibility (regression testing)
● Types of tools:– viewers and monitors (e.g. code coverage tool, debugger)
– drivers and stubs
– stress and load tools
– analysis tools (e.g. file comparison, screen capture and comparison)
– random testing tools (monkeys)
– defect tracking
Advantages/Disadvantages of test automation
Advantages• Accuracy and completeness of performance. • Accuracy of results. • Comprehensiveness of information. • Few manpower resources required for performing of tests. • Shorter duration of testing. • Performance of complete regression tests. • Performance of test classes beyond the scope of manual
testing.
Disadvantages• High investments required in package purchasing and
training. • High package development investment costs. • High manpower requirements for test preparation. • Considerable testing areas left uncovered.