Test Suite Generator Skill
Purpose
Automatically generate comprehensive test suites for iOS applications. This skill creates unit tests, UI tests, integration tests, and performance tests with proper mocking and test data.
Capabilities
- •Generate unit tests from service implementations
- •Create protocol-based mock objects
- •Generate UI test scenarios from screen flows
- •Build test data factories
- •Create performance benchmarks
- •Generate integration test suites
- •Add snapshot tests for UI components
Usage
When creating tests, I will:
- •Analyze the code structure to understand what needs testing
- •Generate appropriate test cases covering success and failure paths
- •Create mock implementations for dependencies
- •Build test data factories for consistent test data
- •Generate UI tests for critical user flows
- •Add performance benchmarks where appropriate
Common Tasks
Generate unit tests
python
python unit_test_generator.py --class Services/OrderService.swift --output Tests/
Generate mocks
python
python mock_generator.py --protocol NetworkServiceProtocol --output Mocks/
Generate UI tests
python
python ui_test_generator.py --flow checkout --output UITests/
Generate test data
python
python test_data_factory.py --model Order --output TestData/
Resources
- •
unit_test_generator.py- Generate unit tests from implementations - •
mock_generator.py- Create mock objects from protocols - •
ui_test_generator.py- Generate UI test scenarios - •
test_data_factory.py- Build test data factories - •
performance_test_generator.py- Create performance tests - •
templates/- Test code templates
Test Types Generated
Unit Tests
- •Service method tests
- •Model validation tests
- •Utility function tests
- •Error handling tests
UI Tests
- •User flow tests
- •Screen navigation tests
- •Form validation tests
- •Accessibility tests
Integration Tests
- •API integration tests
- •Database tests
- •Service interaction tests
Performance Tests
- •Method performance
- •Memory usage
- •UI responsiveness
Best Practices
- •Test both success and failure paths
- •Use descriptive test names
- •Keep tests independent
- •Use factories for test data
- •Mock external dependencies
- •Add performance baselines