ACM Home Page
Please provide us with feedback. Feedback
Static checking of dynamically generated queries in database applications
Full text PdfPdf (706 KB)
Source
ACM Transactions on Software Engineering and Methodology (TOSEM) archive
Volume 16 ,  Issue 4  (September 2007) table of contents
Article No. 14  
Year of Publication: 2007
ISSN:1049-331X
Authors
Gary Wassermann  University of California, Davis, CA
Carl Gould  University of California, Davis, CA
Zhendong Su  University of California, Davis, CA
Premkumar Devanbu  University of California, Davis, CA
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 39,   Downloads (12 Months): 167,   Citation Count: 1
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1276933.1276935
What is a DOI?

ABSTRACT

Many data-intensive applications dynamically construct queries in response to client requests and execute them. Java servlets, for example, can create strings that represent SQL queries and then send the queries, using JDBC, to a database server for execution. The servlet programmer enjoys static checking via Java's strong type system. However, the Java type system does little to check for possible errors in the dynamically generated SQL query strings. Thus, a type error in a generated selection query (e.g., comparing a string attribute with an integer) can result in an SQL runtime exception. Currently, such defects must be rooted out through careful testing, or (worse) might be found by customers at runtime. In this article, we present a sound, static program analysis technique to verify that dynamically generated query strings do not contain type errors. We describe our analysis technique and provide soundness results for our static analysis algorithm. We also describe the details of a prototype tool based on the algorithm and present several illustrative defects found in senior software-engineering student-team projects, online tutorial examples, and a real-world purchase order system written by one of the authors.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
2
 
3
Andersen, L. 1994. Program analysis and specialization for the C programming language. Ph.D. thesis, DIKU, University of Copenhagen. DIKU report 94/19.
4
5
 
6
Choi, T.-H., Lee, O., Kim, H., and Doh, K.-G. 2006. A practical string analyzer by the widening approach. In Proceedings of the 4th Asian Symposium on Programming Languages and Systems (APLAS 2006) (Sydney, Australia). Springer-Verlag, New York, 374--388.
 
7
Christensen, A., M&oslah;ller, A., and Schwartzbach, M. 2003. Precise analysis of string expressions. In Proceedings of the 10th International Static Analysis Symposium (San Diego, CA). Springer-Verlag, New York, 1--18.
 
8
Cook, W. R., and Ibrahim, A. H. 2005. Programming languages & databases: What's the problem?? url: http://www.cs.utexas.edu/~wcook/Drafts/2005/PLDBProblem.pdf.
9
 
10
Guyot, J. 1998. BNF index of SQL for Oracle 7. Available at http://cui.unige.ch/db-research/Enseignement/analyseinfo/SQL7/.
11
12
13
 
14
JBoss. 2006. Hibernate. url: http://www.hibernate.org/.
15
16
17
18
19
 
20
Microsoft. 2004. ADO.NET. url: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/adonetanchor.asp.
 
21
Microsoft. 2005. LINQ Project. url: http://msdn.microsoft.com/netframework/future/linq/.
 
22
Oracle. 2006. Oracle TopLink. url: http://www.oracle.com/technology/products/ias/toplink/index.html.
23
24
25
 
26
SQLJ. 1997. See http://www.sqlj.org.
27
 
28
29
 
30
 
31
Viega, J., and McGraw, G. 2001. Building Secure Software: How to Avoid Security Problems the Right Way. Addison Wesley, Boston, MA.
 
32
Wassermann, G., and Su, Z. 2004. An analysis framework for security in Web applications. In Proceedings of the 3rd FSE Workshop on the Specification and Verification of Component Based Systems (SAVCBS 2004) (Newport Beach, CA). ACM, New York, 70--78.
33
 
34
Yellin, D. 1993. Speeding up dynamic transitive closure for bounded degree graphs. Acta Inf. 30, 4 (July), 369--384.


Collaborative Colleagues:
Gary Wassermann: colleagues
Carl Gould: colleagues
Zhendong Su: colleagues
Premkumar Devanbu: colleagues