CSC 404 SoftwareTesting - 115134
CSC 404 SoftwareTesting - 115134
1
Software Testing and validation
Week 10
Dr NYAMSI 4/22/2019
2 Generality
Testing is intended to show that a program does what it is
intended
Dr NYAMSI 4/22/2019
3 Generality
The testing process has two distinct goals:
1. To demonstrate to the developer and the customer that the
software meets its requirements.
2. To discover situations in which the behavior of the software is
incorrect, undesirable, or does not conform to its specification.
Dr NYAMSI 4/22/2019
4 Generality
Verification and Validation is the process of checking that a
software system meets specifications and that it fulfills its
intended purpose.
Dr NYAMSI 4/22/2019
5 Objectives:
Understand the stages of testing from development to acceptance
testing by system customers;
Have been introduced to techniques that help you choose test cases
that are geared to discovering program defects;
Dr NYAMSI 4/22/2019
6 Topics
Model of the software testing
Development testing
Unit testing
Component testing
System testing
Dr NYAMSI 4/22/2019
7 Topics
Test-driven development
Release testing
Requirement based-testing
Scenario testing
Performance testing
User testing
Dr NYAMSI 4/22/2019
8 Model of the software testing
Dr NYAMSI 4/22/2019
9 Development testing
It is where the system is tested during development to discover
bugs and defects.
Dr NYAMSI 4/22/2019
10 Development testing: Unit testing
It is where individual program units or object classes are tested.
You can use “test case” to design the function or method tests.
Dr NYAMSI 4/22/2019
11 Development testing: Unit testing
When you are testing object classes, you should design your tests
to provide coverage of all of the features of the object.
Set and check the value of all attributes associated with the object;
Put the object into all possible states. This means that you should
simulate all events that cause a state change.
Dr NYAMSI 4/22/2019
12 Development testing: Unit testing
1. A setup part, where you initialize the system with the test case,
namely the inputs and expected outputs.
3. An assertion part where you compare the result of the call with the
expected result. If the assertion evaluates to true, the test has been
successful; if false, then it has failed.
Dr NYAMSI 4/22/2019
13 Development testing: Choosing unit test cases
The test cases should show that, when used as expected, the
component that you are testing does what it is supposed to do.
Dr NYAMSI 4/22/2019
14 Development testing: Choosing unit test cases
Dr NYAMSI 4/22/2019
15 Development testing: Choosing unit test cases
We present two possible strategies that can be effective in helping
you choose test cases.
1. Partition testing, where you identify groups of inputs that have
common characteristics and should be processed in the same way.
You should choose tests from within each of these groups.
Dr NYAMSI 4/22/2019
16 Development testing: Component testing
Software components are often composite components that are
made up of several interacting objects.
Dr NYAMSI 4/22/2019
17 Development testing: Component testing
Dr NYAMSI 4/22/2019
18 Development testing: Component testing
Timing errors: These occur in real-time systems that use a shared memory or
a message-passing interface.
Dr NYAMSI 4/22/2019
20 Development testing: Component testing
Some general guidelines for interface testing are:
1. Examine the code to be tested and explicitly list each call to an external
component. Design a set of tests in which the values of the parameters to
the external components are at the extreme ends of their ranges.
2. Where pointers are passed across an interface, always test the interface
with null pointer parameters.
Dr NYAMSI 4/22/2019
21 Development testing: Component testing
Some general guidelines for interface testing are:
4. Use stress testing in message passing systems. This means that you
should design tests that generate many more messages than are
likely to occur in practice.
Dr NYAMSI 4/22/2019
22 Development testing: System testing
System testing during development involves integrating
components to create a version of the system and then testing
the integrated system.
Dr NYAMSI 4/22/2019
23 Development testing: System testing
1. During system testing, reusable components that have been separately
developed and off-the-shelf systems may be integrated with newly
developed components. The complete system is then tested.
Dr NYAMSI 4/22/2019
24 Development testing: System testing
When you integrate components to create a system, you get
emergent behavior.
Dr NYAMSI 4/22/2019
25 Development testing: System testing
Where user input is provided, all functions must be tested with both
correct and incorrect input.
Dr NYAMSI 4/22/2019
26 Development testing: System testing
Dr NYAMSI 4/22/2019
27 Test-driven development
Test-driven development (TDD) is an approach to program
development in which you interleave testing and code
development.
Dr NYAMSI 4/22/2019
28 Test-driven development
Some benefits of test-driven development are:
1. Code coverage: Every code segment that you write should have at least
one associated test. Code is tested as it is written so defects are discovered
early in the development process.
Dr NYAMSI 4/22/2019
29 Test-driven development
One of the most important benefits of test-driven
development is that it reduces the costs of regression testing.
Dr NYAMSI 4/22/2019
30 Release testing
Release testing is the process of testing a particular release of
a system that is intended for use outside of the development
team.
Dr NYAMSI 4/22/2019
31 Release testing
There are two important distinctions between release testing and
system testing :
Dr NYAMSI 4/22/2019
32 Release testing
The primary goal of the release testing process is to convince
the supplier of the system that it is good enough for use.
Dr NYAMSI 4/22/2019
33 Release testing: Requirement based-testing
A general principle of good requirements engineering practice is
that requirements should be testable.
You normally have to write several tests to ensure that you have
coverage of the requirement.
Dr NYAMSI 4/22/2019
34 Release testing: Scenario testing
Dr NYAMSI 4/22/2019
35 Release testing: Scenario testing
Dr NYAMSI 4/22/2019
36 Release testing: Performance testing
This usually involves running a series of tests where you increase the
load until the system performance becomes unacceptable.
Dr NYAMSI 4/22/2019
37 Release testing: Performance testing
Dr NYAMSI 4/22/2019
38 User testing
Dr NYAMSI 4/22/2019
39 User testing
In practice, there are three different types of user testing:
1. Alpha testing, where users of the software work with the
development team to test the software at the developer’s site.
Dr NYAMSI 4/22/2019
40 User testing
Alpha testing is often used when developing software products that are
sold as shrink-wrapped systems.
Dr NYAMSI 4/22/2019
42 Summary
Testing can only show the presence of errors in a program. It cannot
demonstrate that there are no remaining faults.
Dr NYAMSI 4/22/2019
43 Summary
When testing software, you should try to ‘break’ the software by using
experience and guidelines to choose types of test cases that have been
effective in discovering defects in other systems.
Wherever possible, you should write automated tests. The tests are
embedded in a program that can be run every time a change is made to
a system.
Dr NYAMSI 4/22/2019
44 Summary
Scenario testing is useful because it replicates the practical use of the
system. It involves inventing a typical usage scenario and using this to derive
test cases.
Dr NYAMSI 4/22/2019