Skip to main content
Log in

Test frame updating in CPM testing of Prolog programs

  • Published:
Software Quality Journal Aims and scope Submit manuscript

Abstract

Category Partition Method (CPM) is a general approach to specification-based program testing, where test frame reduction and refinement are two important issues. Test frame reduction is necessary since too many test frames may be produced, and test frame refinement is important since during CPM testing new information about test frame generation may be achieved and considered incrementally. Besides the information provided by testers or users, implementation related knowledge offers alternative information for reducing and refining CPM test frames. This paper explores the idea by proposing a call patterns semantics based test frame updating method for Prolog programs, in which a call patterns analysis is used to collect information about the way in which procedures are used in a program. The updated test frames will be represented as constraints. The effect of our test frame updating is two-fold. On one hand, it removes “uncared” data from the original set of test frames; on the other hand, it refines the test frames to which we should pay more attention. The first effect makes the input domain on which a procedure must be tested a subset of the procedure’s input domain, and the latter makes testers stand more chance to find out the faults that are more likely to show their presence in the use of the program under consideration. Our test frame updating method preserves the effectiveness of CPM testing with respect to the detection of faults we care. The test case generation from the updated set of test frames is also discussed. In order to show the applicability of our method an approximation call patterns semantics is proposed, and the test frame updating on the semantics is illustrated by an example.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  • Amla, N., & Ammann, P. (1992). Using Z specifications in category-partition testing. In Proceedings of 7th Annual IEEE Conference on Computer Assurance (COMPASS ’92) (pp. 3–10). IEEE Computer Society Press.

  • Ammann, P., & Offutt, A. J. (1994). Using formal methods to derive test frames in category partition testing. In Proceedings of the Ninth Annual Conference on Computer Assurance (COMPASS’ 94) (pp. 69–80). IEEE Computer Society Press.

  • Balcer, M. J., Hasling, W. M., & Ostrand, T. J. (1989). Automatic generation of test scripts from formal test specifications. In Proceedings of the 3rd ACM Annual Symposium on Software Testing, Analysis, and Verification (TAV ’89) (pp. 210–218). ACM Press.

  • Barbuti, R., Giacobazzi, R., & Levi, G. (1993). A general framework for semantics-based bottom-up abstract interpretation of logic programs. ACM Transactions on Programming Languages and Systems, 15(1), 133–181.

    Article  Google Scholar 

  • Belli, F., & Jack, O. (1993). Implementation-based analysis and testing of prolog programs. In Proceedings of the 1993 ACM SIGSOFT International Symposium on Software Testing and Analysis (pp. 70–80). ACM Press.

  • Belli, F., & Jack, O. (1995). A test coverage notion for logic programming. In Proceedings of the Sixth International Symposium on Software Reliability Engineering (pp. 133–142). IEEE Computer Society Press.

  • Belli, F., & Jack, O. (1998). Declarative paradigm of test coverage. Software Testing, Verification and Reliability, 8, 15–47.

    Article  Google Scholar 

  • Chen, T. Y., Poon, P.-L., & Tse, T. H. (2003). A choice relation framework for supporting category-partition test case generation. IEEE Transactions on Software Engineering, 29(7), 577–593.

    Article  Google Scholar 

  • Codish, M., Dams, D., & Yardeni, E. (1994). Bottom-up abstract interpretation of logic programs. Journal of Theoretical Computer Science, 124, 93–125.

    Article  MATH  MathSciNet  Google Scholar 

  • Colmerauer, A. (1990). An introduction to PROLOG-III. Communications of the ACM, 33(7), 69–90.

    Article  Google Scholar 

  • Cousot, P., & Cousot, R. (1992a). Abstract interpretation and applications to logic programs. Journal of Logic Programming, 13(23), 103–179.

    Article  MATH  MathSciNet  Google Scholar 

  • Cousot, P., & Cousot, R. (1992b). Comparing the Galois connection and widening/narrowing approaches to abstract interpretation, invited paper. In Proceedings of the Fourth International Symposium on Programming Language Implementation and Logic Programming, PLILP’92, LNCS (vol. 631, pp. 269–295). Springer-Verlag.

  • Dincbas, M., Van Hentenryck, P., Simonis, H., & Aggoun, A. (1988). The constraint logic programming language CHIP. In Proceedings of the International Conference on Fifth Generation Computer Systems (pp. 693–702). Springer-Verlag.

  • Gabbrielli, M., & Giacobazzi, R. (1994). Goal independency and call patterns in the analysis of logic programs. In Proceedings of the Ninth ACM Symposium on Applied Computing (pp. 394–399). ACM Press.

  • Gabbrielli, M., Levi, G., & Meo, M. C. (1995). Observable behaviors and equivalences of logic programs. Information and Computation, 122(1), 1–29.

    Article  MATH  MathSciNet  Google Scholar 

  • Gabbrielli, M., & Meo, M. C. (1992). Fixpoint semantics for partial computed answer substitutions and call patterns. Lecture Notes in Computer Science (Vol. 632, pp. 84–99). Springer-Verlag.

  • Horváth, T., Gyimóthy, T., Alexin, Z., & Kocsis, F. (1993). Interactive diagnosis and testing of logic programs. In Proceedings of the Third Finnish-Estonian-Hungarian Symposium on Programming Languages and Software Tools, Kääriku, Estonia (pp. 34–46).

  • Howe, J. M., & King, A. (2003). Efficient groundness analysis in Prolog. Theory and Practice of Logic Programming, 3(1), 95–124.

    Article  MATH  MathSciNet  Google Scholar 

  • Jaffar, J., & Maher, M. J. (1994). Constraint logic programming: A survey. Journal of Logic Programming, 19–20, 503–581.

    Article  MathSciNet  Google Scholar 

  • Kókai, G., Harmath, L., & Gyimóthy, T. (1997). IDTS: A tool for debugging and testing of prolog programs. In Proceedings of LIRA’97, The 8th Conference on Logic and Computer Science, Novi Sad, Yugoslavia 1–4 September 1997 (pp. 103–110). University of Novi Sad.

  • Levi, G., & Spoto, F. (1996). Accurate analysis of prolog with cut. In P. Lucio, M. Martelli, & M. Navarro (Eds.), Proceedings APPIA-GULP-PRODE’96 (pp. 481–492). Universidad del Pais Vasco.

  • Luo, G., Bochmann, G., Sarikaya, B., & Boyer, M. (1992). Control flow based testing of prolog programs. In Proceedings of the 3rd International Symposium on Software Reliability Engineering (pp. 104–113). IEEE Computer Society Press.

  • Marriott, K., & Sndergaard, H. (1993). Precise and efficient groundness analysis for logic programs. ACM Letters on Programming Languages and Systems, 2(1–4), 181–196.

    Google Scholar 

  • Offutt, A. J., & Irvine, A. (1995). Testing object-oriented software using the category-partition method. In Proceedings of 17th International Conference on Technology of Object-Oriented Languages and Systems (TOOLS17) (pp. 293–304). Prentice Hall.

  • Ostrand, T. J., & Balcer, M. J. (1988). The category-partition method for specifying and generating functional tests. Communications of ACM, 31(6), 676–686.

    Article  Google Scholar 

  • Patton, R. (2006). Software testing (2nd ed.). Pearson Education, Inc.

  • Shapiro, E. Y. (1982). Algorithmic program diagnosis. In Proceedings of the Ninth Annual ACM Symposium on Principles of Programming Languages (POPL’82) (pp. 299–308). ACM Press.

  • Spoto, F. (2000). Operational and goal-independent denotational semantics for prolog with cut. The Journal of Logic Programming, 42, 1–46.

    Article  MATH  MathSciNet  Google Scholar 

  • Spoto, F., & Levi, G. (1999). Abstract interpretation of prolog programs. Lecture Notes in Computer Science (Vol. 1548, pp. 455–470). Springer-Verlag.

  • Stocks, P., & Carrington, D. (1996). A framework for specification-based testing. IEEE Transactions on Software Engineering, 22(11), 777–793.

    Article  Google Scholar 

  • Volpe, P. (2001). A first-order language for expressing sharing and type properties of logic programs. Science of Computer Programming, 39(1), 125–148.

    Article  MATH  MathSciNet  Google Scholar 

  • Zeil, S. J., & Wild, C. (1993). A knowledge base for software test refinement. In Proceedings of 8th Knowledge-Based Software Engineering Conference (pp. 50–57). IEEE Computer Society Press.

  • Zhao, L., Gu, T., & Qian, J. (2007a). Constraint-based correct partial answer semantics for the analysis of prolog programs. WSEAS Transactions on Computers, 6(6), 947–952.

    Google Scholar 

  • Zhao, L., Gu, T., & Qian, J. (2007b). Goal-independent semantics for path dependent analysis of prolog programs. In Proceedings of 1st IEEE & IFIP International Symposium on Theoretical Aspects of Software Engineering (TASE 2007) (pp. 261–270). IEEE Computer Society Press.

  • Zhao, L., Gu, T., Qian, J., & Cai, G. (2006a). Designing prolog semantics for a class of observables. In Proceedings of Ninth Pacific Rim International Conference on Artificial Intelligence (PRICAI’06), Lecture Notes in Artificial Intelligence (Vol. 4099, pp. 1052–1057). Springer-Verlag.

  • Zhao, L., Gu, T., Qian, J., & Cai, G. (2006b). On the new application of call patterns to CPM testing of prolog programs. In Proceedings of the 19th ACS Australian Joint Conference on Artificial Intelligence (AI’06), Lecture Notes in Artificial Intelligence (Vol. 4304, pp. 1265–1270). Springer-Verlag.

  • Zhao, L., Gu, T., Qian, J., & Cai, G. (2007c). A novel test case generation method for prolog programs based on call patterns semantics. In Fifth ASIAN Symposium on Programming Languages and Systems (APLAS 2007). Lecture Notes in Computer Science (Vol. 4807, pp. 105–121). Springer-Verlag.

Download references

Acknowledgments

We are grateful to the anonymous reviewers for their constructive comments. This work is partially supported by National Natural Science Foundation of China (No. 60563005, No. 60663005, No. 60763004) and Guangxi Natural Science Foundation of China (GuiKeQing 0728093, GuiKeQing 0542036).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lingzhong Zhao.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Zhao, L., Gu, T., Qian, J. et al. Test frame updating in CPM testing of Prolog programs. Software Qual J 16, 277–298 (2008). https://doi.org/10.1007/s11219-007-9039-y

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11219-007-9039-y

Keywords

Navigation