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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
http://en.wikipedia.org/wiki/Vsftpd. Accessed 15 January 2015
http://www.openssh.com/users.html. Accessed 15 January 2015
Software life cycle processes - maintenance. Technical report. ISO/IEC 14764:2006(E)
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: principles, techniques, and tools
Arnold, J., Kaashoek, M.F.: KSplice: automatic rebootless kernel updates
Benton, N.: Simple relational correctness proofs for static analyses and program transformations (2004)
Binkley, D., Horwitz, S., Reps, T.: The multi-procedure equivalence theorem (1989)
Bloom, T., Day, M.: Reconfiguration and module replacement in argus: theory and practice (1993)
Cartwright, R., Felleisen, M.: The semantics of program dependence (1989)
Godlin, B., Strichman, O.: Inference rules for proving the equivalence of recursive procedures (2008)
Gordon, A.D.: Functional programming and input/output (1994)
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)
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
Hicks, M.: Dynamic software updating. Ph.D. thesis, August 2001
Horwitz, S., Prins, J., Reps, T.: On the adequacy of program dependence graphs for representing programs. In: POPL 1988, pp. 146–157. ACM (1988)
Karfa, C., Banerjee, K., Sarkar, D., Mandal, C.: Verification of loop and arithmetic transformations of array-intensive behaviors (2013)
Kramer, J., Magee, J.: The evolving philosophers problem: dynamic change management (1990)
Kundu, S., Tatlock, Z., Lerner, S.: Proving optimizations correct using parameterized program equivalence. SIGPLAN Not. 44(6), 327–337 (2009)
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)
Lee, Y.F., Chang, R.C.: Hotswapping linux kernel modules. J. Syst. Softw. 79(2), 163–175 (2006)
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)
Magill, S., Hicks, M., Subramanian, S., McKinley, K.S.: Automating object transformations for dynamic software updating. SIGPLAN Not. 47(10), 265–280 (2012)
Makris, K.: Whole-program dynamic software updating. Ph.D. thesis
Makris, K., Bazzi, R.A.: Immediate multi-threaded dynamic software updates using stack reconstruction
Miller, B.P., Fredriksen, L., So, B.: An empirical study of the reliability of unix utilities. ACM
Neamtiu, I.: Practical dynamic software updating. Ph.D. thesis, August 2008
Panzica La Manna, V., Greenyer, J., Ghezi, C., Brener, C.: Formalizing correctness criteria of dynamic updates derived from specification changes. In: EAMS 2013
Parnas, D.L.: Software aging. In: ICSE 1994. IEEE Computer Society Press
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)
Rohl, J.S.: Eliminating recursion from combinatoric procedures (1981)
Shen, J., Bazzi, R.A.: A formal study of backward compatible dynamic software updates. CoRR http://arxiv.org/abs/1503.07235
Verdoolaege, S., Janssens, G., Bruynooghe, M.: Equivalence checking of static affine programs using widening to handle recurrences. ACM Trans. Program. Lang. Syst
Winskel, G.: The Formal Semantics of Programming Languages: An Introduction. MIT Press, Cambridge (1993)
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)
Author information
Authors and Affiliations
Corresponding author
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.
\(Imp_o(S) = \{{id}_{IO}\}\), if \((\forall e\,:\, ``output\,e\)” \(\notin S)\);
-
2.
\(Imp_o(``output\,e\)”) = \(\{{id}_{IO}\} \cup Use(e)\);
-
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.
\(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.
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.
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.
\(TVar_o(S) = \emptyset \,\,if\,\,(\forall e\,:\, ``output\,e\)” \(\notin S)\);
-
2.
\(TVar_o(``output\,e\)”) \(= Err(e)\);
-
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.
\(TVar_o(``while(e)\{S''\}\)”) \(= TVar(``while(e)\{S''\}\)”) \(if\,\,(\exists e\,:\, ``output\,e\)” \(\in S'')\);
-
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.
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.
\(S_1\) and \(S_2\) are one statement and one of the following holds:
-
(a)
\(S_1\) and \(S_2\) are simple statement and one of the following holds:
-
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
-
ii.
\(S_1 = S_2 = ``output\,e\)”.
-
i.
-
(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)\);
-
-
(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''\);
-
-
(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)\).
-
(a)
-
2.
\(S_1\) and \(S_2\) are not both one statement and one of the following holds:
-
(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\);
-
-
(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 )\);
-
(a)
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
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)