Skip to main content

A Delta-Oriented Approach to Support the Safe Reuse of Black-Box Code Rewriters

  • Conference paper
  • First Online:
New Opportunities for Software Reuse (ICSR 2018)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10826))

Included in the following conference series:

Abstract

The tedious process of corrective and perfective maintenance is often automated thanks to rewriting rules using tools such as Spoon or Coccinelle. These tools consider rules as black-boxes, and compose multiple rules by giving the output of a given rewriting as input to the next one. It is up to the developer to identify the right order (if it exists) among all the different rules. In this paper, we define a formal model compatible with the black-box assumption that reifies the modifications (\(\varDelta \)s) made by each rule. Leveraging these \(\varDelta \)s, we propose a way to safely compose multiple rules when applied to the same program by (i) ensuring the isolated application of the different rules and (ii) yield unexpected behaviors that were silently ignored before. We assess this approach by applying rewriting rules used to fix anti-patterns existing in Android applications to external pieces of software available on GitHub.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://coccinelle.lip6.fr/impact_linux.php: (i) “kzalloc treewide” for \(R_k\) and (ii) “Fix size given to memset” for \(R_m\).

  2. 2.

    We use the classical definition of a setter, i.e., “a setter for a private attribute x is a method named setX, with a single parameter, and doing a single-line and type-compatible assignment from its parameter to x.

  3. 3.

    http://stackoverflow.com/a/4930538.

  4. 4.

    We do not formalize preconditions, as the tools silently return the given AST when they are not applicable.

  5. 5.

    We consider a function denoted as ;  that implements action sequence concatenation.

  6. 6.

    See the Praxis seminal paper [2] for a more comprehensive description of conflict detection in the general case.

  7. 7.

    https://github.com/ttben/ICSR-Implementation-validation.

  8. 8.

    https://github.com/pcqpcq/open-source-android-apps.

  9. 9.

    https://github.com/jonasoreland/runnerup.

References

  1. Bettini, L., Damiani, F., Schaefer, I.: Compositional type checking of delta-oriented software product lines. Acta Informatica 50(2), 77–122 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  2. Blanc, X., Mounier, I., Mougenot, A., Mens, T.: Detecting model inconsistency through operation-based model construction. In: Proceedings of the 30th International Conference on Software Engineering, ICSE 2008, pp. 511–520. ACM, New York (2008)

    Google Scholar 

  3. Douence, R., Fradet, P., Südholt, M.: Detection and resolution of aspect interactions. Research Report RR-4435, INRIA (2002)

    Google Scholar 

  4. Falleri, J.-R., Morandat, F., Blanc, X., Martinez, M., Monperrus, M.: Fine-grained and accurate source code differencing. In: ACM/IEEE International Conference on Automated Software Engineering, ASE 2014, Vasteras, Sweden, 15–19 September 2014, pp. 313–324 (2014)

    Google Scholar 

  5. Hecht, G., Rouvoy, R., Moha, N., Duchien, L.: Detecting antipatterns in Android apps. In: 2nd ACM International Conference on Mobile Software Engineering and Systems, MOBILESoft 2015, Florence, Italy, 16–17 May 2015, pp. 148–149 (2015)

    Google Scholar 

  6. Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., Irwin, J.: Aspect-oriented programming. In: Akşit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997). https://doi.org/10.1007/BFb0053381

    Chapter  Google Scholar 

  7. Klop, J.W., et al.: Term rewriting systems. In: Abramsky, S., Gabbay, D., Maibaurn, T. (eds.) Handbook of Logic in Computer Science, vol. 2, pp. 1–116. Oxford University Press, New York (1992)

    Google Scholar 

  8. Lientz, B.P., Swanson, E.B.: Software Maintenance Management. Addison-Wesley Longman Publishing Co., Inc., Boston (1980)

    Google Scholar 

  9. Lopes, N.P., Menendez, D., Nagarakatte, S., Regehr, J.: Provably correct peephole optimizations with alive. SIGPLAN Not. 50(6), 22–32 (2015)

    Article  Google Scholar 

  10. Lúcio, L., Amrani, M., Dingel, J., Lambers, L., Salay, R., Selim, G.M.K., Syriani, E., Wimmer, M.: Model transformation intents and their properties. Softw. Syst. Model. 15(3), 647–684 (2016)

    Article  Google Scholar 

  11. Mens, T., Taentzer, G., Runge, O.: Detecting structural refactoring conflicts using critical pair analysis. Electron. Notes Theor. Comput. Sci. 127(3), 113–128 (2005). Proceedings of the Workshop on Software Evolution Through Transformations: Model-Based vs. Implementation-Level Solutions (SETra 2004)

    Article  Google Scholar 

  12. Mosser, S., Blay-Fornarino, M., Duchien, L.: A commutative model composition operator to support software adaptation. In: Vallecillo, A., Tolvanen, J.-P., Kindler, E., Störrle, H., Kolovos, D. (eds.) ECMFA 2012. LNCS, vol. 7349, pp. 4–19. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-31491-9_3

    Chapter  Google Scholar 

  13. Padioleau, Y., Hansen, R.R., Lawall, J.L., Muller, G.: Semantic patches for documenting and automating collateral evolutions in Linux device drivers. In: Proceedings of the 3rd Workshop on Programming Languages and Operating Systems: Linguistic Support for Modern Operating Systems, PLOS 2006. ACM, New York (2006)

    Google Scholar 

  14. Pawlak, R., Monperrus, M., Petitprez, N., Noguera, C., Seinturier, L.: Spoon: a library for implementing analyses and transformations of Java source code. Softw. Pract. Exp. 46, 1155–1179 (2015)

    Article  Google Scholar 

  15. Redondo, J.M., Ortin, F.: A comprehensive evaluation of common Python implementations. IEEE Softw. 32(4), 76–84 (2015)

    Article  Google Scholar 

  16. Rodriguez, L.R., Lawall, J.: Increasing automation in the backporting of Linux drivers using Coccinelle. In: 11th European Dependable Computing Conference - Dependability in Practice, Paris, France, November 2015

    Google Scholar 

  17. Schaefer, I., Bettini, L., Bono, V., Damiani, F., Tanzarella, N.: Delta-oriented programming of software product lines. In: Bosch, J., Lee, J. (eds.) SPLC 2010. LNCS, vol. 6287, pp. 77–91. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-15579-6_6

    Chapter  Google Scholar 

  18. Syriani, E., Vangheluwe, H., Lashomb, B.: T-core: a framework for custom-built model transformation engines. Softw. Syst. Model. 14(3), 1215–1243 (2015)

    Article  Google Scholar 

  19. Tun, T.T., Yu, Y., Jackson, M., Laney, R., Nuseibeh, B.: Aspect interactions: a requirements engineering perspective. In: Moreira, A., Chitchyan, R., Araújo, J., Rashid, A. (eds.) Aspect-Oriented Requirements Engineering, pp. 271–286. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-38640-4_14

    Chapter  Google Scholar 

  20. Vlaanderen, K., Jansen, S., Brinkkemper, S., Jaspers, E.: The agile requirements refinery: applying SCRUM principles to software product management. Inf. Softw. Technol. 53(1), 58–70 (2011)

    Article  Google Scholar 

Download references

Acknowledgments

This work is partially funded by the M4S project (CNRS INS2I JCJC grant). The authors want to thanks Erick Gallesio for his help on kernel development; Geoffrey Hecht for his knowledge of Android optmizations; Mehdi Adel Ait Younes for having developed the initial versions of the Spoon processors and Mireille Blay-Fornarino and Philippe Collet for their feedbacks on this paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Benjamin Benni .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Benni, B., Mosser, S., Moha, N., Riveill, M. (2018). A Delta-Oriented Approach to Support the Safe Reuse of Black-Box Code Rewriters. In: Capilla, R., Gallina, B., Cetina, C. (eds) New Opportunities for Software Reuse. ICSR 2018. Lecture Notes in Computer Science(), vol 10826. Springer, Cham. https://doi.org/10.1007/978-3-319-90421-4_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-90421-4_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-90420-7

  • Online ISBN: 978-3-319-90421-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics