Logo image
ConcernBERT: Learning Responsibilities Using Class Membership
Journal article   Peer reviewed

ConcernBERT: Learning Responsibilities Using Class Membership

Jason Lefever, Jiahao Xu, Yuanfang Cai, Rick Kazman and Ernst Pisch
IEEE transactions on software engineering, pp 1-15
25 Jun 2026

Abstract

clustering methods Codes Conferences Distance measurement Large scale integration Measurement Modeling Programming representation learning Software design Testing Training Software Engineering
The principles of separation of concerns, high cohesion, and single responsibility are among the most well-known in software design. However, their application often remains philosophical rather than actionable, relying heavily on developers' intuition and experience. Many software tasks, such as god class decomposition, extract class refactoring, and cohesion measurement, depend on techniques for identifying cohesive groups of program entities, that is, entities that collectively fulfill a common responsibility. Yet reliably identifying such groups remains a challenge. In this paper, we propose ConcernBERT, a BERT-based embedding model trained at the entity level that uses triplet loss to directly optimize the relative positioning of methods and attributes in the embedding space, and uses class-membership context to learn responsibilities and concerns. We also contribute a large-scale replication dataset for training and evaluation. Our dataset spans over two million Java files across more than six thousand repositories. To evaluate ConcernBERT, we merge methods from two or more classes into unlabeled groups and test the model's ability to recover the original class memberships. ConcernBERT achieves significantly higher performance than existing models, demonstrating its effectiveness at encoding concern-level semantics and establishing a strong foundation for downstream tasks such as architecture recovery, extract class refactoring, and cohesion measurement.

Metrics

1 Record Views

Details

Logo image