Skip to main content

BETA: A B Based Testing Approach

  • Conference paper

Part of the Lecture Notes in Computer Science book series (LNPSE,volume 7498)

Abstract

While formal methods provide ways to specify and verify software systems with mathematical accuracy, testing techniques can provide mechanisms to identify defects that were inserted in the system during its implementation. With that in mind, this paper presents an approach to generate test specifications based on a formal notation: the B-Method. Our approach is supported by a tool and uses restrictions described on a B specification, such as invariants, preconditions and conditional statements, to create unit tests for an operation. The approach uses equivalence classes and boundary value analysis techniques to partition the operation input space and relies on combinatorial criteria to select partitions to test. The approach and the tool were evaluated through a small case study using specifications for the FreeRTOS micro kernel.

Keywords

  • Testing
  • Formal Methods
  • Unit Testing
  • B-Method

This work is partly supported by CAPES and CNPq grants 306033/2009-7, 560014/2010-4 and 573964/2008-4 (National Institute of Science and Technology for Software Engineering—INES, www.ines.org.br ).

This is a preview of subscription content, access via your institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (Canada)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (Canada)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   72.00
Price excludes VAT (Canada)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abrial, J.R.: The B Book: Assigning Programs to Meanings. Cambridge University Press (1996)

    Google Scholar 

  2. Abrial, J.R., Butler, M., Hallerstede, S., Hoang, T.S., Mehta, F., Voisin, L.: Rodin: an open toolset for modelling and reasoning in Event-B. STTT 12(6), 447–466 (2010)

    CrossRef  Google Scholar 

  3. Ambert, F., Bouquet, F., Chemin, S., Guenaud, S., Legeard, B., Peureux, F., Vacelet, N., Utting, M.: BZ-TT: A tool-set for test generation from Z and B using constraint logic programming. In: Proc. of Formal Approaches to Testing of Software, FATES, pp. 105–120 (2002)

    Google Scholar 

  4. Amla, N., Ammann, P.: Using Z Specifications in Category Partition Testing. In: Ehrig, H., Yu, Y. (eds.) Abstract Data Types 1992 and COMPASS 1992. LNCS, vol. 785, pp. 3–10. Springer, Heidelberg (1994)

    Google Scholar 

  5. Ammann, P., Offutt, J.: Introduction to Software Testing. Cambridge University Press (2008)

    Google Scholar 

  6. Burton, S.: Automated testing from Z specifications. Technical report, University of York (2000)

    Google Scholar 

  7. Cheon, Y., Leavens, G.T.: A Simple and Practical Approach to Unit Testing: The JML and JUnit Way. In: Deng, T. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 231–1901. Springer, Heidelberg (2002)

    CrossRef  Google Scholar 

  8. Dick, J., Faivre, A.: Automating the Generation and Sequencing of Test Cases from Model-based Specifications. In: Larsen, P.G., Wing, J.M. (eds.) FME 1993. LNCS, vol. 670, pp. 268–284. Springer, Heidelberg (1993)

    CrossRef  Google Scholar 

  9. Galvão, S.S.L.: Especificação do micronúcleo FreeRTOS utilizando Método B. Master Thesis, DIMAp/UFRN (2010)

    Google Scholar 

  10. Gupta, A., Bhatia, R.: Testing functional requirements using B model specifications. SIGSOFT Softw. Eng. Notes 35(2), 1–7 (2010)

    CrossRef  Google Scholar 

  11. Huaikou, M., Ling, L.: A test class framework for generating test cases from Z specifications. In: IEEE International Conference on Engineering of Complex Computer Systems (2000)

    Google Scholar 

  12. Jackson, D.: Alloy: a lightweight object modelling notation. ACM Trans. Softw. Eng. Methodol. 11, 256–290 (2002)

    CrossRef  Google Scholar 

  13. Leavens, G.T., Baker, A.L., Ruby, C.: JML: a java modeling language. In: Proceedings of Formal Underpinnings of Java Workshop, OOPSLA 1998 (1998)

    Google Scholar 

  14. Leuschel, M., Butler, M.: ProB: A Model Checker for B. In: Araki, K., Gnesi, S., Mandrioli, D. (eds.) FME 2003. LNCS, vol. 2805, pp. 855–874. Springer, Heidelberg (2003)

    CrossRef  Google Scholar 

  15. Marinov, D., Khurshid, S.: TestEra: A novel framework for automated testing of Java programs. In: International Conference on Automated Software Engineering, p. 22 (2001)

    Google Scholar 

  16. Matos, E.C.B., Moreira, A.M., Souza, F., Coelho, R.d.S.: Generating test cases from B specifications: An industrial case study. In: Petrenko, A., Simao, A., Maldonado, J.C. (eds.) Proceedings of 22nd IFIP International Conference on Testing Software and Systems: Short Papers, November 8-10, pp. 55–60, Natal, Brazil. CRIM (Centre de Recherche Informatique de Montréal) (2010) ISBN-13: 978-2-89522-136-4

    Google Scholar 

  17. Mendes, E., Silveira, D.S., Lencastre, M.: Testimonium: Um método para geração de casos de teste a partir de regras de negócio expressas em OCL. In: IV Brazilian Workshop on Systematic and Automated Software Testing, SAST (2010)

    Google Scholar 

  18. Myers, G.J.: The Art of Software Testing, 3rd edn. Wiley (2011)

    Google Scholar 

  19. Plat, N., Larsen, P.G.: An overview of the ISO/VDM-SL standard. SIGPLAN Not. 27, 76–82 (1992)

    CrossRef  Google Scholar 

  20. Satpathy, M., Butler, M., Leuschel, M., Ramesh, S.: Automatic Testing from Formal Specifications. In: Gurevich, Y., Meyer, B. (eds.) TAP 2007. LNCS, vol. 4454, pp. 95–113. Springer, Heidelberg (2007)

    CrossRef  Google Scholar 

  21. Satpathy, M., Leuschel, M., Butler, M.: Protest: An automatic test environment for B specifications. Electronic Notes in Theoretical Computer Science (2005)

    Google Scholar 

  22. Schneider, S.: B Method, An Introduction. Palgrave (2001)

    Google Scholar 

  23. Singh, H., Conrad, M., Sadeghipour, S., Singh, H., Conrad, M., Sadeghipour, S.: Test case design based on Z and the classification-tree method. In: First IEEE International Conference on Formal Engineering Methods, pp. 81–90 (1997)

    Google Scholar 

  24. Spivey, J.M.: The Z Notation: A Reference Manual, 2nd edn. Prentice-Hall (1992)

    Google Scholar 

  25. Tai, K., Lei, Y.: A test generation strategy for pairwise testing. IEEE Transactions on Software Engineering 28(1), 109–111 (2002)

    CrossRef  Google Scholar 

  26. Warmer, J., Kleppe, A.: The Object Constraint Language: Precise Modeling with UML. Addison-Wesley (1999)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

de Matos, E.C.B., Moreira, A.M. (2012). BETA: A B Based Testing Approach. In: Gheyi, R., Naumann, D. (eds) Formal Methods: Foundations and Applications. SBMF 2012. Lecture Notes in Computer Science, vol 7498. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-33296-8_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-33296-8_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-33295-1

  • Online ISBN: 978-3-642-33296-8

  • eBook Packages: Computer ScienceComputer Science (R0)