skip to main content
10.1145/2889160.2891036acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
demonstration

Safely evolving preprocessor-based configurable systems

Published:14 May 2016Publication History

ABSTRACT

Since the 70s, the C preprocessor is still widely used in practice in a numbers of projects, including Apache, Linux, and Libssh, to tailor systems to different platforms. To better understand the C preprocessor challenges, we conducted 40 interviews and a survey among 202 developers. We found that developers deal with three common problems: configuration-related bugs, combinatorial testing, and code comprehension. To safely evolve preprocessor-based configurable systems, we proposed strategies to detect preprocessor-related bugs and bad smells, and a set of 16 refactorings to remove bad smells. To better deal with exponential configuration spaces, we compared 10 sampling algorithms with respect to effort (i.e., number of configurations to test) and bug-detection capabilities (i.e., number of bugs detected in the sampled configurations). Based on the results, we proposed a sampling algorithm with a useful balance between effort and bug-detection capability. By evaluating the proposed solution using 40 popular projects, we found 131 preprocessor-related bugs and more than 5K opportunities to apply the refactorings in practice.

References

  1. I. Abal, C. Brabrand, and A. Wasowski. 42 variability bugs in the Linux kernel: A qualitative analysis. In Proceedings of the International Conference on Automated Software Engineering. IEEE/ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. B. Adams, K. De Schutter, H. Tromp, and W. De Meuter. The evolution of the Linux build system. Electronic Communications of the European Association for the Study of Science and Technology, 2008.Google ScholarGoogle Scholar
  3. M. Anastasopoules and C. Gacek. Implementing product line variabilities. In Proceedings of the Symposium on Software Reusability, SSR. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. I. Baxter and M. Mehlich. Preprocessor conditional removal by simple partial evaluation. In Proceedings of the Working Conference on Reverse Engineering. IEEE Computer Society, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Ernst, G. Badros, and D. Notkin. An empirical analysis of C preprocessor use. IEEE Transactions on Software Engineering, 28(12), 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J.-M. Favre. Understanding-in-the-large. In Proceedings of the International Workshop on Program Comprehension, IWPC, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Garrido and R. Johnson. Analyzing multiple configurations of a C program. In Proceedings of the International Conference on Software Maintenance. IEEE, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Garrido and R. E. Johnson. Embracing the c preprocessor during refactoring. Journal of Software: Evolution and Process, 25(12), 2013.Google ScholarGoogle ScholarCross RefCross Ref
  9. Y. Hu, E. Merlo, M. Dagenais, and B. Laguë. C/C++ conditional compilation analysis using symbolic execution. In Proceeding of the International Conference on Software Maintenance, ICSM. IEEE, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Kästner, S. Apel, and M. Kuhlemann. A model of refactoring physically and virtually separated features. In Proceedings of the Conference on Generative Programming and Component Engineering. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Kästner, P. Giarrusso, T. Rendel, S. Erdweg, K. Ostermann, and T. Berger. Variability-aware parsing in the presence of lexical macros and conditional compilation. In Proceedings of the Object-Oriented Programming Systems Languages and Applications. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Krone and G. Snelting. On the inference of configuration structures from source code. In Proceedings of the International Conference on Software Engineering, ICSE. IEEE, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Liebig, C. Kästner, and S. Apel. Analyzing the discipline of preprocessor annotations in 30 million lines of C code. In Proceedings of the Aspect-Oriented Software Development. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Lohmann, F. Scheler, R. Tartler, O. Spinczyk, and W. Schröder-Preikschat. A quantitative analysis of aspects in the eCos kernel. In ACM European Conference on Computer Systems (EuroSys). ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. B. McCloskey and E. Brewer. Astec: A new approach to refactoring C. In Proceedings of the European Software Engineering Conference and International Symposium on Foundations of Software Engineering, ESEC/FSE. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. F. Medeiros, C. Kästner, M. Ribeiro, R. Gheyi, and S. Apel. A comparison of 10 sampling algorithms for configurable systems. In Proceedings of Inter. Conf. on Software Engineering, ICSE, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. F. Medeiros, C. Kästner, M. Ribeiro, S. Nadi, and R. Gheyi. The love/hate relationship with the C preprocessor: An interview study. In Proceedings of the European Conf. on Object-Oriented Prog. ACM, 2015.Google ScholarGoogle Scholar
  18. F. Medeiros, M. Ribeiro, and R. Gheyi. Investigating preprocessor-based syntax errors. In Proceedings of the Inter. Conf. on Generative Programming: Concepts & Experiences. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. F. Medeiros, M. Ribeiro, R. Gheyi, and B. Fonseca. A catalogue of refactorings to remove incomplete annotations. Journal of Universal Computer Science, 2014.Google ScholarGoogle Scholar
  20. F. Medeiros, I. Rodrigues, M. Ribeiro, L. Teixeira, and R. Gheyi. An empirical study on configuration-related issues: Investigating undeclared and unused identifiers. In Proceedings of the Inter. Conf. on Generative Programming: Concepts & Experiences. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. T. T. Pearse and P. W. Oman. Experiences developing and maintaining software in a multi-platform env. In Proceedings of the International Conference on Software Maintenance, ICSM. IEEE, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. Schulze, J. Liebig, J. Siegmund, and S. Apel. Does the discipline of preprocessor annotations matter?: a controlled experiment. In Proceedings of the International Conference on Generative Programming: Concepts & Experiences, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. Singh, C. Gibbs, and Y. Coady. C-CLR: A tool for navigating highly configurable system software. In Proceedings of the AOSD Workshop on Aspects, Components, and Patterns for Infrastructure Software, ACP4IS. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. H. Spencer and G. Collyer. Ifdef considered harmful, or portability experience with C news. In USENIX Annual Technical Conference, 1992.Google ScholarGoogle Scholar
  25. R. Tartler, C. Dietrich, J. Sincero, W. Schröder-Preikschat, and D. Lohmann. Static analysis of variability in system software: The 90,000 #ifdefs issue. In USENIX Annual Technical Conference, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. S. Trujillo, D. Batory, and O. Diaz. Feature refactoring a multi-representation program into a product line. In International conference on Generative programming and component engineering. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Vittek. Refactoring browser with preprocessor. In European Conference on Software Maintenance and Reengineering (CSMR). IEEE, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Conferences
    ICSE '16: Proceedings of the 38th International Conference on Software Engineering Companion
    May 2016
    946 pages
    ISBN:9781450342056
    DOI:10.1145/2889160

    Copyright © 2016 Owner/Author

    Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the Owner/Author.

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 14 May 2016

    Check for updates

    Qualifiers

    • demonstration

    Acceptance Rates

    Overall Acceptance Rate276of1,856submissions,15%

    Upcoming Conference

    ICSE 2025

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader