
80c173e95a63c4c1189d6b6ea3c148f3.ppt
- Количество слайдов: 44
CIS 4932 Special Topics Software Testing Fall 2001 Integration Testing © 2001, Dr. E. L. Jones 11/2001 Integration Testing
Purpose This course prepares a developer to practice unit testing on a project by applying the concepts covered in the Software Unit Test Concepts course. 2 11/2001 Integration Testing
Purpose This course prepares the development team to plan and carry out an orderly process of assembling the system from tested units, and certifying the system ready formal system test. Use of a controlled test environment ensures the validity of test results and facilitates transition to formal test. 3 11/2001 Integration Testing
Agenda • What is Integration? • An Example of Integration • Integration Test Approaches • More on Architecture • Proposed Integration Test Process • Products & Deliverables • Putting it All Together 4 11/2001 Integration Testing
What is Integration? The process of combining individually developed components into a system. C System A AB B ABC 5 11/2001 Integration Testing
What is A Component? • A component is a system building block. • The smallest component is a (composite) unit • A component may be formed by combining other components • Top level components are identified in the software architecture 6 11/2001 Integration Testing
The Software Architecture • Architecture defines components and connections • Architecture depends on technology • Standard architectures exist • The software architecture is a design product 7 11/2001 Integration Testing
Software Architecture Building blocks and their connections System B A Shared component Interface C D 8 11/2001 Integration Testing
What is An Interface? • An interface is a set of connections between components • Activated by a software call • Involves the flow of data in either direction • Connection may be transient or persistent • A connection is called an interface operation • Each interface (operation) is a unit 9 11/2001 Integration Testing
Interface Operations One interface may have many operations. ftp System A email B D Net. Comm telnet 10 11/2001 Integration Testing
Agenda • What is Integration? • An Example of Integration • Integration Test Approaches • More on Architecture • Proposed Integration Test Process • Products & Deliverables • Putting it All Together 11 11/2001 Integration Testing
An Example of Integration -the aboutproduct. com Website • Simple site • Two action buttons • Refer a Friend -- send an email to a third pary • Click to Order -- accept responses to a survey and store in a database • Accesses the corporate global database • Uses communication services 12 11/2001 Integration Testing
Integration -- Connecting The Parts Net Comm Form X Bus Logic Soft. Login GDBAccess email Applic DB Global DB 13 11/2001 Integration Testing
Interfaces Between Components • Forms • Business Logic • Form • Business. Logic • Net. Comm • Soft. Login • Business. Logic • GDBAccess • • Form Soft. Login App. DB Net. Comm • GDBAccess • Soft. Login • GDB 14 11/2001 Integration Testing
Form Action Buttons Action buttons connect paths through the system. • Click to Order • Refer a Friend • Form (Survey) • Business. Logic • Soft. Login • App. DB • GDBAccess • GDB • Form (Refer) • Soft. Login • Business. Logic • App. DB • Net. Comm 15 11/2001 Integration Testing
Interfaces -- CLICK TO ORDER Home page click Info page Field Fixes Survey Form email Net. Comm Survey Data Bus. Logic Survey Data Applic DB N/E (Name, email) Submit Soft. Login N/E Global DB GDBAccess N/E 16 11/2001 Integration Testing
What Can Go Wrong During Integration? • • • Form accepts erroneous data Form does not accept valid survey data Business logic accepts invalid data Soft. Login can not access global database Business logic does not store survey data etc. 17 11/2001 Integration Testing
Getting to the Bottom of Failures • BRUTE FORCE: Individually check each connection in the system • Set up in-flows to interface operation • Activate the interface operation • Verify out-flows from interface operation • BETTER: Incrementally integrate and test, progressively expanding the number of interfaces that have been tested. 18 11/2001 Integration Testing
Making the Connection I • Diagnosing integration problems is hard • many interface operations • many possible invocation sequences • difficulty reproducing the problem • An orderly, managed approach avoids chaos and reduces the overall effort • Integration Testing approach should be based on the architecture. 19 11/2001 Integration Testing
Agenda • What is Integration? • An Example of Integration • Integration Test Approaches • More on Architecture • Proposed Integration Test Process • Products & Deliverables • Putting it All Together 20 11/2001 Integration Testing
What is Integration Testing? • Testing all connections within the software in a controlled physical environment? • A Series of Unit Tests! • Enough to ensure each interface has been tested • These tests should already exist as unit tests • Selected ones should be applied (e. g. , user operation action buttons) 21 11/2001 Integration Testing
Usage Driven Integration Test • Test end-to-end operations -- use case or user operation • Advantages • Higher level test, fewer tests to run • Allows incremental development for high priority user operations • Disadvantages • Difficult with unreliable components 25 11/2001 Integration Testing
Our Turn -- Usage Test Design • Discuss a process for identifying interfaces used during a usage driven test. • Consider how the concept of coverage used in white-box testing can be applied to minimize the number of usage-driven test cases. 26 11/2001 Integration Testing
Agenda • What is Integration? • An Example of Integration • Integration Test Approaches • More on Architecture • Proposed Integration Test Process • Products & Deliverables • Putting it All Together 27 11/2001 Integration Testing
Architecture May Reflect a Division of Labor Components are work assignments All of Us System A B C Joe Larry Moe D Curly 28 11/2001 Integration Testing
Object-Oriented Architecture UML Sequence Diagrams • Sequence of methods required to implement (test) a use case • Methods are explicit, but not every method is an interface • May be incomplete if interfaces to non-OO portions of system are not included • Sequence Diagram good for internal integration based on the OO model. 29 11/2001 Integration Testing
A Layered System Architecture Model Components vary in distance from user. User operation triggers thread of activity across many levels. 3 2 User-Visible -- GUI Business Logic 1 Service -- Database, Comm 30 11/2001 Integration Testing
Agenda • What is Integration? • An Example of Integration • Integration Test Approaches • More on Architecture • Proposed Integration Test Process • Products & Deliverables • Putting it All Together 33 11/2001 Integration Testing
Rationale Integration testing is driven by project size and architecture. Simple projects can be tested using a subset of the end-to-end tests used for system testing. More complex systems may require a combination of topdown, bottom-up and sandwich integration, tested by selected unit tests. 34 11/2001 Integration Testing
Integration Strategy form tests button tests User-Visible Components … Calls to business logic. . . Business Logic Test Drivers Services Components 35 11/2001 Integration Testing
Proposed Integration Test Process 0. 1. 2. 3. 4. 5. 6. Define system architecture Define the integration test environment Associate components with layers Identify interfaces to layer components Bottom-up test services layer interfaces Top-down test user layer components Sandwich test business logic components 36 11/2001 Integration Testing
0. Define System Architecture • Architecture should already exist • Refine to reflect components built, bought or reused for the system • Each component can be viewed as collection of callable functions and shared data, along with internal functions and private data • Specify the physical environment in which testing will occur. 37 11/2001 Integration Testing
1. Integration Test Environment • Test results depend on test environment • Different tests need different set-ups • Repeatability of results requires control of test environment • Hardware platforms • Native software suite and versions • Data sets • Version of software under test 38 11/2001 Integration Testing
2. Map Components To Layers • Logically associate software with layers • user-visible -- UI, navigation, user operations • business logic -- data flow, processing, output • services -- standard, reusable (comm, database) • Each layer contains one or more components • composite units like classes • groups of units/components 39 11/2001 Integration Testing
3. Identify Layer Interfaces • Interface provides access to layer • calls with data passing • global or shared data (database) • Identify interfaces actually used by system • Record these in the IT Worksheet • Each interface must be covered during testing 40 11/2001 Integration Testing
4. Bottom-Up Test Service Interfaces • Service component provides set of related functions/data • Refine/Develop test drivers for service component • This should have been done at unit test time • Driver depends on the physical test environment • Manual or automated set-up may be required • Run tests and verify expected results 41 11/2001 Integration Testing
5. Top-Down Test User Components • Verify presentation, navigation • Accomplished during unit test of forms/UI • Repeat tests within integration environment • Verify calls to business logic, services triggered by action buttons • (Development): Verify interface calls compile • (Testing): Usage-driven test • Can be done in parallel with services testing 42 11/2001 Integration Testing
6. Sandwich Test Business Logic • User-layer functions call business logic, which calls tested services • The sandwich test is an end-to-end test of system • This test reveals business logic errors • Top-down test verified that the right calls made • Services have been tested • Errors caused by business logic 43 11/2001 Integration Testing
Agenda • What is Integration? • An Example of Integration • Integration Test Approaches • More on Architecture • Proposed Integration Test Process • Products & Deliverables • Putting it All Together 45 11/2001 Integration Testing
RECOMMENDED PRACTICE Architecture Diagram Analysis Design IT Strategy Interface List IT Test Cases Implementation Execution Test Worksheet Evaluation Services Drivers User. Op Scripts IT Environment #Incidents, Incidents List 46 11/2001 Integration Testing
Agenda • What is Integration? • An Example of Integration • Integration Test Approaches • More on Architecture • Proposed Integration Test Process • Products & Deliverables • Putting it All Together 50 11/2001 Integration Testing
Putting It All Together • Nail down the physical test environment and institute change control • Integrate trusted components • Devise strategy based on architecture • Exploit unit testing for integration testing • Automate testing of service components 51 11/2001 Integration Testing
Summary The key to integration testing is the use of unit tested components. The architecture of the system drives the sequence of integration and test activities. With proper planning, integration testing leverages unit testing, resulting in a smooth and efficient integration test effort. 52 11/2001 Integration Testing
SOLUTIONS TO EXERCISES 11/2001 Integration Testing