Skip to main content
Erschienen in: Empirical Software Engineering 4/2019

22.11.2018

An investigation of misunderstanding code patterns in C open-source software projects

verfasst von: Flávio Medeiros, Gabriel Lima, Guilherme Amaral, Sven Apel, Christian Kästner, Márcio Ribeiro, Rohit Gheyi

Erschienen in: Empirical Software Engineering | Ausgabe 4/2019

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Maintenance consumes 40% to 80% of software development costs. So, it is essential to write source code that is easy to understand to reduce the costs with maintenance. Improving code understanding is important because developers often mistake the meaning of code, and misjudge the program behavior, which can lead to errors. There are patterns in source code, such as operator precedence, and comma operator, that have been shown to influence code understanding negatively. Despite initial results, these patterns have not been evaluated in a real-world setting, though. Thus, it is not clear whether developers agree that the patterns studied by researchers can cause substantial misunderstandings in real-world practice. To better understand the relevance of misunderstanding patterns, we applied a mixed research method approach, by performing repository mining and a survey with developers, to evaluate misunderstanding patterns in 50 C open-source projects, including Apache, OpenSSL, and Python. Overall, we found more than 109K occurrences of the 12 patterns in practice. Our study shows that according to developers only some patterns considered previously by researchers may cause misunderstandings. Our results complement previous studies by taking the perception of developers into account.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Anhänge
Nur mit Berechtigung zugänglich
Literatur
Zurück zum Zitat Baxter ID (1992) Design maintenance systems. Commun ACM 35(4):73–89CrossRef Baxter ID (1992) Design maintenance systems. Commun ACM 35(4):73–89CrossRef
Zurück zum Zitat Baxter I, Mehlich M (2001) Preprocessor conditional removal by simple partial evaluation. In: Proceedings of the working conference on reverse engineering, IEEE, WCRE, pp 281–290 Baxter I, Mehlich M (2001) Preprocessor conditional removal by simple partial evaluation. In: Proceedings of the working conference on reverse engineering, IEEE, WCRE, pp 281–290
Zurück zum Zitat Beller M, Bacchelli A, Zaidman A, Juergens E (2014) Modern code reviews in open-source projects: which problems do they fix? In: Proceedings of the working conference on mining software repositories. ACM, pp 202–211 Beller M, Bacchelli A, Zaidman A, Juergens E (2014) Modern code reviews in open-source projects: which problems do they fix? In: Proceedings of the working conference on mining software repositories. ACM, pp 202–211
Zurück zum Zitat Bland M (2014) Finding more than one worm in the apple. Commun ACM 57 (7):58–64CrossRef Bland M (2014) Finding more than one worm in the apple. Commun ACM 57 (7):58–64CrossRef
Zurück zum Zitat Burke D (1995) All Circuits are Busy Now: The 1990 AT&T Long Distance Network Collapse. California Polytechnic State University Burke D (1995) All Circuits are Busy Now: The 1990 AT&T Long Distance Network Collapse. California Polytechnic State University
Zurück zum Zitat Buse RP, Weimer WR (2008) A metric for software readability. In: Proceedings of the international symposium on software testing and analysis. ACM, pp 121–130 Buse RP, Weimer WR (2008) A metric for software readability. In: Proceedings of the international symposium on software testing and analysis. ACM, pp 121–130
Zurück zum Zitat Cannon LW, Elliott RA, Kirchhoff LW, Miller JH, Milner JM, Mitze RW, Schan EP, Whittington NO, Spencer H, Brader M, Cannon LW, Elliott RA, Kirchhoff LW, Miller JH, Milner JM, Mitze RW, Schan EP, Whittington NO, Spencer H, Brader M (2000) Recommended C style and coding standards Cannon LW, Elliott RA, Kirchhoff LW, Miller JH, Milner JM, Mitze RW, Schan EP, Whittington NO, Spencer H, Brader M, Cannon LW, Elliott RA, Kirchhoff LW, Miller JH, Milner JM, Mitze RW, Schan EP, Whittington NO, Spencer H, Brader M (2000) Recommended C style and coding standards
Zurück zum Zitat Collberg C, Thomborson C, Low D (1997) A taxonomy of obfuscating transformations. Technical Report 148, Department of Computer Science. University of Auckland Collberg C, Thomborson C, Low D (1997) A taxonomy of obfuscating transformations. Technical Report 148, Department of Computer Science. University of Auckland
Zurück zum Zitat Creswell JW, Clark VLP (2011) Designing and Conducting Mixed Methods Research. SAGE Publications, Thousand Oaks Creswell JW, Clark VLP (2011) Designing and Conducting Mixed Methods Research. SAGE Publications, Thousand Oaks
Zurück zum Zitat Dowson M (1997) The Ariane 5 software failure. SIGSOFT Softw Eng Notes 22 (2):84–93CrossRef Dowson M (1997) The Ariane 5 software failure. SIGSOFT Softw Eng Notes 22 (2):84–93CrossRef
Zurück zum Zitat Easterbrook S, Singer J, Storey MA, Damian D (2008) Selecting empirical methods for software engineering research. Springer, Berlin, pp 285–311 Easterbrook S, Singer J, Storey MA, Damian D (2008) Selecting empirical methods for software engineering research. Springer, Berlin, pp 285–311
Zurück zum Zitat Ernst M, Badros G, Notkin D (2002) An empirical analysis of C, preprocessor use. IEEE Trans Softw Eng 28(12):1146–1170CrossRef Ernst M, Badros G, Notkin D (2002) An empirical analysis of C, preprocessor use. IEEE Trans Softw Eng 28(12):1146–1170CrossRef
Zurück zum Zitat Feigenspan J, Kästner C, Apel S, Liebig J, Schulze M, Dachselt R, Papendieck M, Leich T, Saake G (2013) Do background colors improve program comprehension in the #ifdef hell? Empir Softw Eng 18(4):699–745CrossRef Feigenspan J, Kästner C, Apel S, Liebig J, Schulze M, Dachselt R, Papendieck M, Leich T, Saake G (2013) Do background colors improve program comprehension in the #ifdef hell? Empir Softw Eng 18(4):699–745CrossRef
Zurück zum Zitat Fowler M, Beck K, Brant J, Opdyke W, Roberts D, Gamma E (1999) Refactoring: Improving the Design of Existing Code. Addison-Wesley, Reading Fowler M, Beck K, Brant J, Opdyke W, Roberts D, Gamma E (1999) Refactoring: Improving the Design of Existing Code. Addison-Wesley, Reading
Zurück zum Zitat Gamma E, Helm R, Johnson R, Vlissides J (1995) Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley, ReadingMATH Gamma E, Helm R, Johnson R, Vlissides J (1995) Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley, ReadingMATH
Zurück zum Zitat Garrido A, Johnson R (2003) Refactoring C with conditional compilation. In: Proceedings of the IEEE international conference on automated software engineering. IEEE, pp 323–326 Garrido A, Johnson R (2003) Refactoring C with conditional compilation. In: Proceedings of the IEEE international conference on automated software engineering. IEEE, pp 323–326
Zurück zum Zitat Glass RL (2001) Frequently forgotten fundamental facts about software engineering. IEEE Softw 18(3):112–111CrossRef Glass RL (2001) Frequently forgotten fundamental facts about software engineering. IEEE Softw 18(3):112–111CrossRef
Zurück zum Zitat Gopstein D, Iannacone J, Yan Y, DeLong L, Zhuang Y, Yeh MKC, Cappos J (2017) Understanding misunderstandings in source code. In: Proceedings of the 2017 11th joint meeting on foundations of software engineering. ACM, ESEC/FSE 2017, pp 129-139 Gopstein D, Iannacone J, Yan Y, DeLong L, Zhuang Y, Yeh MKC, Cappos J (2017) Understanding misunderstandings in source code. In: Proceedings of the 2017 11th joint meeting on foundations of software engineering. ACM, ESEC/FSE 2017, pp 129-139
Zurück zum Zitat Gousios G (2013) The GHTorent dataset and tool suite. In: Proceedings of the working conference on mining software repositories. IEEE Press, pp 233–236 Gousios G (2013) The GHTorent dataset and tool suite. In: Proceedings of the working conference on mining software repositories. IEEE Press, pp 233–236
Zurück zum Zitat Gopstein D, Zhou H, Frankl P, Cappos J (2018) Prevalence of confusing code in software projects: atoms of confusion in the wild. In: Proceedings of the working conference on mining software repositories. ACM Gopstein D, Zhou H, Frankl P, Cappos J (2018) Prevalence of confusing code in software projects: atoms of confusion in the wild. In: Proceedings of the working conference on mining software repositories. ACM
Zurück zum Zitat Herzberg A, Pinter SS (1987) Public protection of software. ACM Trans Comput Syst 5(4):371–393CrossRef Herzberg A, Pinter SS (1987) Public protection of software. ACM Trans Comput Syst 5(4):371–393CrossRef
Zurück zum Zitat ISO/IEC/IEEE (2006) Iso/iec/ieee international standard for software engineering - software life cycle processes - maintenance. Std 14764-2006, pp 1–58 ISO/IEC/IEEE (2006) Iso/iec/ieee international standard for software engineering - software life cycle processes - maintenance. Std 14764-2006, pp 1–58
Zurück zum Zitat Jha MM, Vilardell RMF, Narayan J (2016) Scaling agile scrum software development: providing agility and quality to platform development by reducing time to market. In: 2016 IEEE 11th international conference on global software engineering (ICGSE), pp 84–88 Jha MM, Vilardell RMF, Narayan J (2016) Scaling agile scrum software development: providing agility and quality to platform development by reducing time to market. In: 2016 IEEE 11th international conference on global software engineering (ICGSE), pp 84–88
Zurück zum Zitat Kästner C, Giarrusso P, Rendel T, Erdweg S, Ostermann K, Berger T (2011) Variability-aware parsing in the presence of lexical macros and conditional compilation. In: Proceedings of the object-oriented programming systems languages and applications, ACM, pp 805–824 Kästner C, Giarrusso P, Rendel T, Erdweg S, Ostermann K, Berger T (2011) Variability-aware parsing in the presence of lexical macros and conditional compilation. In: Proceedings of the object-oriented programming systems languages and applications, ACM, pp 805–824
Zurück zum Zitat Kernighan BW, Pike R (1999) The Practice of Programming. Addison-Wesley, Reading Kernighan BW, Pike R (1999) The Practice of Programming. Addison-Wesley, Reading
Zurück zum Zitat Liebig J, Kästner C, Apel S (2011) Analyzing the discipline of preprocessor annotations in 30 million lines of C code. In: Proceedings of the international conference on aspect-oriented software development. ACM, pp 191–202 Liebig J, Kästner C, Apel S (2011) Analyzing the discipline of preprocessor annotations in 30 million lines of C code. In: Proceedings of the international conference on aspect-oriented software development. ACM, pp 191–202
Zurück zum Zitat Lohmann D, Scheler F, Tartler R, Spinczyk O, Schröder-Preikschat W (2006) A quantitative analysis of aspects in the eCos kernel. In: Proceedings of the European conference on computer systems. ACM, pp 191–204 Lohmann D, Scheler F, Tartler R, Spinczyk O, Schröder-Preikschat W (2006) A quantitative analysis of aspects in the eCos kernel. In: Proceedings of the European conference on computer systems. ACM, pp 191–204
Zurück zum Zitat Malaquias R, Ribeiro M, Bonifácio R, Monteiro E, Medeiros F, Garcia A, Gheyi R (2017) The discipline of preprocessor-based annotations does #ifdef TAG N’T #endif matter. In: Proceedings of the international conference on program comprehension. IEEE Press, pp 297–307 Malaquias R, Ribeiro M, Bonifácio R, Monteiro E, Medeiros F, Garcia A, Gheyi R (2017) The discipline of preprocessor-based annotations does #ifdef TAG N’T #endif matter. In: Proceedings of the international conference on program comprehension. IEEE Press, pp 297–307
Zurück zum Zitat Marshall L, Webber J (2000) Gotos considered harmful and other programmers taboos. In: Proceedings of the workshop of the psychology of programming interest group. PPIG, pp 171–180 Marshall L, Webber J (2000) Gotos considered harmful and other programmers taboos. In: Proceedings of the workshop of the psychology of programming interest group. PPIG, pp 171–180
Zurück zum Zitat Medeiros F, Ribeiro M, Gheyi R (2013) Investigating preprocessor-based syntax errors. In: Proceedings of the international conference on generative programming, concepts & experiences. ACM, pp 75–84 Medeiros F, Ribeiro M, Gheyi R (2013) Investigating preprocessor-based syntax errors. In: Proceedings of the international conference on generative programming, concepts & experiences. ACM, pp 75–84
Zurück zum Zitat Medeiros F, Kästner C, Ribeiro M, Nadi S, Gheyi R (2015a) The Love/Hate Relationship with the C Preprocessor: An Interview Study. In: European conference on object-oriented programming (ECOOP), Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Leibniz International Proceedings in Informatics (LIPIcs), vol 37, pp 495–518 Medeiros F, Kästner C, Ribeiro M, Nadi S, Gheyi R (2015a) The Love/Hate Relationship with the C Preprocessor: An Interview Study. In: European conference on object-oriented programming (ECOOP), Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Leibniz International Proceedings in Informatics (LIPIcs), vol 37, pp 495–518
Zurück zum Zitat Medeiros F, Rodrigues I, Ribeiro M, Teixeira L, Gheyi R (2015b) An empirical study on configuration-related issues: Investigating undeclared and unused identifiers. In: Proceedings of the ACM SIGPLAN international conference on generative programming, concepts and experiences. ACM, pp 35-44 Medeiros F, Rodrigues I, Ribeiro M, Teixeira L, Gheyi R (2015b) An empirical study on configuration-related issues: Investigating undeclared and unused identifiers. In: Proceedings of the ACM SIGPLAN international conference on generative programming, concepts and experiences. ACM, pp 35-44
Zurück zum Zitat Medeiros F, Kästner C, Ribeiro M, Gheyi R, Apel S (2016) A comparison of 10 sampling algorithms for configurable systems. In: Proceedings of the international conference on software engineering. ACM, pp 643–654 Medeiros F, Kästner C, Ribeiro M, Gheyi R, Apel S (2016) A comparison of 10 sampling algorithms for configurable systems. In: Proceedings of the international conference on software engineering. ACM, pp 643–654
Zurück zum Zitat Medeiros F, Ribeiro M, Gheyi R, Apel S, Kastner C, Ferreira B, Carvalho L, Fonseca B (2018a) Discipline matters: refactoring of preprocessor directives in the #ifdef hell, vol 44 Medeiros F, Ribeiro M, Gheyi R, Apel S, Kastner C, Ferreira B, Carvalho L, Fonseca B (2018a) Discipline matters: refactoring of preprocessor directives in the #ifdef hell, vol 44
Zurück zum Zitat Nagappan M, Robbes R, Kamei Y, Tanter E, McIntosh S, Mockus A, Hassan AE (2015) An empirical study of goto in C code from GitHub repositories. In: Proceedings of the joint meeting on foundations of software engineering. ACM, NY, pp 404–414 Nagappan M, Robbes R, Kamei Y, Tanter E, McIntosh S, Mockus A, Hassan AE (2015) An empirical study of goto in C code from GitHub repositories. In: Proceedings of the joint meeting on foundations of software engineering. ACM, NY, pp 404–414
Zurück zum Zitat Padioleau Y (2009) Parsing C/C++ code without pre-processing. In: Proceedings of the international conference on compiler construction. Springer, pp 109–125 Padioleau Y (2009) Parsing C/C++ code without pre-processing. In: Proceedings of the international conference on compiler construction. Springer, pp 109–125
Zurück zum Zitat Pahal A, Chillar RS (2017) Code readability: a review of metrics for software quality. Int J Comput Trends Technol 46(1):1–58CrossRef Pahal A, Chillar RS (2017) Code readability: a review of metrics for software quality. Int J Comput Trends Technol 46(1):1–58CrossRef
Zurück zum Zitat Rigby PC, German DM, Storey MA (2008) Open source software peer review practices: a case study of the Apache server. In: Proceedings of the international conference on software engineering. ACM, pp 541–550 Rigby PC, German DM, Storey MA (2008) Open source software peer review practices: a case study of the Apache server. In: Proceedings of the international conference on software engineering. ACM, pp 541–550
Zurück zum Zitat Schulze S, Liebig J, Siegmund J, Apel S (2013) Does the discipline of preprocessor annotations matter? a controlled experiment. In: Proceedings of the international conference on generative programming, concepts and experiences. ACM, pp 65–74 Schulze S, Liebig J, Siegmund J, Apel S (2013) Does the discipline of preprocessor annotations matter? a controlled experiment. In: Proceedings of the international conference on generative programming, concepts and experiences. ACM, pp 65–74
Zurück zum Zitat Scott ML (2000) Programming language pragmatics. Morgan Kaufmann Publishers Inc., San FranciscoMATH Scott ML (2000) Programming language pragmatics. Morgan Kaufmann Publishers Inc., San FranciscoMATH
Zurück zum Zitat Spencer H, Collyer G (1992) #ifdef considered harmful, or portability experience with C News. In: USENIX summer technical conference, pp 185–197 Spencer H, Collyer G (1992) #ifdef considered harmful, or portability experience with C News. In: USENIX summer technical conference, pp 185–197
Zurück zum Zitat Stamelos I, Angelis L, Oikonomou A, Bleris GL (2002) Code quality analysis in open source software development. Inf Syst J 12(1):43–60CrossRef Stamelos I, Angelis L, Oikonomou A, Bleris GL (2002) Code quality analysis in open source software development. Inf Syst J 12(1):43–60CrossRef
Zurück zum Zitat Wulf W, Shaw M (1973) Global variable considered harmful. SIGPLAN Not 8(2):28–34CrossRef Wulf W, Shaw M (1973) Global variable considered harmful. SIGPLAN Not 8(2):28–34CrossRef
Metadaten
Titel
An investigation of misunderstanding code patterns in C open-source software projects
verfasst von
Flávio Medeiros
Gabriel Lima
Guilherme Amaral
Sven Apel
Christian Kästner
Márcio Ribeiro
Rohit Gheyi
Publikationsdatum
22.11.2018
Verlag
Springer US
Erschienen in
Empirical Software Engineering / Ausgabe 4/2019
Print ISSN: 1382-3256
Elektronische ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-018-9666-x

Weitere Artikel der Ausgabe 4/2019

Empirical Software Engineering 4/2019 Zur Ausgabe

Premium Partner