skip to main content
research-article

Developing and debugging algebraic specifications for Java classes

Published: 27 June 2008 Publication History

Abstract

Modern programs make extensive use of reusable software libraries. For example, a study of a number of large Java applications shows that between 17% and 30% of the classes in those applications use container classes defined in the java.util package. Given this extensive code reuse in Java programs, it is important for the interfaces of reusable classes to be well documented. An interface is well documented if it satisfies the following requirements: (1) the documentation completely describes how to use the interface; (2) the documentation is clear; (3) the documentation is unambiguous; and (4) any deviation between the documentation and the code is machine detectable. Unfortunately, documentation in natural language, which is the norm, does not satisfy the above requirements. Formal specifications can satisfy them but they are difficult to develop, requiring significant effort on the part of programmers.
To address the practical difficulties with formal specifications, we describe and evaluate a tool to help programmers write and debug algebraic specifications. Given an algebraic specification of a class, our interpreter generates a prototype that can be used within an application like a regular Java class. When running an application that uses the prototype, the interpreter prints error messages that tell the developer in which way the specification is incomplete or inconsistent with a hand-coded implementation of the class. We use case studies to demonstrate the usefulness of our system.

References

[1]
AsmL. //http://research.microsoft.com/fse/asml. Version 2.2.]]
[2]
Ammons, G., Mandein, D., Bodik, R., and Larus, J. 2003. Debugging Temporal Spicifications with Concept Analysis. In ACM SIGPLAN 2003 Confeerence on Programming Language Desing and Implementation. San Diego, California.]]
[3]
Antoy, S. and Hamlet, D. 2000. Automatically cheeking an implementation against its formal specification. IEEE Trans. Softw. Eng. 26, 1 (Jan).]]
[4]
Apache Software Foundation. 2003. BCEL—byte code engineering library. http://jakarta.apache.org/bcel/.]]
[5]
Barnett, M., Grieskamp, W., Nachmanson, L., Schulte, W., Tillmann, N., and Veanes, M. 2003. Model-based testing with AsmL.NET. In Proceedings of the 1st European Conference on Model-Driven Software Engineering (Dec.)]]
[6]
Beck, K. 2000. Extreme Programming Explained. Addison Wesley.]]
[7]
Beck, K. 2003. Test Driven Development, First ed. Addison-Wesley.]]
[8]
Chen, H. Y., Tse, T. H., Chan, F. T., and Chen, T. Y. 1998. In black and white: An integrated approach to class-level testing of object oriented programs. ACM Trans. Softw. Eng. 7, 3 (July).]]
[9]
Chen, H. Y., Tse, T. H., and Chen, T. Y. 2001. TACCLE: A methodology for object-oriented software testing at the class and cluster levels. ACM Trans. Softw. Eng. 10, 4 (Jan.), 56--109.]]
[10]
Dershowitz, N. and Plaisted, D. A. 2001. Handbook of Automated Reasoning. Vol. 1. Elsevier.]]
[11]
Dershowitz, N. and Vigneron, L. 2003. Database of rewriting systems. http://www.loria.fr/vigneron/RewritingHP/systems.html.]]
[12]
Doong, R. and Frankl, P. G. 1994. The ASTOOT approach to testing object-oriented programs. ACM Trans. Softw. Eng. 3, 2 (Apr.).]]
[13]
Futatsugi, K. 2003. CafeObj official homepage. http://www.ldl.jaist.ac.jp/cafeobj/.]]
[14]
Gannon, J., McMullin, P., and Hamlet, R. 1981. Data-abstraction implementation, specification and testing. ACM Trans. Prog. Lang. Syst. 3, 3, 211--223.]]
[15]
Goguen, J. 2000. Software Engineering with OBJ: Algebraic Specifications in Action. Kluwer.]]
[16]
Goguen, J. and Meseguer, J. 1982. Rapid prototyping: in the obj executable specification language. SIGSOFT Softw. Eng. Notes 7, 5, 75--84.]]
[17]
Goguen, J., Winkler, T., Meseguer, J., Futatsugi, K., and Jouannaud, J.-P. 1993. Introducing OBJ. In Applications of Algebraic Specification using OBJ, J. Goguen, Ed. Cambridge.]]
[18]
Guttag, J. V. and Horning, J. J. 1978. The algebraic specification of abstract data types. Acta Informatica 10, 27--52.]]
[19]
Henkel, J. and Diwan, A. 2003. Discovering algebraic specifications from Java classes. In ECOOP 2003—Object-Oriented Programming, 17th European Conference, L. Cardelli, Ed. Springer, Darmstadt.]]
[20]
Henkel, J. and Diwan, A. 2004a. Case study: Debugging a discovered specification for java.util.arraylist by using algebraic interpretation. Tech. Rep. CU-CS-970-04, University of Colorado at Boulder.]]
[21]
Henkel, J. and Diwan, A. 2004b. A tool for writing and debugging algebraic specifications. In Proceedings of the 26th International Conference on Software Engineering (ICSE).]]
[22]
Hughes, M. and Stotts, D. 1996. Daistish: Systematic algebraic testing for OO programs in the presence of side-effects. In Proceedings of the International Symposium on Software Testing and Verification. San Diego, California.]]
[23]
Jackson, D. 2002. Alloy: a lightweight object modelling notation. Softw. Eng. Meth. 11, 2, 256--290.]]
[24]
Jackson, D. and Vaziri, M. 2000. Finding bugs with a constraint solver. In ISSTA '00: Proceedings of the 2000 ACM SIGSOFT International Symposium on Software Testing and Analysis. ACM Press, New York, NY, USA, 14--25.]]
[25]
Klop, J. W. 1992. Term rewriting systems. In Handbook of Logic in Computer Science, S. Abramsky, D. M. Gabbay, and T. S. E. Maibaum, Eds. Vol. 2. Oxford University Press, Oxford, Chapter 1, 1--117.]]
[26]
Knuth, D. and Bendix, P. 1970. Simple word problems in universal algebras. In Computational Problems in Abstract Algebra, J. Leech, Ed. Pergamon Press, Oxford, 263--297.]]
[27]
Kupferman, O. and Vardi, M. Y. 1999. Vacuity detection in temporal model checking. In Correct Hardware Design and Verification Methods, Proceedings of the 10th IFIPWG10.5 Advanced Research Working Conference (CHARME'99). Springer, 82--96.]]
[28]
Marinov, D. and Khurshid, S. 2002. VAlloy: Virtual functions meet a relational language. In FME 2002: Formal Methods—Getting IT Right. Springer.]]
[29]
Mitchell, J. C. 1996. Foundations of Programming Languages. MIT Press.]]
[30]
Rapanotti, L. and Socorro, A. 1992. Introducing FOOPS. Tech. rep. PRG-TR-28-92, Programming Research Group, Oxford University Computing Laboratory, Oxford.]]
[31]
Sankar, S. 1991. Run-time consistency checking of algebraic specifications. In Proceedings of the Symposium on Testing, Analysis, and Verification. Victoria, British Columbia, Canada.]]
[32]
Shlyakhter, I., Seater, R., Jackson, D., Sridharan, M., and Taghdiri, M. 2003. Debugging overconstrained declarative models using unsatisfiable cores. In 18th IEEE International Conference on Automated Software Engineering (ASE 2003), 6--10 October 2003, Montreal, Canada. IEEE Computer Society, 94--105.]]
[33]
Shlyakhter, I., Sridharan, M., and Jackson, D. 2002. Analyzing Distributed Algorithms with First-Order Logic. http://sdg.csail.mit.edu/pubs/2002/alloy-distalg.pdf.]]
[34]
TeReSe. 2003. Term Rewriting Systems. Cambridge Tracts in Theoretical Computer Science, vol. 55. Cambridge University Press.]]
[35]
Thatcher, J. W., Wagner, E. G., and Wright, J. B. 1982. Data type specification: Parameterization and the power of specification techniques. ACM Trans. Program. Lang. Syst. 4, 4 (Oct.).]]
[36]
Vallée-Rai, R., Gagnon, E., Hendren, L. J., Lam, P., Pominville, P., and Sundaresan, V. 2000. Optimizing Java bytecode using the Soot framework: Is it feasible? In Compiler Construction, 9th International Conference (CC 2000). 18--34.]]
[37]
van den Brand, M. G. J., Heering, J., Klint, P., and Olivier, P. A. 2002. Compiling language definitions: The asf+sdf compiler. ACM Trans. Program. Lang. Syst. 24, 4, 334--368.]]
[38]
Wang, Y. and Parnas, D. L. 1994. Simulating the behavior of Software modules by trace rewriting. ACM Trans. Soft. Eng. 20, 10 (Oct.).]]

Cited By

View all
  • (2024)The logical structure of modular semantic theories of software systemsMetaphilosophy10.1111/meta.1270155:3(440-456)Online publication date: 15-Jul-2024
  • (2019)Program synthesis with algebraic library specificationsProceedings of the ACM on Programming Languages10.1145/33605583:OOPSLA(1-25)Online publication date: 10-Oct-2019
  • (2018)A Systematic Mapping Study on API Documentation Generation Approaches2018 44th Euromicro Conference on Software Engineering and Advanced Applications (SEAA)10.1109/SEAA.2018.00081(462-469)Online publication date: Aug-2018
  • Show More Cited By

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Software Engineering and Methodology
ACM Transactions on Software Engineering and Methodology  Volume 17, Issue 3
June 2008
133 pages
ISSN:1049-331X
EISSN:1557-7392
DOI:10.1145/1363102
Issue’s Table of Contents
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: 27 June 2008
Accepted: 01 April 2007
Revised: 01 June 2006
Received: 01 September 2004
Published in TOSEM Volume 17, Issue 3

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Algebraic interpretation
  2. algebraic specifications
  3. specification discovery

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)0
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)The logical structure of modular semantic theories of software systemsMetaphilosophy10.1111/meta.1270155:3(440-456)Online publication date: 15-Jul-2024
  • (2019)Program synthesis with algebraic library specificationsProceedings of the ACM on Programming Languages10.1145/33605583:OOPSLA(1-25)Online publication date: 10-Oct-2019
  • (2018)A Systematic Mapping Study on API Documentation Generation Approaches2018 44th Euromicro Conference on Software Engineering and Advanced Applications (SEAA)10.1109/SEAA.2018.00081(462-469)Online publication date: Aug-2018
  • (2016)ICON: Inferring Temporal Constraints from Natural Language API Descriptions2016 IEEE International Conference on Software Maintenance and Evolution (ICSME)10.1109/ICSME.2016.59(378-388)Online publication date: Oct-2016
  • (2015)Scalable Parallelization of Specification Mining Using Distributed ComputingThe Art and Science of Analyzing Software Data10.1016/B978-0-12-411519-4.00021-5(623-648)Online publication date: 2015
  • (2014)Search-based synthesis of equivalent method sequencesProceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2635868.2635888(366-376)Online publication date: 11-Nov-2014
  • (2014)Synthesis of Infinite-State Abstractions and Their Use for Software ValidationSpecification, Algebra, and Software10.1007/978-3-642-54624-2_14(276-295)Online publication date: 2014
  • (2013)Second-order constraints in dynamic invariant inferenceProceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering10.1145/2491411.2491457(103-113)Online publication date: 18-Aug-2013
  • (2013)Declarative mockingProceedings of the 2013 International Symposium on Software Testing and Analysis10.1145/2483760.2483790(246-256)Online publication date: 15-Jul-2013
  • (2012)Inferring method specifications from natural language API descriptionsProceedings of the 34th International Conference on Software Engineering10.5555/2337223.2337319(815-825)Online publication date: 2-Jun-2012
  • Show More Cited By

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media