Drexel University
CS 451 Software Engineering Winter 2009
1
CS 451 Software Engineering Winter 2009 Yuanfang Cai Room 104, - - PowerPoint PPT Presentation
CS 451 Software Engineering Winter 2009 Yuanfang Cai Room 104, University Crossings 215.895.0298 yfcai@cs.drexel.edu 1 Drexel University Validation and Verification Validation: a set of activities that ensures that the software that has
Drexel University
1
Drexel University
Validation: a set of activities that ensures that
Are we building the right product?
Verification: the set of activities the ensures
Are we building the product right?
Drexel University
Testing only reveals the presence of defects Does not identify nature and location of defects Identifying & removing the defect => role of
Preparing test cases, performing testing,
Overall testing becomes very expensive : 30-
Drexel University
The code contains requirement defects, design
Nature of defects is different for different
One type of testing will be unable to detect the
Different levels of testing are used to uncover
Drexel University
Drexel University
Drexel University
Different modules tested separately Focus: defects injected during coding Essentially a code verification technique,
UT is closely associated with coding Frequently the programmer does UT; coding
Drexel University
Unit Testing – focuses verification effort on the smallest
Considerations:
The module interface is tested to ensure that information properly flows into and out of the program unit under test.
All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once.
Boundary conditions are tested to ensure that the module operates properly.
Error handling paths are tested.
8
Drexel University
Unit Testing
Unit testing is
Design of tests
9
Drexel University
Unit Testing Procedure
Since each component is not a stand alone program, a
bit of work must be done to perform the test.
Create a driver, usually a main program, that accepts test
case data and passes it to the component to be tested. It also may print relevant results.
Stubs replace modules that may not be coded and are
subordinate to the component to be tested. A stub may do minimum data manipulation , provides verification of entry, and returns control to the module undergoing testing.
Unit testing is simpler when modules are highly
10
Drexel University
Drexel University
Focuses on interaction of modules in a
Unit tested modules combined to form
Test cases to “exercise” the interaction of
May be skipped if the system is not too large
Drexel University
Data can be lost across an interface.
One module can have an inadvertent effect on another.
Global data structures can present problems
Individually acceptable imprecision may become magnified.
Drexel University
Drexel University
Drexel University
1.
2.
3.
4.
5.
Drexel University
1.
Low-level components are combined into clusters that perform a specific software subfunction.
2.
A driver (control program for testing) is written to coordinate test cases input and output.
3.
The cluster is tested.
4.
Drivers are removed and clusters are combined moving upward in the program structure.
Drexel University
Drexel University
Entire software system is tested Focus: does the software implement the
Validation exercise for the system with
Generally the final testing stage before the
May be done by independent people Defects removed by developers Most time consuming test phase
Drexel University
Focus: Does the software satisfy user needs? Generally done by end users/customer in
Only after successful AT software is deployed Any defects found,are removed by developers Acceptance test plan is based on the
Drexel University
Performance testing
tools needed to “measure” performance
Stress testing
load the system to peak, load generation tools
Regression testing
test that previous functionality works alright important when changes are made Previous test records are needed for comparisons Prioritization of testcases needed when complete test
Drexel University
Drexel University
Each time a new module is added, the software changes.
These changes may cause problems with functions that previously worked.
Therefore, we must re-execute some subset of tests that were already conducted to ensure that changes have not propagated unintended side effects.
Any time you test, if successful you will find errors. When those errors are corrected, software changes. Therefore, regression testing must be performed in order to ensure that those changes did not propagate unintended side effects.
Regression tests may be conducted manually – I do not recommend this.
Drexel University
Drexel University
Drexel University
People often give out secure information. No system can truly protect against this 100%.
Drexel University
Multiple interrupts per second
Increased data rate
Test max memory
Excessive disk hunting
Drexel University
Drexel University
A large software may have thousands of defects,
Often person who fixes (usually the coder) is
Due to large scope, reporting and fixing of
Defects found are usually logged in a defect
Defect logging and tracking is one of the best
Drexel University
A defect in a software project has a life cycle of
Found by someone, sometime and logged along with
Job of fixing is assigned; person debugs and then
The manager or the submitter verifies that the defect
More elaborate life cycles possible
Drexel University
Software testing may be viewed as a spiral process:
31
Drexel University
Software Testing Steps
32
Drexel University
How do you know when you are done testing?
There is no definitive answer to this question.
Many possible answers:
You are never done testing. You are done testing when you run out of money or
Depends upon the certainty of failure you desire.
33
Drexel University
Validation and Verification Different Types of Testing
Context purposes