Skip to main content

A Formal Study of Backward Compatible Dynamic Software Updates

  • Conference paper
  • First Online:
Software Engineering and Formal Methods (SEFM 2015)

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

Included in the following conference series:

Abstract

We study the dynamic software update problem for programs interacting with an environment that is not necessarily updated. We argue that such updates should be backward compatible. We propose a general definition of backward compatibility and cases of backward compatible program update. Based on our detailed study of real world program evolution, we propose classes of backward compatible update for interactive programs, which are included at an average of 32 % of all studied program changes. The definitions of update classes are parameterized by our novel framework of program equivalence, which generalizes existing results on program equivalence to non-terminating executions. Our study of backward compatible updates is based on a typed extension of W language.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. http://en.wikipedia.org/wiki/Vsftpd. Accessed 15 January 2015

  2. http://www.openssh.com/users.html. Accessed 15 January 2015

  3. Software life cycle processes - maintenance. Technical report. ISO/IEC 14764:2006(E)

    Google Scholar 

  4. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: principles, techniques, and tools

    Google Scholar 

  5. Arnold, J., Kaashoek, M.F.: KSplice: automatic rebootless kernel updates

    Google Scholar 

  6. Benton, N.: Simple relational correctness proofs for static analyses and program transformations (2004)

    Google Scholar 

  7. Binkley, D., Horwitz, S., Reps, T.: The multi-procedure equivalence theorem (1989)

    Google Scholar 

  8. Bloom, T., Day, M.: Reconfiguration and module replacement in argus: theory and practice (1993)

    Google Scholar 

  9. Cartwright, R., Felleisen, M.: The semantics of program dependence (1989)

    Google Scholar 

  10. Godlin, B., Strichman, O.: Inference rules for proving the equivalence of recursive procedures (2008)

    Google Scholar 

  11. Gordon, A.D.: Functional programming and input/output (1994)

    Google Scholar 

  12. Hayden, C.M., Magill, S., Hicks, M., Foster, N., Foster, J.S.: Specifying and verifying the correctness of dynamic software updates. In: Joshi, R., Müller, P., Podelski, A. (eds.) VSTTE 2012. LNCS, vol. 7152, pp. 278–293. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  13. Hayden, C.M., Smith, E.K., Denchev, M., Hicks, M., Foster, J.S.: Kitsune: efficient, general-purpose dynamic software updating for C. In: Proceedings of the ACM Conference on Object-Oriented Programming Languages, Systems, and Applications (OOPSLA), October 2012

    Google Scholar 

  14. Hicks, M.: Dynamic software updating. Ph.D. thesis, August 2001

    Google Scholar 

  15. Horwitz, S., Prins, J., Reps, T.: On the adequacy of program dependence graphs for representing programs. In: POPL 1988, pp. 146–157. ACM (1988)

    Google Scholar 

  16. Karfa, C., Banerjee, K., Sarkar, D., Mandal, C.: Verification of loop and arithmetic transformations of array-intensive behaviors (2013)

    Google Scholar 

  17. Kramer, J., Magee, J.: The evolving philosophers problem: dynamic change management (1990)

    Google Scholar 

  18. Kundu, S., Tatlock, Z., Lerner, S.: Proving optimizations correct using parameterized program equivalence. SIGPLAN Not. 44(6), 327–337 (2009)

    Article  Google Scholar 

  19. Lacey, D., Jones, N.D., Van Wyk, E., Frederiksen, C.C.: Proving correctness of compiler optimizations by temporal logic. SIGPLAN Not. 37(1), 283–294 (2002)

    Article  Google Scholar 

  20. Lee, Y.F., Chang, R.C.: Hotswapping linux kernel modules. J. Syst. Softw. 79(2), 163–175 (2006)

    Article  Google Scholar 

  21. Lucanu, D., Rusu, V.: Program equivalence by circular reasoning. In: Johnsen, E.B., Petre, L. (eds.) IFM 2013. LNCS, vol. 7940, pp. 362–377. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  22. Magill, S., Hicks, M., Subramanian, S., McKinley, K.S.: Automating object transformations for dynamic software updating. SIGPLAN Not. 47(10), 265–280 (2012)

    Article  Google Scholar 

  23. Makris, K.: Whole-program dynamic software updating. Ph.D. thesis

    Google Scholar 

  24. Makris, K., Bazzi, R.A.: Immediate multi-threaded dynamic software updates using stack reconstruction

    Google Scholar 

  25. Miller, B.P., Fredriksen, L., So, B.: An empirical study of the reliability of unix utilities. ACM

    Google Scholar 

  26. Neamtiu, I.: Practical dynamic software updating. Ph.D. thesis, August 2008

    Google Scholar 

  27. Panzica La Manna, V., Greenyer, J., Ghezi, C., Brener, C.: Formalizing correctness criteria of dynamic updates derived from specification changes. In: EAMS 2013

    Google Scholar 

  28. Parnas, D.L.: Software aging. In: ICSE 1994. IEEE Computer Society Press

    Google Scholar 

  29. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    Google Scholar 

  30. Rohl, J.S.: Eliminating recursion from combinatoric procedures (1981)

    Google Scholar 

  31. Shen, J., Bazzi, R.A.: A formal study of backward compatible dynamic software updates. CoRR http://arxiv.org/abs/1503.07235

  32. Verdoolaege, S., Janssens, G., Bruynooghe, M.: Equivalence checking of static affine programs using widening to handle recurrences. ACM Trans. Program. Lang. Syst

    Google Scholar 

  33. Winskel, G.: The Formal Semantics of Programming Languages: An Introduction. MIT Press, Cambridge (1993)

    MATH  Google Scholar 

  34. Zhang, M., Ogata, K., Futatsugi, K.: Formalization and verification of behavioral correctness of dynamic software updates. Electron. Notes Theor. Comput. Sci. 294, 12–23 (2013)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jun Shen .

Editor information

Editors and Affiliations

Appendices

Proof Rule for Behavioral Equivalence

We show the formal proof rule for behavioral equivalence. The output sequence produced in executions of a statement sequence S depends on values of a set of variables in the program, the output deciding variables \(\text {OVar}(S)\). The output deciding variables are of two parts: \(\text {TVar}_o(S)\) are variables affecting the termination of executions of a statement sequence; \(\text {Imp}_o(S)\) are variables affecting values of the I/O sequence produced in executions of a statement sequence. We show the definition of \(\text {TVar}_o(S)\), \(\text {Imp}_o(S)\) and \(\text {OVar}(S)\) in order.

Definition 10

(Imported Variables Relative to Output). The imported variables in one program S relative to output, written \(Imp_o(S)\), are listed as follows:

  1. 1.

    \(Imp_o(S) = \{{id}_{IO}\}\), if \((\forall e\,:\, ``output\,e\)\(\notin S)\);

  2. 2.

    \(Imp_o(``output\,e\)”) = \(\{{id}_{IO}\} \cup Use(e)\);

  3. 3.

    \(Imp_o(``If\,(e)\,then\,\{S_t\}else\,\{S_f\}\)”) \(= Use(e) \cup Imp_o(S_t) \cup Imp_o(S_f)\) if \((\exists e\,:\, ``output\,e\)\(\in S)\);

  4. 4.

    \(Imp_o(``while_{\langle n\rangle }(e)\{S''\}\)”) \(= Imp(``while_{\langle n\rangle }(e)\{S''\}\)”, \(\{{id}_{IO}\}) if (\exists e\,:\, ``output\,e\)\(\in S'')\);

  5. 5.

    For \(k>0\), \(Imp_o(s_1;...;s_k;s_{k+1}) = Imp(s_1;...;s_k, Imp_o(s_{k+1})) if (\exists e\,:\, ``output\,e\)\(\in s_{k+1})\);

  6. 6.

    For \(k>0\), \(Imp_o(s_1;...;s_k;s_{k+1}) = Imp_o(s_1;...;s_k) if (\forall e\,:\, ``output\,e\)\(\notin s_{k+1})\);

Definition 11

(Termination Deciding Variables Relative to Output). The termination deciding variables in a statement sequence S relative to output, written \(TVar_o(S)\), are listed as follows:

  1. 1.

    \(TVar_o(S) = \emptyset \,\,if\,\,(\forall e\,:\, ``output\,e\)\(\notin S)\);

  2. 2.

    \(TVar_o(``output\,e\)”) \(= Err(e)\);

  3. 3.

    \(TVar_o(``If\,(e)\,then\,\{S_t\}else\,\{S_f\}\)”)\(\,\, = Use(e) \cup TVar_o(S_t) \cup TVar_o(S_f)if\,\,(\exists e\,:\, ``output\,e\)\(\in S)\);

  4. 4.

    \(TVar_o(``while(e)\{S''\}\)”) \(= TVar(``while(e)\{S''\}\)”) \(if\,\,(\exists e\,:\, ``output\,e\)\(\in S'')\);

  5. 5.

    For \(k>0\), \(TVar_o(s_1;...;s_k;s_{k+1}) = TVar(s_1;...;s_k)\)

    \(\cup Imp(s_1;...;s_k, TVar_o(s_{k+1}))\,\,if\,\,\)(\(\exists e\,:\, ``output\,e\)\(\in s_{k+1})\);

  6. 6.

    For \(k>0\), \(TVar_o(s_1;...;s_k;s_{k+1}) = TVar_o(s_1;...;s_k)\,\,if\,\,\)(\(\forall e\,:\, ``output\,e\)\(\notin s_{k+1})\);

Definition 12

(Output Deciding Variables). The out-deciding variables in a statement sequence S are \(Imp_o(S) \cup TVar_o(S)\), written OVar(S).

The condition of the same output sequence is defined recursively. The base case is for two same output statements or two statements where the output sequence variable is not defined. The inductive cases are syntax directed considering the syntax of compound statements and statement sequences.

Definition 13

(Proof Rule for Behavioral Equivalence). Two statement sequences \(S_1\) and \(S_2\) satisfy the condition of the same output sequence, written \(S_1 \equiv _{O}^S S_2\), iff one of the following holds:

  1. 1.

    \(S_1\) and \(S_2\) are one statement and one of the following holds:

    1. (a)

      \(S_1\) and \(S_2\) are simple statement and one of the following holds:

      1. i.

        \(S_1\) and \(S_2\) are not output statement, \(\forall e_1\, e_2\,:\, (``output\,{e_1}\)\(\ne S_1) \wedge (``output\,{e_2}\)\(\ne S_2)\); or

      2. ii.

        \(S_1 = S_2 = ``output\,e\)”.

    2. (b)

      \(S_1 = ``If\,(e)\,then\,\{S_1^t\} else\,\{S_1^f\}\)”, \(S_2 = ``If\,(e)\,then\,\{S_2^t\} else\,\{S_2^f\}\)” and all of the following hold:

      • There is an output statement in \(S_1\) and \(S_2\),

        \(\exists e_1\, e_2\,:\, (``output\,{e_1}\,\)\(\in S_1) \wedge (``output\,e_2\)\(\in S_2)\);

      • \((S_1^t \equiv _{O}^S S_2^t) \wedge (S_1^f \equiv _{O}^S S_2^f)\);

    3. (c)

      \(S_1 = ``while_{\langle n_1 \rangle }(e) \; \{S_1''\}\)” and \(S_2 = ``while_{\langle n_2 \rangle }(e) \; \{S_2''\}\)” and all of the following hold:

      • There is an output statement in \(S_1\) and \(S_2\),

        \(\exists e_1\, e_2\,:\, (``output\,e_1\)\(\in S_1) \wedge (``output\,e_2\)\(\in S_2)\);

      • \(S_1'' \equiv _{O}^S S_2''\);

      • \(S_1''\) and \(S_2''\) have equivalent computation of \(OVar(S_1) \cup OVar(S_2)\);

      • \(S_1''\) and \(S_2''\) satisfy the proof rule of termination in the same way, \(S_1'' \equiv _{H}^S S_2''\);

    4. (d)

      Output statements are not in both \(S_1\) and \(S_2\),

      \(\forall e_1\,e_2\,:\, (``output\,e_1\)\(\notin S_1) \wedge (``output\,e_2\)\(\notin S_2)\).

  2. 2.

    \(S_1\) and \(S_2\) are not both one statement and one of the following holds:

    1. (a)

      \(S_1=S_1';s_1\) and \(S_2=S_2';s_2\), and all of the following hold:

      • \(S_1' \equiv _{O}^S S_2'\);

      • \(S_1'\) and \(S_2'\) have equivalent computation of \(OVar(s_1) \cup OVar(s_2)\);

      • \(S_1'\) and \(S_2'\) satisfy the proof rule of termination in the same way: \(S_1' \equiv _{H}^S S_2'\);

      • There is an output statement in both \(s_1\) and \(s_2\), \(\exists e_1\, e_2\,:\, (``output\,e_1\)\(\in s_1) \wedge (``output\,e_2\)\(\in s_2)\);

      • \(s_1 \equiv _{O}^S s_2\);

    2. (d)

      There is no output statement in the last statement in \(S_1\) or \(S_2\):

      \(\big ((S_1 = S_1';s_1) \wedge (S_1' \equiv _{O}^S S_2) \wedge (\forall e\,:\, ``output\,e\)\(\notin s_1)\big )\)

      \(\vee \big ((S_2 = S_2';s_2) \wedge (S_1 \equiv _{O}^S S_2') \wedge (\forall e\,:\, ``output\,e\)\(\notin s_2)\big )\);

Backward Compatible Update Classes

Please refer to our technical report [31] for the proof rules for real world update classes.

Appendix: Formal Programming Language

Please refer to our technical report [31] for the small step operational semantics of our formal language.

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Shen, J., Bazzi, R.A. (2015). A Formal Study of Backward Compatible Dynamic Software Updates. In: Calinescu, R., Rumpe, B. (eds) Software Engineering and Formal Methods. SEFM 2015. Lecture Notes in Computer Science(), vol 9276. Springer, Cham. https://doi.org/10.1007/978-3-319-22969-0_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-22969-0_17

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-22968-3

  • Online ISBN: 978-3-319-22969-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics