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.
- AsmL. //http://research.microsoft.com/fse/asml. Version 2.2.]]Google Scholar
- 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.]] Google ScholarDigital Library
- Antoy, S. and Hamlet, D. 2000. Automatically cheeking an implementation against its formal specification. IEEE Trans. Softw. Eng. 26, 1 (Jan).]] Google ScholarDigital Library
- Apache Software Foundation. 2003. BCEL—byte code engineering library. http://jakarta.apache.org/bcel/.]]Google Scholar
- 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.)]]Google Scholar
- Beck, K. 2000. Extreme Programming Explained. Addison Wesley.]] Google ScholarDigital Library
- Beck, K. 2003. Test Driven Development, First ed. Addison-Wesley.]] Google ScholarDigital Library
- 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).]] Google ScholarDigital Library
- 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.]] Google ScholarDigital Library
- Dershowitz, N. and Plaisted, D. A. 2001. Handbook of Automated Reasoning. Vol. 1. Elsevier.]]Google Scholar
- Dershowitz, N. and Vigneron, L. 2003. Database of rewriting systems. http://www.loria.fr/vigneron/RewritingHP/systems.html.]]Google Scholar
- Doong, R. and Frankl, P. G. 1994. The ASTOOT approach to testing object-oriented programs. ACM Trans. Softw. Eng. 3, 2 (Apr.).]] Google ScholarDigital Library
- Futatsugi, K. 2003. CafeObj official homepage. http://www.ldl.jaist.ac.jp/cafeobj/.]]Google Scholar
- Gannon, J., McMullin, P., and Hamlet, R. 1981. Data-abstraction implementation, specification and testing. ACM Trans. Prog. Lang. Syst. 3, 3, 211--223.]] Google ScholarDigital Library
- Goguen, J. 2000. Software Engineering with OBJ: Algebraic Specifications in Action. Kluwer.]]Google Scholar
- Goguen, J. and Meseguer, J. 1982. Rapid prototyping: in the obj executable specification language. SIGSOFT Softw. Eng. Notes 7, 5, 75--84.]] Google ScholarDigital Library
- 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.]]Google Scholar
- Guttag, J. V. and Horning, J. J. 1978. The algebraic specification of abstract data types. Acta Informatica 10, 27--52.]]Google ScholarDigital Library
- 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.]]Google Scholar
- 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.]]Google Scholar
- 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).]] Google ScholarDigital Library
- 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.]] Google ScholarDigital Library
- Jackson, D. 2002. Alloy: a lightweight object modelling notation. Softw. Eng. Meth. 11, 2, 256--290.]] Google ScholarDigital Library
- 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.]] Google ScholarDigital Library
- 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.]] Google ScholarDigital Library
- 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.]]Google Scholar
- 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.]] Google ScholarDigital Library
- Marinov, D. and Khurshid, S. 2002. VAlloy: Virtual functions meet a relational language. In FME 2002: Formal Methods—Getting IT Right. Springer.]] Google ScholarDigital Library
- Mitchell, J. C. 1996. Foundations of Programming Languages. MIT Press.]] Google ScholarDigital Library
- Rapanotti, L. and Socorro, A. 1992. Introducing FOOPS. Tech. rep. PRG-TR-28-92, Programming Research Group, Oxford University Computing Laboratory, Oxford.]]Google Scholar
- Sankar, S. 1991. Run-time consistency checking of algebraic specifications. In Proceedings of the Symposium on Testing, Analysis, and Verification. Victoria, British Columbia, Canada.]] Google ScholarDigital Library
- 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.]]Google ScholarDigital Library
- 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.]]Google Scholar
- TeReSe. 2003. Term Rewriting Systems. Cambridge Tracts in Theoretical Computer Science, vol. 55. Cambridge University Press.]]Google Scholar
- 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.).]] Google ScholarDigital Library
- 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.]] Google ScholarDigital Library
- 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.]] Google ScholarDigital Library
- Wang, Y. and Parnas, D. L. 1994. Simulating the behavior of Software modules by trace rewriting. ACM Trans. Soft. Eng. 20, 10 (Oct.).]] Google ScholarDigital Library
Index Terms
- Developing and debugging algebraic specifications for Java classes
Comments