An empirical study of the use of friends in C++ software

Michael English, Jim Buckley, Tony Cahill, Kristian Lynch

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

A commonly held belief is that the friend construct in C++ is a violation of encapsulation. However, little empirical analysis of its use has taken place to provide evidence to support this claim. This paper presents a study which assesses the design implications of including friendship in a system. A number of hypotheses are investigated based on previous work in this area by Counsell and Newson, [4]. Our initial findings suggest that classes declared as friends are coupling hotspots, that the more friends a class has the more protected and private members it will contain and that friendship is not used to access inherited protected members.

Original languageEnglish
Title of host publicationProceedings - 13th International Workshop on Program Comprehension, IWPC 2005
EditorsJ.R. Cordy, H. Gall, J.I. Maletic
Pages329-332
Number of pages4
DOIs
Publication statusPublished - 2005
Event13th International Workshop on Program Comprehension, IWPC 2005 - St. Louis, MO, United States
Duration: 15 May 200516 May 2005

Publication series

NameProceedings - IEEE Workshop on Program Comprehension
ISSN (Print)1092-8138

Conference

Conference13th International Workshop on Program Comprehension, IWPC 2005
Country/TerritoryUnited States
CitySt. Louis, MO
Period15/05/0516/05/05

Fingerprint

Dive into the research topics of 'An empirical study of the use of friends in C++ software'. Together they form a unique fingerprint.

Cite this