Skip to main content

Verifying Transformations of Java Programs Using Alloy

  • Conference paper
  • First Online:

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

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   44.99
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

Learn about institutional subscriptions

Notes

  1. 1.

    They can be downloaded from http://www.cin.ufpe.br/~tds/phd/JTransformations.

References

  1. Schäfer, M.: Specification, implementation and verification of refactorings, Ph.D. thesis (2010)

    Google Scholar 

  2. Soares, G., Gheyi, R., Massoni, T.: Automated behavioral testing of refactoring engines. IEEE TSE Trans. Softw. Eng. 39(2), 147–162 (2013)

    Article  Google Scholar 

  3. Java Language Specification. http://docs.oracle.com/javase/specs/jls/se8/jls8.pdf

  4. 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)

    Google Scholar 

  5. Jackson, D.: Software Abstractions: Logic, Language, and Analysis. MIT Press, Cambridge (2006)

    Google Scholar 

  6. Duarte, R., Mota, A., Sampaio, A.: Introducing concurrency in sequential Java via laws. Inf. Process. Lett. 111(3), 129–134 (2011). Elsevier

    Article  MathSciNet  MATH  Google Scholar 

  7. Soares, G., Gheyi, R., Serey, D., Massoni, T.: Making program refactoring safer. IEEE Softw. 27(4), 52–57 (2010)

    Article  Google Scholar 

  8. Borba, P., Sampaio, A., Cavalcanti, A., Cornelio, M.: Algebraic reasoning for object-oriented programming. Sci. Comput. Program. 52(1), 53–100 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  9. 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)

    Google Scholar 

  10. Palma, G.: Algebraic laws for object oriented programming with references, Ph.D thesis (2015)

    Google Scholar 

  11. Naumann, D., Sampaio, A., Silva, L.: Refactoring and representation independence for class hierarchies. Theor. Comput. Sci. 433, 60–97 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Ekman, T., Hedin, G.: The JastAdd extensible Java compiler. In: Object-Oriented Programming, Systems and Languages (OOPSLA), pp. 1–18. ACM Press (2007)

    Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Tarciana Dias da Silva .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics