Skip to main content
Erschienen in: Empirical Software Engineering 5/2014

01.10.2014

High-MCC Functions in the Linux Kernel

verfasst von: Ahmad Jbara, Adam Matan, Dror G. Feitelson

Erschienen in: Empirical Software Engineering | Ausgabe 5/2014

Einloggen

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

search-config
loading …

Abstract

McCabe’s Cyclomatic Complexity (MCC) is a widely used metric for the complexity of control flow. Common usage decrees that functions should not have an MCC above 50, and preferably much less. However, the Linux kernel includes more than 800 functions with MCC values above 50, and over the years 369 functions have had an MCC of 100 or more. Moreover, some of these functions undergo extensive evolution, indicating that developers are successful in coping with the supposed high complexity. Functions with similarly high MCC values also occur in other operating systems and domains, including Windows. For example, the highest MCC value in FreeBSD is 1316, double the highest MCC in Linux. We attempt to explain all this by analyzing the structure of high-MCC functions in Linux and showing that in many cases they are in fact well-structured (albeit we observe some cases where developers indeed refactor the code in order to reduce complexity). Moreover, human opinions do not correlate with the MCC values of these functions. A survey of perceived complexity shows that there are cases where high MCC functions were ranked as having a low complexity. We characterize these cases and identify specific code attributes such as the diversity of constructs (not only a switch but also ifs) and nesting that correlate with discrete increases in perceived complexity. These observations indicate that a high MCC is not necessarily an impediment to code comprehension, and support the notion that complexity cannot be fully captured using simple syntactic code metrics. In particular, we show that regularity in the code (meaning repetitions of the same pattern of control structures) correlates with low perceived complexity.

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!

Fußnoten
1
Graphs for all functions analyzed are available at www.​cs.​huji.​ac.​il/​~ahmadjbara/​hiMCC.​htm
 
2
In this and subsequent figures, we distinguish between development versions of Linux (1.1, 1.3, 2.1, 2.3, and 2.5), production versions (1.0, 1.2, 2.0, 2.2, and 2.4, shown as dashed lines), and the 2.6 series, which combined both types. These are identified only by their minor (third) number. The X axis is calendar years starting with the release of Linux in 1994.
 
3
This was chosen to enable them to respond to surprises. Thus if they see a function they think is “very complex” and give it a high mark, and later another that is even much more complex, they can still express this using a value beyond their previously used range.
 
Literatur
Zurück zum Zitat Adams B, De Meuter W, Tromp H, Hassan AE (2009) Can we refactor conditional compilation into aspects? In: 8th Intl. conf. aspect-oriented softw. dev., pp 243–254. doi:10.1145/1509239.1509274 Adams B, De Meuter W, Tromp H, Hassan AE (2009) Can we refactor conditional compilation into aspects? In: 8th Intl. conf. aspect-oriented softw. dev., pp 243–254. doi:10.​1145/​1509239.​1509274
Zurück zum Zitat Binkley AB, Schach SR (1998) Validation of the coupling dependency metric as a predictor of run-time failures and maintenance measures. In: 20th Intl. conf. softw. eng., pp 452–455. doi:10.1109/ICSE.1998.671604 Binkley AB, Schach SR (1998) Validation of the coupling dependency metric as a predictor of run-time failures and maintenance measures. In: 20th Intl. conf. softw. eng., pp 452–455. doi:10.​1109/​ICSE.​1998.​671604
Zurück zum Zitat Curtis B, Sappidi J, Subramanyam J (2011) An evaluation of the internal quality of business applications: does size matter? In: 33rd Intl. conf. softw. eng., pp 711–715. doi:10.1145/1985793.1985893 Curtis B, Sappidi J, Subramanyam J (2011) An evaluation of the internal quality of business applications: does size matter? In: 33rd Intl. conf. softw. eng., pp 711–715. doi:10.​1145/​1985793.​1985893
Zurück zum Zitat Curtis B, Sheppard SB, Milliman P (1979) Third time charm: stronger prediction of programmer performance by software complexity metrics. In: 4th Intl. conf. softw. eng., pp 356–360 Curtis B, Sheppard SB, Milliman P (1979) Third time charm: stronger prediction of programmer performance by software complexity metrics. In: 4th Intl. conf. softw. eng., pp 356–360
Zurück zum Zitat Heitlager I, Kuipers T, Visser J (2007) A practical model for measuring maintainability. In: 6th Intl. conf. quality inf. & comm. tech., pp 30–39. doi:10.1109/QUATIC.2007.8 Heitlager I, Kuipers T, Visser J (2007) A practical model for measuring maintainability. In: 6th Intl. conf. quality inf. & comm. tech., pp 30–39. doi:10.​1109/​QUATIC.​2007.​8
Zurück zum Zitat Herraiz I, Hassan AE (2011) Beyond lines of code: do we need more complexity metrics? In: Oram A, Wilson G (eds) Making software: what really works, and why we believe it. O’Reilly Media Inc., pp 125–141 Herraiz I, Hassan AE (2011) Beyond lines of code: do we need more complexity metrics? In: Oram A, Wilson G (eds) Making software: what really works, and why we believe it. O’Reilly Media Inc., pp 125–141
Zurück zum Zitat Hindle A, Godfrey MW, Holt RC (2008) Reading beside the lines: indentation as a proxy for complexity metrics. In: 16th IEEE Intl. conf. program comprehension, pp 133–142. doi:10.1109/ICPC.2008.13 Hindle A, Godfrey MW, Holt RC (2008) Reading beside the lines: indentation as a proxy for complexity metrics. In: 16th IEEE Intl. conf. program comprehension, pp 133–142. doi:10.​1109/​ICPC.​2008.​13
Zurück zum Zitat Jbara A, Feitelson DG 2013 Characterization and assessment of the Linux configuration complexity. In: 13th IEEE Intl. working conf source code analysis & manipulation Jbara A, Feitelson DG 2013 Characterization and assessment of the Linux configuration complexity. In: 13th IEEE Intl. working conf source code analysis & manipulation
Zurück zum Zitat Koziolek H, Schlich B, Bilich C (2010) A large-scale industrial case study on architecture-based software reliability analysis. In: 21st Intl. symp. software reliability eng., pp 279–288. doi:10.1109/ISSRE.2010.15 Koziolek H, Schlich B, Bilich C (2010) A large-scale industrial case study on architecture-based software reliability analysis. In: 21st Intl. symp. software reliability eng., pp 279–288. doi:10.​1109/​ISSRE.​2010.​15
Zurück zum Zitat Liebig J, Apel S, Lengauer C, Kästner C, Schulze M (2010) An analysis of the variability in forty preprocessor-based software product lines. In: 32nd Intl. conf. softw. eng., vol 1, pp 105–114. doi:10.1145/1806799.1806819 Liebig J, Apel S, Lengauer C, Kästner C, Schulze M (2010) An analysis of the variability in forty preprocessor-based software product lines. In: 32nd Intl. conf. softw. eng., vol 1, pp 105–114. doi:10.​1145/​1806799.​1806819
Zurück zum Zitat Olague HM, Etzkorn LH, Gholston S, Quattlebaum S (2007) Empirical validation of three software metrics suites to predict fault-proneness of object-oriented classes developed using highly iterative or agile software development processes. IEEE Trans Softw Eng 33(6):402–419. doi:10.1109/TSE.2007.1015 CrossRef Olague HM, Etzkorn LH, Gholston S, Quattlebaum S (2007) Empirical validation of three software metrics suites to predict fault-proneness of object-oriented classes developed using highly iterative or agile software development processes. IEEE Trans Softw Eng 33(6):402–419. doi:10.​1109/​TSE.​2007.​1015 CrossRef
Zurück zum Zitat Soetens QD, Demeyer S (2010) Studying the effect of refactorings: a complexity metrics perspective. In: 7th Intl. conf. quality inf. & comm. tech., pp 313–318. doi:10.1109/QUATIC.2010.58 Soetens QD, Demeyer S (2010) Studying the effect of refactorings: a complexity metrics perspective. In: 7th Intl. conf. quality inf. & comm. tech., pp 313–318. doi:10.​1109/​QUATIC.​2010.​58
Zurück zum Zitat Vasa R, Lumpe M, Branch P, Nierstrasz O (2009) Comparative analysis of evolving software systems using the Gini coefficient. In: 25th Intl. conf. softw. maintenance, pp 179–188. doi:10.1109/ICSM.2009.5306322 Vasa R, Lumpe M, Branch P, Nierstrasz O (2009) Comparative analysis of evolving software systems using the Gini coefficient. In: 25th Intl. conf. softw. maintenance, pp 179–188. doi:10.​1109/​ICSM.​2009.​5306322
Metadaten
Titel
High-MCC Functions in the Linux Kernel
verfasst von
Ahmad Jbara
Adam Matan
Dror G. Feitelson
Publikationsdatum
01.10.2014
Verlag
Springer US
Erschienen in
Empirical Software Engineering / Ausgabe 5/2014
Print ISSN: 1382-3256
Elektronische ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-013-9275-7

Weitere Artikel der Ausgabe 5/2014

Empirical Software Engineering 5/2014 Zur Ausgabe

Premium Partner