  Team diversity can be seen as a double-edged sword. It brings additional
cognitive resources to teams at the risk of increased conflict. Few studies
have investigated how different types of diversity impact software teams. This
study views diversity through the lens of the categorization-elaboration model
(CEM). We investigated how diversity in gender, age, role, and cultural
background impacts team effectiveness and conflict, and how these associations
are moderated by psychological safety. Our sample consisted of 1,118
participants from 161 teams and was analyzed with Covariance-Based Structural
Equation Modeling (CB-SEM). We found a positive effect of age diversity on team
effectiveness and gender diversity on relational conflict. Psychological safety
contributed directly to effective teamwork and less conflict but did not
moderate the diversity-effectiveness link. While our results are consistent
with the CEM theory for age and gender diversity, other types of diversity did
not yield similar results. We discuss several reasons for this, including
curvilinear effects, moderators such as task interdependence, or the presence
of a diversity mindset. With this paper, we argue that a dichotomous nature of
diversity is oversimplified. Indeed, it is a complex relationship where context
plays a pivotal role. A more nuanced understanding of diversity through the
lens of theories, such as the CEM, may lead to more effective teamwork.
