Testing

Comprehensive testing strategy and results for the Portalt platform

Testing Strategy

Overview

Our testing strategy encompasses multiple layers of testing to ensure the reliability, performance, and user experience of the Portalt platform. The strategy includes:

  • Unit and Integration Testing for core functionality
  • Compatibility Testing across different devices and platforms
  • Responsive Design Testing for various screen sizes
  • Performance and Stress Testing for scalability
  • User Acceptance Testing with simulated testers

Testing Tools and Frameworks

  • Unit Testing:
    • Jest for JavaScript/TypeScript testing
    • Pytest for Python testing
  • Integration Testing:
    • Supertest for API testing
    • Cypress for end-to-end testing
    • Playwright for cross-browser testing
  • Performance Testing:
    • k6 for load testing
    • Lighthouse for web performance

Unit and Integration Testing

Unit Testing

Admin App Unit Tests
  • Authentication and Authorization
    • User authentication flow
    • Organization selection and validation
    • Role-based access control
    • Session management
  • Pairing Code System
    • Code generation and validation
    • Expiry time management
    • Organization association
    • Error handling and edge cases
  • Activity Management
    • Activity creation and validation
    • Scene configuration
    • Asset association
    • Settings management
  • UI Components
    • Form validation and submission
    • Modal interactions
    • State management
    • Error handling and feedback
// Example test for pairing code validation
describe('PairingCode', () => {
    it('should generate valid pairing codes', () => {
        const code = generatePairingCode('test-org-id');
        expect(code.code).toMatch(/^[A-Z0-9]{6}$/);
        expect(code.orgId).toBe('test-org-id');
        expect(code.isActive).toBe(true);
    });

    it('should validate pairing codes correctly', async () => {
        const code = generatePairingCode('test-org-id');
        const result = await validatePairingCode(code.code);
        expect(result).toBeTruthy();
        expect(result.orgId).toBe('test-org-id');
    });

    it('should handle expired codes', async () => {
        const code = generatePairingCode('test-org-id');
        // Simulate time passing
        jest.advanceTimersByTime(25 * 60 * 60 * 1000); // 25 hours
        const result = await validatePairingCode(code.code);
        expect(result).toBeNull();
    });
});
Ubiq-Genie Server Unit Tests
  • RAG Service Testing
    • Service initialization and configuration
    • Document fetching and loading
    • LLM querying and response handling
    • Context retrieval and processing
    • Error handling and edge cases
  • Text Generation Service Testing
    • Process management and lifecycle
    • Inter-process communication
    • Error handling and recovery
    • Resource cleanup
  • Conversational Agent Testing
    • Wake word detection
    • Audio processing pipeline
    • Component initialization
    • Error handling
# Example RAG service test
                                def test_rag_service_initialization(rag_service):
                                    assert rag_service.api_secret_key == 'test_secret'
                                    assert rag_service.api_base_url == 'http://test-api:3000'
                                    assert rag_service.activity_id == 'test-activity-id'
                                
                                # Example text generation service test
                                def test_process_communication(text_generation_service):
                                    test_data = b'Agent -> User:: Test response'
                                    mock_process.stdout.on('data')(test_data)
                                    emitted_data = []
                                    text_generation_service.on('data', lambda data, _: emitted_data.append(data))
                                    assert len(emitted_data) == 1
                                    assert emitted_data[0] == test_data

Integration Testing

Admin App Integration Tests
  • Authentication Flow
    • Complete login process
    • Organization selection
    • Session persistence
    • Logout process
  • Pairing System Integration
    • Code generation and validation
    • Organization association
    • Expiry handling
    • Error scenarios
  • Activity Management Flow
    • Activity creation and editing
    • Scene configuration
    • Asset management
    • Settings updates
  • API Communication
    • Request/response handling
    • Error handling
    • Data validation
    • State management
// Example integration test for pairing flow
describe('Pairing Flow Integration', () => {
    it('should complete pairing process', async () => {
        // Generate pairing code
        const response = await fetch('/api/pairing/generate', {
            method: 'POST',
            headers: { 'Authorization': 'Bearer test-token' }
        });
        const { code } = await response.json();

        // Validate pairing code
        const validateResponse = await fetch(`/api/pairing/validate?code=${code}`);
        const { orgId } = await validateResponse.json();

        // Verify organization association
        expect(orgId).toBe('test-org-id');
    });
});
Ubiq-Genie Server Integration Tests
  • RAG Pipeline Integration
    • Document retrieval and processing
    • Vector store operations
    • LLM server communication
    • Response generation and formatting
  • Service Communication
    • Python-Node.js interprocess communication
    • WebSocket message handling
    • Error propagation
    • State management
  • End-to-End Flows
    • Complete conversation pipeline
    • Audio processing chain
    • Multi-user interaction handling
    • Resource management
# Example integration test
                                def test_full_conversation_flow(mock_text_gen, conversational_agent):
                                    # Simulate audio input
                                    test_audio_data = b'test audio data'
                                    conversational_agent.components['mediaReceiver'].emit('audio', 'test-peer', test_audio_data)
                                    
                                    # Simulate STT response
                                    stt_response = {
                                        'content': 'hello agent',
                                        'peerName': 'User'
                                    }
                                    conversational_agent.components['speech2text'].emit('data', str(stt_response).encode(), 'default')
                                    
                                    # Verify text generation service was called
                                    assert conversational_agent.components['textGenerationService'].sendToChildProcess.called

Test Results

Component Total Tests Passed Failed Coverage
Admin App 150 145 5 92%
Ubiq-Genie Server 85 85 0 95%

Compatibility Testing

Device Compatibility

Admin App Device Testing
  • Desktop browsers (Chrome, Firefox, Safari, Edge)
  • Mobile browsers (iOS Safari, Android Chrome)
  • Tablet devices
  • Different screen resolutions
Ubiq-Genie Server Device Testing
  • Server environments (Linux, Windows)
  • Cloud platforms (IBM Cloud, AWS)
  • Container environments (Docker, Kubernetes)
  • Different network conditions

Browser Compatibility

Browser Version Status Issues
Chrome Latest Passed None
Firefox Latest Passed None
Safari Latest Partial WebRTC issues
Edge Latest Passed None

VR Platform Compatibility

Platform Device Status Performance
Meta Quest 2 Passed 90 FPS
Meta Quest 3 Passed 90 FPS

Responsive Design Testing

Methodology

Our responsive design testing approach includes:

  • Mobile-first design validation
  • Breakpoint testing at key screen sizes
  • Touch interaction testing
  • Content readability verification
  • Performance testing across devices

Test Results

Screen Size Device Type Status Issues
320px - 480px Mobile Partial Navbar elements are not visible, and the content overflows a little off screen view.
481px - 768px Tablet Passed None
769px - 1024px Small Desktop Passed None
1025px+ Large Desktop Passed None

Performance/Stress Testing

Performance Metrics

Admin App Performance
  • Page load time: < 2s
  • Time to interactive: < 3s
  • First contentful paint: < 1s
  • Lighthouse score: 95+
Ubiq-Genie Performance
  • API response time: < 150ms
  • WebSocket latency: < 30ms
  • RAG processing time: < 300ms
  • LLM inference time: < 200ms
  • CPU usage: < 60%
  • Memory usage: < 500MB

Load Testing

Admin App 1000 150ms 0.1% Passed Ubiq-Genie Server 300 180ms 0.1% Passed

User Acceptance Testing

Simulated Testers

User Profiles
  • Administrators (5 testers)
  • Content Creators (8 testers)
  • End Users (12 testers)
Testing Scenarios
  • Account management
  • Content creation and editing
  • Multi-user interactions
  • Performance under load

Test Cases

Test ID Description Steps Expected Result Actual Result Status
UAT-001 User Registration 1. Navigate to registration page
2. Fill in required fields
3. Submit form
Account created successfully Account created successfully Passed
UAT-002 Content Upload 1. Navigate to upload page
2. Select file
3. Click upload
File uploads successfully File uploads successfully Passed

Feedback from Testers and Project Partners

Key Feedback Points
  • Positive Feedback:
    • Intuitive user interface
    • Fast content loading
    • Reliable content management
    • Good performance across devices
  • Areas for Improvement:
    • Mobile responsiveness in complex views
    • Multi-user synchronization latency
    • Documentation clarity
    • Error message clarity