representation of each axiom. Reasoning about the
Alloy model allows also checking the consistency of
the algebraic specification itself. Although, for space
constraints, the example presented in the paper is
very simple, the method has been successfully
applied to several other ADTs, such as the Sorted
Set and Priority Queue.
A common limitation of Alloy Analyzer is
scalability, because of the time required to find
model instances in complex cases. However, we did
not found this to be a problem for testing ADTs in
our approach. On a 32 bit Intel Core 2 Duo T6600 @
2.2 GHz with 3 GB of RAM, running Windows 7,
Alloy Analyzer took around 100 seconds to run the
17 axiom cases of the bounded stack. Times of the
same magnitude were obtained for other ADTs.
As future work, we intend to consolidate the test
case extractor tool, integrate the complete tool suite
into the ConGu’s plug-in for Eclipse (Eclipse
Foundation, 2010, Vasconcelos et al., 2008),
experiment the approach with more ADTs,
demonstrate the adequacy of the test cases generated
by mutation testing, and support unbounded ADTs
by finding automatically safe bounds applicable.
REFERENCES
Abreu, J., Caldeira, A., Lopes, A., Nunes, I., Reis, L. S. &
Vasconcelos, V. T. 2007a. Congu, Checking Java
Classes Against Property-Driven Algebraic
Specifications.
Abreu, J., Vasconcelos, V. T., Nunes, I., Lopes, A., REIS,
L. S. & Caldeira, A. 2007b. ConGu v.1.50 The
Specification and the Refinement Languages.
Anastasakis, K., Behzadbordbar & Kuster, J. M. 2008.
Analysis of model transformations via Alloy.
Beck, K., Gamma, E. & Saff, D. JUnit's project
homepage, http://junit.sourceforge.net/ [Online].
Available: http://junit.sourceforge.net/ [Accessed].
Bernot, G., Gaudel, M. C. & Marre, B. 1991. Software
testing based on formal specifications: a theory and a
tool. Softw. Eng. J.: Michael Faraday House.
Bo, Y., Liang, K., Yufeng, Z. & Hong, Z. Year. Testing
Java Components based on Algebraic Specifications.
In: International Conference on Software Testing,
Verification, and Validation, 2008 Washington, DC,
USA. IEEE Computer Society, 190-199.
Chen, H. Y., Tse, T. H., Chan, F. T. & Chen, T. Y. 1998.
In black and white: an integrated approach to class-
level testing of object-oriented programs. ACM Trans.
Softw. Eng. Methodol.: ACM.
Chen, H. Y., Tse, T. H. & Chen, T. Y. 2001. TACCLE: a
methodology for object-oriented software testing at the
class and cluster levels. ACM Trans. Softw. Eng.
Methodol.: ACM.
Cunha, A. 2009. 'An introduction to Alloy' slides.
Dan, L. & Aichernig, B. K. 2005. Combining Algebraic
and Model-Based Test Case Generation.
Doong, R.-K. & Frankl, P. G. 1994. The ASTOOT
approach to testing object-oriented programs. ACM
Trans. Softw. Eng. Methodol.: ACM.
Eclipse Foundation, I. 2010. Eclipse's website,
http://www.eclipse.org/ [Online]. Available:
http://www.eclipse.org/ [Accessed].
FCT 2009. A Quest for Reliability in Generic Software
Components.
Guttag, J. V. 2002. Abstract data types, then and now.
Software pioneers: contributions to software
engineering. Springer-Verlag New York, Inc.
Hughes, M. & Stotts, D. 1996. Daistish: systematic
algebraic testing for OO programs in the presence of
side-effects. Proceedings of the 1996 ACM SIGSOFT
international symposium on Software testing and
analysis. San Diego, California, United States: ACM.
Jackson, D. 2011a. Alloy Analyzer's API,
http://alloy.mit.edu/alloy4/public/ [Online]. Available:
http://alloy.mit.edu/alloy4/public/ [Accessed].
Jackson, D. 2011b. Alloy Analyzer's website,
http://alloy.mit.edu/ [Online]. Available:
http://alloy.mit.edu/ [Accessed 11-06-2010].
Khurshid, S. & Marinov, D. 2003. TestEra: A Novel
Framework for Testing Java Programs.
Khurshid, S. & Marinov, D. 2004. TestEra: Specification-
based Testing of Java Programs Using SAT.
Kong, L., Zhu, H. & Zhou, B. 2007. Automated Testing
EJB Components Based on Algebraic Specifications.
Proceedings of the 31st Annual International
Computer Software and Applications Conference -
Volume 02. IEEE Computer Society.
Mcmullin, P. R. 1982. Daists: a system for using
specifications to test implementations. University of
Maryland at College Park.
Nunes, I., Lopes, A. & Vasconcelos, V. 2009. Bridging
the Gap between Algebraic Specification and Object-
Oriented Generic Programming.
Reis, L. S. 2007. ConGu v.1.50 User’s Guide.
Vasconcelos, V. T., Nunes, I., Lopes, A., Ramiro, N. &
Crispim, P. 2008. Monitoring Java Code Using
ConGu.
APPENDIX
Table 1: Translation rules from ConGu (syntax) to Alloy.
Rule AlgebraicSpec
(ConGu)
Alloy
R1. Roottype
(implicit) sigElement{}
R2. Type
sortsS sigSextends
Element
R3. Subtype
sortsS<S’ sigSextendsS’
R4. Total
operation
(exceptcreator
constructors)
o:S‐‐>t’
o:Sxt
1
x…xt
n
‐‐
>t’
o:onet’
o:(t
1
‐>...‐>t
n
)‐>one
t’
TEST GENERATION FROM BOUNDED ALGEBRAIC SPECIFICATIONS USING ALLOY
199