Energy management system for smart homes: Testing methodology and test-case generation