Since separation of concerns is important throughout the software lifecycle, we use general terms rather than terms specific to programming languages and code.
Software consists of artifacts , which comprise descriptive material in suitable formalisms.
A unit is a syntactic construct in some such formalism. A unit might be, for example, a declaration, a statement, a state chart, a class, an interface, a requirements specification, or any other coherent entity that can be described in a given formalism. We distinguish primitive units, which are treated as atomic, from compound units, or modules , which group units together. Thus, for example, a method, instance variable, or performance requirement might be treated as a primitive unit, whereas a class, package, or collaboration diagram might be treated as a module. This is largely because there is such a variety of concerns of interest.