Cockroaches are social insects; a large number of species are either gregarious or inclined to aggregate, and a slightly smaller number exhibit parental care. It used to be thought that cockroaches aggregated because they were reacting to environmental cues, but it is now believed that pheromones are involved in these behaviors. Some species secrete these in their feces with gut microbial symbionts being involved, while others use glands located on their mandibles. Pheromones produced by the cuticle may enable cockroaches to distinguish between different populations of cockroach by odor. The behaviors involved have been studied in only a few species, but German cockroaches leave fecal trails with an odor gradient. Other cockroaches follow such trails to discover sources of food and water, and where other cockroaches are hiding. Thus, cockroaches have emergent behavior, in which group or swarm behavior emerges from a simple set of individual interactions.
Daily rhythms may also be regulated by a complex set of hormonal controls of which only a small subset have been understood. In 2005, the role of one of these proteins, pigment dispersing factor (PDF), was isolated and found to be a key mediator in the circadian rhythms of the cockroach.
Pest species adapt readily to a variety of environments, but prefer warm conditions found within buildings. Many tropical species prefer even warmer environments. Cockroaches are mainly nocturnal and run away when exposed to light. An exception to this is the Asian cockroach, which flies mostly at night but is attracted to brightly lit surfaces and pale colors.
Read more, here.