Software Quality Journal

, Volume 21, Issue 1, pp 127–158 | Cite as

B model slicing and predicate abstraction to generate tests

Article

Abstract

In a model-based testing approach as well as for the verification of properties, B models provide an interesting modeling solution. However, for industrial applications, the size of their state space often makes them hard to handle. To reduce the amount of states, an abstraction function can be used. The abstraction is often a domain abstraction of the state variables that requires many proof obligations to be discharged, which can be very time-consuming for real applications. This paper presents a contribution to this problem that complements an approach based on domain abstraction for test generation, by adding a preliminary syntactic abstraction phase, based on variable elimination. We define a syntactic transformation that suppresses some variables from a B event model, in addition to three methods that choose relevant variables according to a test purpose. In this way, we propose a method that computes an abstraction of a source model \({\mathsf{M}}\) according to a set of selected relevant variables. Depending on the method used, the abstraction can be computed as a simulation or as a bisimulation of \({\mathsf{M}}\). With this approach, the abstraction process produces a finite state system. We apply this abstraction computation to a model-based testing process. We evaluate experimentally the impact of the model simplification by variables' elimination on the size of the models, on the number of proof obligations to discharge, on the precision of the abstraction and on the coverage achieved by the test generation.

Keywords

Abstraction Test generation (Bi)Simulation slicing 

References

  1. Abrial, J.-R. (1996a). Extending B without changing it (for developing distributed systems). In 1st B conference, pp. 169–190.Google Scholar
  2. Abrial, J. -R. (1996b). The B book: Assigning programs to meanings. Cambridge: Cambridge University Press.MATHCrossRefGoogle Scholar
  3. Abrial, J. -R. (2010). Modeling in event-B—system and software engineering. Cambridge: Cambridge University Press.MATHGoogle Scholar
  4. Ball, T. (2005) A theory of predicate-complete test coverage and generation. In FMCO’04, vol. 3657 of LNCS, (pp. 1–22). Berlin: Springer.Google Scholar
  5. Bouquet, F., Bué, P.-C., Julliand, J., Masson, P.-A. (2009). Génération de tests à partir de critères dynamiques de sélection et par abstraction. In AFADL’09, (pp. 161–176), Toulouse, France, January.Google Scholar
  6. Bouquet, F.,, Bué, P.-C., Julliand, J., & Masson, P.-A. (2010). Test generation based on abstraction and test purposes to complement structural tests. In A-MOST’10, 6th int. Workshop on advances in model based testing, Paris, France, April.Google Scholar
  7. Bouquet, F., Couchot, J.-F., Dadeau, F., & Giorgetti, A. (2007). Instantiation of parameterized data structures for model-based testing. In B’2007, the 7th International B conference, vol. 4355 of LNCS, (pp. 96–110). Berlin: Springer.Google Scholar
  8. Bellegarde, F., Julliand, J., & Kouchnarenko, O. (2000). Ready-simulation is not ready to express a modular refinement relation. In FASE’2000, vol. 1783 of LNCS, pp. 266–283.Google Scholar
  9. Broy, M., Jonsson, B., Katoen, J.-P., Leucker, M., & Pretschner, A. (eds) (2005). Model-based testing of reactive systems, vol. 3472 of LNCS. Berlin: Springer.Google Scholar
  10. Bensalem, S., Lakhnech, Y., & Owre, S. (1998). Computing abstractions of infinite state systems compositionally and automatically. In CAV’98, vol. 1427 of LNCS. Berlin: Springer.Google Scholar
  11. Bouquet, F., Legeard, B., & Peureux, F. (2004). CLPS-B: A constraint solver to animate a B specification. STTT, International Journal on Software Tools for Technology Transfer 6(2), 143–157.Google Scholar
  12. Ball, T., Majumdar R., Millstein, T. D., Rajamani, S. K. (2001). Automatic predicate abstraction of c programs. In PLDI, (pp. 203–213).Google Scholar
  13. Bert, D., Potet, M.-L., Stouls, N. (2005). GeneSyst: A tool to reason about behavioral aspects of B event specifications. In ZB’05, vol. 3455 of LNCS.Google Scholar
  14. Brückner, I., & Wehrheim, H. (2005). Slicing an integrated formal method for verification. In Kung-Kiu L., Richard B., (Eds.), ICFEM’05, volume 3785 of LNCS, (pp. 360–374). Berlin: Springer, November.Google Scholar
  15. Chan, W., Anderson, R., Beame, P., & Notkin, D. (1997) Combining constraint solving and symbolic model checking for a class of systems with non-linear constraints. In CAV’97, vol. 1254 of LNCS. Berlin: Springer.Google Scholar
  16. Cousot, Patrick, & Cousot, Radhia (1992). Abstract interpretation frameworks. Journal of Logic and Computation, 2(4), 511–547.MathSciNetMATHCrossRefGoogle Scholar
  17. Clarke, E. M., Grumberg, O., & Long, D. (1994). Model checking and abstraction. TOPLAS’94 ACM Transactions on Programming Languages and Systems, 16(5), 1512–1542.CrossRefGoogle Scholar
  18. Clarke, E. M., Grumberg, O., & Peled, D. A. (2000). Model checking. Cambridge: MIT Press.Google Scholar
  19. Couchot, J.-F., Giorgetti, A., & Stouls, N. (2009). Graph-based reduction of program verification conditions. In AFM’09.Google Scholar
  20. Colon, M. A., & Uribe, T. E. (1998) Generating finite-state abstractions of reactive systems using decision procedures. In CAV’98, vol. 1427 of LNCS.Google Scholar
  21. Dick, J., & Faivre, A. (1993). Automating the generation and sequencing of test cases from model-based specifications. In FME’93, (pp. 268–284).Google Scholar
  22. Dwyer, M. B., Hatcliff, J., Hoosier, M., Prasad, V., Robby, R., & Wallentine, T. (2006). Evaluating the effectiveness of slicing for model reduction of concurrent object-oriented programs. In TACAS, (pp. 73–89).Google Scholar
  23. Darlot, C., Julliand, J., & Kouchnarenko, O. (2003). Refinement preserves PLTL properties. In Third International Conference of B and Z Users ZB’03—Formal Specification and Development in Z and B, volume 2651 of LNCS, (pp. 408–420), Turku, Finland, June.Google Scholar
  24. Friedman, G., Hartman, A., Nagin, K., & Shiran,T. (2002). Projected state machine coverage for software testing. In ISSTA, (pp. 134–143).Google Scholar
  25. Graf, S., & Saidi, H. (1997). Construction of abstract state graphs with PVS. In CAV’97, vol. 1254 of LNCS.Google Scholar
  26. Hoare, C. A. R. (1969). An axiomatic basis for computer programming. Communications of the ACM, 10(12), 576–580.CrossRefGoogle Scholar
  27. Heimdahl, M. P. E., & Whalen, M. W. (1997) Reduction and slicing of hierarchical state machines. In ESEC / SIGSOFT FSE, (pp. 450–467).Google Scholar
  28. Julliand, J., Masson, P.-A., Tissot, R. (2008). Generating security tests in addition to functional tests. In AST’08, (pp. 41–44). New York :ACM Press.Google Scholar
  29. Julliand, J., Stouls, N., Bué, P.-C., & Masson, P.-A. (2010). Syntactic abstraction of B models to generate tests. In G. Fraser, A. Gargantini, (Eds.), TAP’10, 4th International Conference on Tests and Proofs, volume 6143 of LNCS, (pp. 151–166), Malaga, Spain, July.Google Scholar
  30. Leuschel, M., & Butler, M. (2008). ProB: An automated analysis toolset for the B method. Software Tools for Technology Transfer, 10(2), 185–203.CrossRefGoogle Scholar
  31. Labbé, S., Gallois, J.-P., & Pouzet, M. (2007). Slicing communicating automata specifications for efficient model reduction. In ASWEC, (pp. 191–200).Google Scholar
  32. Marlet, R., & Mesnil, C. (2002). Demoney: A demonstrative electronic purse. Technical Report SECSAFE-TL-007, Trusted Logic.Google Scholar
  33. Namjoshi, K. S., Kurshan, R. P. (2000). Syntactic program transformations for automatic abstraction. In CAV’00, volume 1855 of LNCS, (pp. 435–449). Berlin: Springer.Google Scholar
  34. Sipma, H., Uribe, T., & Manna, Z. (1999). Deductive model checking. Formal Methods in System Design, 15(1), 49–74.CrossRefGoogle Scholar
  35. Thimbleby, H. W. (2003) The directed chinese postman problem. Software: Practice and Experience, 33(11), 1081–1096.CrossRefGoogle Scholar
  36. Tip, F. (1995). A survey of program slicing techniques. Journal of Programming Language, 3(3), 121–189.Google Scholar
  37. Utting, M., & Legeard, B. (2006). Practical model-based testing—a tools approach. Amsterdam: Elsevier Science.Google Scholar
  38. Weiser, Mark (1984). Program slicing. Software Engineering. IEEE Transactions on SE, 10(4), 352–357.MATHCrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2011

Authors and Affiliations

  • J. Julliand
    • 1
  • N. Stouls
    • 2
  • P.-C. Bué
    • 1
  • P.-A. Masson
    • 1
  1. 1.LIFC, Université de Franche-ComtéBesançon CedexFrance
  2. 2.Université de Lyon, INRIAVilleurbanneFrance

Personalised recommendations