Software developers, either in a planned or ad hod fashion, introduce regularities such as architectural, design or programming conventions, idioms, and patterns into software systems while developing source code. There are numerous unverfied claims in the software engineering literature about the impacts of such regularities on software quality. To investigate how the degree of conformance to regularities in a software component affects its various quality attributes necessarily requires a measure of software regularity. Unfortunately, an extensive search failed to find a measure of regularity, or design consistency, in the software engineering literature. In this paper, we propose a model to measure a component's Degree of Regularity (DR), as well as its Regularity Density (RD). We evaluate the validity of the proposed metrics in a case study of regularity and defect-based quality attributes on three major components of an industrial large-scale software system. Results from this empirical study suggest that a component's defect-based measures tend to decrease as its regularity-based measures increase. This finding has the potential implication of increasing the reliability of software systems by minimizing the defect rates of software components through controlling their regularity.