Software metrics are quantitative measures used to characterize aspects of software, like size, quality, and complexity. They are used for estimating costs and schedules, controlling projects, predicting quality, providing management information, and process improvement. There are three main categories of metrics: product metrics measure attributes of the software itself like size and reliability; process metrics assess the effectiveness of development processes; and project metrics help managers track project status, risks, and quality. Key roles of metrics include monitoring requirements, predicting resource needs, tracking processes, understanding maintenance costs, and improving software through measurement.