Chapter 7: Software Testing (Part 2)
Customers test a system to decide whether or not it is ready to be accepted from the system developers and deployed in the customer environment. Primarily for custom systems.
Acceptance testing
Users of the software work with the development team to test the software at the developer's site.
Alpha testing
A regression test suite is developed incrementally as a program is developed.
Regression testing
the process of testing a particular release of a system that is intended for use outside of the development team.
Release testing
involves examining each requirement and developing a test or tests for it.
Requirements-based testing
an approach to release testing where you devise typical scenarios of use case and use these to develop test cases for the system.
Scenario testing
When a test fails, it should be obvious where the problem lies. The newly written code needs to be checked and modified.
Simplified debugging
The tests themselves are a form of documentation that describe what the code should be doing.
System documentation
System testing
System testing during development involves integrating components to create a version of the system and then testing the integrated system.
an approach to program development in which you inter-leave testing and code development.
Test-driven development (TDD)
performance testing is concerned both with demonstrating that the system meets its requirements and discovering problems and defects in the system
True
User testing is essential, even when comprehensive system and release testing have been carried out.
True - The reason for this is that influences from the user's working environment have a major effect on the reliability, performance, usability and robustness of a system. These cannot be replicated in a testing environment.
Partition testing: Input data and output results often fall into different classes where all members of a class are related. Each of these classes is an equivalence partition or domain where the program behaves in an equivalent way for each class member.
True Test cases should be chosen from each partition.
a stage in the testing process in which users or customers provide input and advice on system testing.
User testing
Release testing and system testing: Important differences
- A separate team that has not been involved in the system development, should be responsible for release testing - System testing by the development team should focus on discovering bugs in the system (defect testing). The objective of release testing is to check that the system meets its requirements and is good enough for external use (validation testing).
Examples of testing policies:
- All system functions that are accessed through menus should be tested. - Combinations of functions (e.g. text formatting) that are accessed through the same menu must be tested - Where user input is provided, all functions must be tested with both correct and incorrect input.
Types of user testing
- Alpha testing - Beta testing - Acceptance testing
Test cases derived from sequence diagram
- An input of a request for a report should have an associated acknowledgement. A report should ultimately be returned from the request. - You should create summarized data that can be used to check that the report is correctly organized.
General testing guidelines
- Choose inputs that force the system to generate all error messages - Design inputs that cause input buffers to overflow - Repeat the same input or series of inputs numerous times - Force invalid outputs to be generated - Force computation results to be too large or too small.
Benefits of test-driven development
- Code coverage - Regression testing - Simplified debugging - System documentation
Stages in the acceptance testing process
- Define acceptance criteria - Plan acceptance testing - Derive acceptance - Run acceptance tests - Negotiate test results - Reject/accept system
Component Integration testing
- Software components are often composite components that are made up of several interacting objects. - You access the functionality of objects through the defined component interface.
TDD process activities
- Start by identifying the increment of functionality that is required. This should normally be small and implementable in a few lines of code. - Write a test for this functionality and implement this as an automated test. - Run the test, along with all other tests that have been implemented. Initially, you have not implemented the functionality so the new test will fail. - Implement the functionality and re-run the test. - Once all tests run successfully, you move on to implementing the next chunk of functionality.
Testing guidelines (sequences)
- Test software with sequences which have only a single value. - Use sequences of different sizes in different tests - Derive tests so that the first, middle and last elements of the sequence are accessed. - Test with sequences of zero length.
Use-case testing
- The use-cases developed to identify system interactions can be used as a basis for system testing. - Each use case usually involves several system components so testing the use case forces these interactions to occur. - The sequence diagrams associated with the use case show the components and interactions that are being tested.
Bottom-Up Integration
- drivers are replaced one at a time, "depth first" - worker modules are grouped into builds and integrated
Integration Testing Strategies
- the "big bang" approach - an incremental construction strategy
Top Down Integration
- top module is tested with stubs - stubs are replaced one at a time, "depth first" - as new modules are integrated, some subset of tests is re-run
Component Integration testing (cont.)
Assume that components A, B, and C have been integrated to create a larger component or subsystem. The test cases are not applied to the individual components but rather to the interface of the composite component created by combining these components. Interface errors in the composite component may not be detectable by testing the individual objects because these errors result from interactions between the objects in the component. - It is done after unit testing.
A release of the software is made available to users to allow them to experiment and to raise problems that they discover with the system developers.
Beta testing
Every code segment that you write has at least one associated test so all code written has at least one test.
Code coverage
System and component testing (cont.)
Components developed by different team members or sub-teams may be integrated at this stage. System testing is a collective rather than an individual process.
System and component testing
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.
Testing policies
Exhaustive system testing is impossible so testing policies which define the required system test coverage may be developed.
use testing guidelines to choose test cases.
Guideline-based testing
identify groups of inputs that have common characteristics and should be processed in the same way.
Partition testing
Part of release testing may involve testing the emergent properties of a system, such as performance and reliability.
Performance testing
Acceptance testing is a user testing process where the aim is to decide if the software is good enough to be deployed and used in its operational environment
True
Development testing includes unit testing, in which you test individual objects and methods component testing in which you test related groups of objects and system testing, in which you test partial or complete systems.
True
Development testing is the responsibility of the software development team. A separate team should be responsible for testing a system before it is released to customers.
True
In Test-driven development, Tests are written before code and 'passing' the tests is the critical driver of development.
True
In Test-driven development, you develop code incrementally, along with a test for that increment. You don't move on to the next increment until the code that you have developed passes its test.
True
In a manual testing process, regression testing is expensive but, with automated testing, it is simple and straightforward. All tests are rerun every time a change is made to the program.
True
In some companies, system testing may involve a separate testing team with no involvement from designers and programmers.
True
Performance tests should reflect the profile of use of the system.
True
Performance tests usually involve planning a series of tests where the load is steadily increased until the system performance becomes unacceptable.
True
Regression testing is testing the system to check that changes have not 'broken' previously working code.
True
Release testing is a form of system testing.
True
Release testing is usually a black-box testing process where tests are only derived from the system specification.
True
Release testing, therefore, has to show that the system delivers its specified functionality, performance and dependability, and that it does not fail during normal use.
True
Scenario testing involves inventing a typical usage scenario and using this to derive test cases.
True
Stress testing is a form of performance testing where the system is deliberately overloaded to test its failure behavior.
True
System testing checks that components are compatible, interact correctly and transfer the right data at the right time across their interfaces.
True
System testing tests the emergent behavior of a system.
True
TDD was introduced as part of agile methods such as Extreme Programming (XP). However, it can also be used in plan-driven development processes.
True
Test-first development is an approach to development where tests are written before the code to be tested.
True
Testing can only show the presence of errors in a program. It cannot demonstrate that there are no remaining faults.
True
Testing composite components should therefore focus on showing that the component interface behaves according to its specification.
True
Tests must run 'successfully' before the change is committed.
True
The focus in system testing is testing the interactions between components.
True
There are possible strategies here that can be effective in choosing test cases.
True
These guidelines reflect previous experience of the kinds of errors that programmers often make when developing components.
True
When testing software, you should try to 'break' the software by using experience and guidelines to choose types of test case that have been effective in discovering defects in other systems.
True
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.
True