unit 5 (OOSE)
Object-Oriented Testing and Design Patterns (RGPV Notes)
Important: Using the same terminology throughout:
- OOA = Object-Oriented Analysis
- OOD = Object-Oriented Design
- OO Testing = Object-Oriented Testing
1. Object-Oriented Testing
Definition
Object-Oriented Testing is the process of testing classes, objects, methods, interactions, and relationships in an object-oriented software system.
Objectives
- Find errors in classes and objects.
- Verify software requirements.
- Ensure system quality.
- Improve reliability.
- Validate object interactions.
- Check correctness of design.
- Ensure proper functionality.
2. Correctness of OOA and OOD Models
Definition
Correctness means the OOA and OOD models accurately represent the user requirements.
Correctness Checks
- All requirements are included.
- Classes are properly identified.
- Relationships are correctly defined.
- Use cases match requirements.
- Objects perform required functions.
- No missing functionality.
- Design supports implementation.
Example
If a Course Registration System requires student registration, then Student and Registration classes must be present.
3. Consistency of OOA and OOD Models
Definition
Consistency means all UML models agree with each other and contain no contradictions.
Consistency Checks
- Class names should remain same in all diagrams.
- Relationships should be consistent.
- Use cases should match class operations.
- State transitions should be valid.
- Object interactions should follow design.
- No conflicting information.
- All diagrams should support the same requirements.
Example
If a Student class exists in Class Diagram, it should also appear where required in Sequence Diagram and Use Case Diagram.
4. Testing Strategies for OO Software
Definition
Testing Strategy is a planned approach used to test object-oriented software.
Types of Testing
1. Unit Testing
Tests individual classes and methods.
2. Integration Testing
Tests interaction between classes.
3. System Testing
Tests the complete software system.
4. Validation Testing
Checks whether requirements are satisfied.
5. Acceptance Testing
Performed by customer or end user.
7-Mark Answer: Testing Strategy
- Unit Testing verifies individual classes.
- Integration Testing verifies object interactions.
- System Testing checks complete system behavior.
- Validation Testing checks requirements.
- Acceptance Testing is performed by users.
- Testing improves software quality.
- Testing helps identify defects early.
5. Test Cases for OO Software
Definition
A Test Case is a set of inputs, conditions, and expected outputs used to verify software functionality.
Components of a Test Case
- Test Case ID
- Objective
- Input
- Execution Steps
- Expected Output
- Actual Output
- Result
Example
Login Test Case
| Field | Value |
|---|---|
| Test Case ID | TC01 |
| Input | Valid Username & Password |
| Expected Output | Login Successful |
| Result | Pass |
Advantages
- Easy defect tracking.
- Improves quality.
- Ensures requirement coverage.
- Supports systematic testing.
6. Project Management
Definition
Project Management is the process of planning, organizing, executing, and controlling software projects.
Activities
- Project Planning
- Resource Allocation
- Scheduling
- Risk Management
- Cost Estimation
- Monitoring
- Project Control
Objectives
- Complete project on time.
- Complete project within budget.
- Achieve project goals.
- Improve productivity.
- Reduce risks.
7. Rational Tool Mentor
Definition
Rational Tool Mentor is a support feature in Rational Rose that provides guidance for UML modeling and software development activities.
Features
- Provides development guidelines.
- Supports UML modeling.
- Helps project documentation.
- Improves development process.
- Provides best practices.
- Helps beginners learn UML.
- Supports Rational Rose users.
8. Introduction to Design Patterns
Definition
A Design Pattern is a reusable solution to a commonly occurring software design problem.
Purpose
- Reuse proven solutions.
- Improve software design.
- Reduce development time.
- Increase maintainability.
- Improve flexibility.
Types of Design Patterns
1. Creational Patterns
Deal with object creation.
Example: Singleton
2. Structural Patterns
Deal with class and object structure.
Example: Adapter
3. Behavioral Patterns
Deal with communication between objects.
Example: Observer
Advantages of Design Patterns
- Reusable solutions.
- Better code quality.
- Easier maintenance.
- Faster development.
- Improved flexibility.
- Better communication among developers.
- Reduced complexity.
Revision Points (Quick Notes)
Object-Oriented Testing
- Tests classes, objects, methods, and interactions.
- Improves software quality.
Keyword: Testing Objects and Classes
Correctness
- Requirements are correctly represented.
- No missing functionality.
Keyword: Right Model
Consistency
- All UML diagrams agree with each other.
- No contradictions.
Keyword: Same Information Everywhere
Testing Strategy
- Unit Testing
- Integration Testing
- System Testing
- Validation Testing
- Acceptance Testing
Keyword: Unit → Integration → System → Validation → Acceptance
Test Case
Contains:
- ID
- Input
- Steps
- Expected Output
- Result
Keyword: Verify Functionality
Project Management
- Planning
- Scheduling
- Resource Allocation
- Risk Management
- Monitoring
Keyword: Plan and Control Project
Rational Tool Mentor
- Guidance tool in Rational Rose.
- Provides best practices.
Keyword: UML Development Support
Design Pattern
- Reusable solution to common design problems.
Types
- Creational
- Structural
- Behavioral
Keyword: Reusable Design Solution
2-Mark Revision Sheet
Correctness
Model correctly represents requirements.
Consistency
All UML models agree with each other.
Unit Testing
Testing individual classes.
Integration Testing
Testing interaction between classes.
Test Case
Input + Expected Output + Result.
Project Management
Planning and controlling software projects.
Rational Tool Mentor
Guidance feature of Rational Rose.
Design Pattern
Reusable solution to a common software design problem.
Last 30-Second Revision
OO Testing → Correctness → Consistency → Testing Strategy → Test Case → Project Management → Rational Tool Mentor → Design Pattern → Creational → Structural → Behavioral
Comments
Post a Comment