Abstract
In this paper we verify Java transformations by using a fourth–stage strategy. Initially we embed models in Alloy: a metamodel for a subset of the Java, a model for each program transformation being investigated, and another one for a program called Validator that exercises methods of each side of the transformation. Secondly, we use the Alloy Analyzer to find valid instances, corresponding to pairs (left and right-hand sides of a program transformation) and instances of the Validator. If instances can be found, this means they describe well–formed programs as long as transformation conditions, structural and type constraints are formally stated in our models. Thirdly we developed a tool that translates the Alloy instances to Java; finally, these are executed and the results used to verify whether there are any dynamic semantic problems in the resulting programs.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
They can be downloaded from http://www.cin.ufpe.br/~tds/phd/JTransformations.
References
Schäfer, M.: Specification, implementation and verification of refactorings, Ph.D. thesis (2010)
Soares, G., Gheyi, R., Massoni, T.: Automated behavioral testing of refactoring engines. IEEE TSE Trans. Softw. Eng. 39(2), 147–162 (2013)
Java Language Specification. http://docs.oracle.com/javase/specs/jls/se8/jls8.pdf
Jackson, D., Schechter, I., and Shlyahter, I.: Alcoa: the alloy constraint analyzer. In: 22nd ICSE International Conference on Software Engineering, pp 730–733. ACM Press, New York (2000)
Jackson, D.: Software Abstractions: Logic, Language, and Analysis. MIT Press, Cambridge (2006)
Duarte, R., Mota, A., Sampaio, A.: Introducing concurrency in sequential Java via laws. Inf. Process. Lett. 111(3), 129–134 (2011). Elsevier
Soares, G., Gheyi, R., Serey, D., Massoni, T.: Making program refactoring safer. IEEE Softw. 27(4), 52–57 (2010)
Borba, P., Sampaio, A., Cavalcanti, A., Cornelio, M.: Algebraic reasoning for object-oriented programming. Sci. Comput. Program. 52(1), 53–100 (2004)
Silva, L., Sampaio, A., Liu, Z.: Laws of object-orientation with reference semantics. In: 6th IEEE SEFM International Conference on Software Engineering and Formal Methods, pp. 217–226, Washington (2008)
Palma, G.: Algebraic laws for object oriented programming with references, Ph.D thesis (2015)
Naumann, D., Sampaio, A., Silva, L.: Refactoring and representation independence for class hierarchies. Theor. Comput. Sci. 433, 60–97 (2012)
Overbey, J.L., Johnson, R.E.: Differential precondition checking: a lightweight, reusable analysis for refactoring tools. In: 26th IEEE/ACM ASE International Conference on Automated Software Engineering, pp. 303–312, New York (2011)
Tip, F., Kiezun, A., Baumer, D.: Refactoring for generalization using type constraints. In: 18th ACM SIGPLAN OOPSLA Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 13–26, New York (2003)
Ekman, T., Hedin, G.: The JastAdd extensible Java compiler. In: Object-Oriented Programming, Systems and Languages (OOPSLA), pp. 1–18. ACM Press (2007)
Acknowledgments
This work was supported by the National Institute of Science and Technology for Software Engineering (INES (www.ines.org.br)), funded by CNPq and FACEPE, grants 573964/2008-4 and APQ-1037-1.03/08.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
da Silva, T.D., Sampaio, A., Mota, A. (2016). Verifying Transformations of Java Programs Using Alloy. In: Cornélio, M., Roscoe, B. (eds) Formal Methods: Foundations and Applications. SBMF 2015. Lecture Notes in Computer Science(), vol 9526. Springer, Cham. https://doi.org/10.1007/978-3-319-29473-5_7
Download citation
DOI: https://doi.org/10.1007/978-3-319-29473-5_7
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-29472-8
Online ISBN: 978-3-319-29473-5
eBook Packages: Computer ScienceComputer Science (R0)