A tenement is a multi-occupancy building of any sort, and in parts of England, especially Devon and Cornwall, it refers to an outshot, or additional projecting part at the back of a terraced house, normally with its own roof.
The term tenement originally referred to tenancy and therefore to any rented accommodation. The New York State legislature defined it in the Tenement House Act of 1867 in terms of rental occupancy by multiple households, as
Any house, building, or portion thereof, which is rented, leased, let, or hired out to be occupied or is occupied, as the home or residence of more than three families living independently of one another and doing their own cooking upon the premises, or by more than two families upon a floor, so living and cooking and having a common right in the halls, stairways, yards, water-closets, or privies, or some of them.
In Scotland, it continues to be the most common word for a multiple-occupancy building, but elsewhere it is used as a pejorative in contrast to apartment building or block of flats. Tenement houses were either adapted or built for the working class as cities industrialized, and came to be contrasted with middle-class apartment houses, which started to become fashionable later in the 19th century. Late 19th-century social reformers in the U.S. were hostile to both tenements (for fostering disease, and immorality in the young) and apartment houses (for fostering "sexual immorality, sloth, and divorce.").
As the United States industrialized during the 19th century, immigrants and workers from the countryside were housed in former middle-class houses and other buildings, such as warehouses, which were bought up and divided into small dwellings, and also, beginning as early as the 1830s in New York City's Lower East Side or possibly the 1820s on Mott Street, in jerry-built 3- and 4-floor "railroad flats" (so called because the rooms are linked together like a train) with windowless internal rooms. The adapted buildings were also known as "rookeries," and were a particular concern as they were prone to collapse and fire. Mulberry Bend and Five Points were the sites of notorious rookeries that the city worked for decades to clear. In both rookeries and purpose-built tenements, communal water taps and water closets (either privies or "school sinks," which opened into a vault that often became clogged) were squeezed into what open space there was between buildings. In parts of the Lower East Side, buildings were older and had courtyards, generally occupied by machine shops, stables, and other businesses.