Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

Deep typechecking and refactoring

Published: 19 October 2008 Publication History

Abstract

Large software systems are typically composed of multiple layers, written in different languages and loosely coupled using a string-based interface. For example, in modern web-applications, a server written in Java communicates with a database back-end by passing in query strings. This widely prevalent approach is unsafe as the analyses developed for the individual layers are oblivious to the semantics of the dynamically constructed strings, making it impossible to statically reason about the correctness of the interaction. Further, even simple refactoring in such systems is daunting and error prone as the changes must also be applied to isolated string fragments scattered across the code base.
We present techniques for deep typechecking and refactoring for systems that combine Java code with a database back-end using the Java Persistence API [10]. Deep typechecking ensures that the queries that are constructed dynamically are type safe and that the values returned from the queries are used safely by the program. Deep refactoring builds upon typechecking to allow programmers to safely and automatically propagate code refactorings through the query string fragments.
Our algorithms are implemented in a tool called QUAIL. We present experiments evaluating the effectiveness of QUAIL on several benchmarks ranging from 3,369 to 82,907 lines of code.We show that QUAIL is able to verify that 84% of query strings in our benchmarks are type safe. Finally, we show that QUAIL reduces the number of places in the code that a programmer must look at in order to perform a refactoring by several orders of magnitude.

References

[1]
Malcolm P. Atkinson, Laurent Dayn`es, Mick J. Jordan, Tony Printezis, and Susan Spence. An orthogonally persistent java. SIGMOD Record, 25(4):68--75, 1996.
[2]
Gavin M. Bierman, Erik Meijer, and Mads Torgersen. Lost in translatio n: formalizing proposed extensions to c. In OOPSLA, pages 479--498, 2007.
[3]
Aske Simon Christensen, Anders Møller, and Michael I. Schwartzbach. P recise analysis of string expressions. In SAS, pages 1--18, 2003.
[4]
William R. Cook and Siddhartha Rai. Safe query objects: statically ty ped objects as remotely executable queries. In ICSE, pages 97--106, 2005.
[5]
Ezra Cooper, Sam Lindley, PhilipWadler, and Jeremy Yallop. Links: Web programming without tiers. In FMCO, LNCS 4709. Springer, 2006.
[6]
Jacques-Antoine Dub, Rick Sapir, and Peter Purich. Oracle application server toplink application developers guide, 10g (9.0.4). Oracle Corporation, 2 003.
[7]
Michael Furr and Jeffrey S. Foster. Checking type safety of foreign f unction calls. In PLDI, pages 62--72, 2005.
[8]
G. Hamilton and R. Cattell. Jdbc: A java sql api. Sun Microsystems, 1 997.

Cited By

View all
  • (2015)CLOTHO: saving programs from malformed strings and incorrect string-handlingProceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering10.1145/2786805.2786877(555-566)Online publication date: 30-Aug-2015
  • (2015)Debugging mixed-environment programs with BlinkSoftware—Practice & Experience10.1002/spe.227645:9(1277-1306)Online publication date: 1-Sep-2015
  • (2013)Towards automated cross-language refactorings between Java and DSLs used by Java frameworksProceedings of the 2013 ACM workshop on Workshop on refactoring tools10.1145/2541348.2541350(5-8)Online publication date: 27-Oct-2013
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 43, Issue 10
September 2008
613 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1449955
Issue’s Table of Contents
  • cover image ACM Conferences
    OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
    October 2008
    654 pages
    ISBN:9781605582153
    DOI:10.1145/1449764
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 October 2008
Published in SIGPLAN Volume 43, Issue 10

Check for updates

Author Tags

  1. JPA query analysis
  2. cross language refactoring
  3. cross language typechecking

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)1
Reflects downloads up to 14 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2015)CLOTHO: saving programs from malformed strings and incorrect string-handlingProceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering10.1145/2786805.2786877(555-566)Online publication date: 30-Aug-2015
  • (2015)Debugging mixed-environment programs with BlinkSoftware—Practice & Experience10.1002/spe.227645:9(1277-1306)Online publication date: 1-Sep-2015
  • (2013)Towards automated cross-language refactorings between Java and DSLs used by Java frameworksProceedings of the 2013 ACM workshop on Workshop on refactoring tools10.1145/2541348.2541350(5-8)Online publication date: 27-Oct-2013
  • (2012)Abstracting Context in Event-Based SoftwareTransactions on Aspect-Oriented Software Development IX10.1007/978-3-642-35551-6_4(123-167)Online publication date: 2012
  • (2023)Semantic Encapsulation using Linking TypesProceedings of the 8th ACM SIGPLAN International Workshop on Type-Driven Development10.1145/3609027.3609405(14-28)Online publication date: 30-Aug-2023
  • (2014)A type system for format stringsProceedings of the 2014 International Symposium on Software Testing and Analysis10.1145/2610384.2610417(127-137)Online publication date: 21-Jul-2014
  • (2014)Automated Multi-Language Artifact Binding and Rename Refactoring between Java and DSLs Used by Java FrameworksProceedings of the 28th European Conference on ECOOP 2014 --- Object-Oriented Programming - Volume 858610.1007/978-3-662-44202-9_18(437-462)Online publication date: 1-Aug-2014
  • (2012)Abstracting context in event-based softwareTransactions on Aspect-Oriented Software Development IX10.5555/2434958.2434964(123-167)Online publication date: 1-Jan-2012
  • (2012)MarcoProceedings of the 26th European conference on Object-Oriented Programming10.1007/978-3-642-31057-7_26(589-613)Online publication date: 11-Jun-2012
  • (2011)Program analysis for event-based distributed systemsProceedings of the 5th ACM international conference on Distributed event-based system10.1145/2002259.2002278(113-124)Online publication date: 11-Jul-2011
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media