Testing Methodology for Software Development
Testing Methodology
Understanding Testing Needs
- Want to call actual API
- Implement RestClient for testing if server API works correctly
- Use mock tokens for testing
- Want to test with both mock API and real API
- Make mock and real switchable
- Want to test each case from the specification
- Systematically test all specified scenarios
Client Testing
API Mock Data
- Create mock data for API responses
ViewModel Testing
- Verify that values from mock repository are correctly set in LiveData according to each event
View Testing
- Verify that views display correctly based on LiveData values
- Verify that user actions are correctly passed to ViewModel
- Verify that UI actions are correctly executed based on LiveData values
Integration Testing
- Simulate user behavior across multiple pages
Testing Best Practices
Core Principles
- Tight schedule, no compromise: Even when difficult, strive for good code
- Test every small code change: No change is too small to test
- Unit test all code: Comprehensive coverage is essential
- Learn from bugs: Discover bugs through testing and avoid repeating mistakes
- Don’t criticize other developers: No programmer can write bug-free code
Code Review Checklist
Self-review helps remove 90% of problems yourself.
Don’ts to Check
- Bad coding practices
- Not following standards
- Not keeping performance in mind
- History, Indentation, Comments are not appropriate
- Poor readability
- Open files not closed
- Allocated memory not released
- Too many global variables
- Too much hard coding
- Poor error handling
- No modularity
- Repeated code
Coding Standards
- File naming convention
- Function & module naming convention
- Variable naming convention
- History, indentation, comments
- Readability guidelines
- List of do’s and don’ts
- Commit description guidelines
Handover Process
When receiving a project handover:
- Use the feature: Experience it as a user
- Review the planning documents: Understand the requirements
- Review the design documents: Understand the architecture
- Review the code: Understand the implementation
Maintenance and Improvement
- Fix inappropriate code with Lint, SonarQube
- Fix crash logs: Monitor and address crashes
- Monitor errors and funnels with Kibana or similar tools
- Monitor which steps users fail to pass
- Improvement work: Update existing documents while keeping history
- Add Jira ticket names in comments for traceability
Comments