Electrification is a key enabler to reduce emissions levels and noise in commercial vehicles. With electrification, Batteries are being used in commercial hybrid vehicles like city buses and trucks for kinetic energy recovery, boosting and electric driving. A battery management system monitors and controls multiple components of a battery system like cells, relays, sensors, actuators and high voltage loads to optimize the performance of a battery system. This paper deals with the development of modular control architecture for battery management systems in commercial vehicles.The key technical challenges for software development in commercial vehicles are growing complexity, rising number of functional requirements, safety, variant diversity, software quality requirements and reduced development costs. Software architecture is critical to handle some of these challenges early in the development process. The commercial vehicle domain is characterized by low production volumes and large number of variants. The existence of multiple vehicle level requirements, control strategies, sensors and actuators contribute towards variant diversity in software development for battery management systems. The vehicle manufacturer or the supplier has to ensure that the software fulfils certain quality characteristics based on standards. Due to increased functional complexity and cost pressure, the development process has to ensure early detection of the deviations in software quality and provide an objective feedback to the developers.Variability of the battery management system was improved by systematically representing the system topology and the functional features in a product feature model. Software architecture was derived from these functional features based on architectural design guidelines. Early detection of the deviations in software quality was ensured by verification and validation of software architecture using metrics. Metrics enabled automatic evaluation of the software architecture thereby reducing development costs, improving software quality and development efficiency.