Skip to main content
Log in

B model slicing and predicate abstraction to generate tests

  • Published:
Software Quality Journal Aims and scope Submit manuscript

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.

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.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14

Similar content being viewed by others

Notes

  1. A deferred set is defined only by its name. Such a set is assumed to be finite and nonempty.

  2. see http://lifc.univ-fcomte.fr/testAndAbs/laptop.html.

  3. see http://perso.citi.insa-lyon.fr/nstouls/?ZoomSur=GeneSyst.

  4. The 90 lines length of the electrical system model, in Table 2, refers to a “verbose” version of the model, much more readable than our version of Fig. 3.

References

  • Abrial, J.-R. (1996a). Extending B without changing it (for developing distributed systems). In 1st B conference, pp. 169–190.

  • Abrial, J. -R. (1996b). The B book: Assigning programs to meanings. Cambridge: Cambridge University Press.

    Book  MATH  Google Scholar 

  • Abrial, J. -R. (2010). Modeling in event-B—system and software engineering. Cambridge: Cambridge University Press.

    MATH  Google Scholar 

  • Ball, T. (2005) A theory of predicate-complete test coverage and generation. In FMCO’04, vol. 3657 of LNCS, (pp. 1–22). Berlin: Springer.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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 

  • Ball, T., Majumdar R., Millstein, T. D., Rajamani, S. K. (2001). Automatic predicate abstraction of c programs. In PLDI, (pp. 203–213).

  • 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.

  • 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.

  • 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.

  • Cousot, Patrick, & Cousot, Radhia (1992). Abstract interpretation frameworks. Journal of Logic and Computation, 2(4), 511–547.

    Article  MathSciNet  MATH  Google Scholar 

  • 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.

    Article  Google Scholar 

  • Clarke, E. M., Grumberg, O., & Peled, D. A. (2000). Model checking. Cambridge: MIT Press.

    Google Scholar 

  • Couchot, J.-F., Giorgetti, A., & Stouls, N. (2009). Graph-based reduction of program verification conditions. In AFM’09.

  • Colon, M. A., & Uribe, T. E. (1998) Generating finite-state abstractions of reactive systems using decision procedures. In CAV’98, vol. 1427 of LNCS.

  • Dick, J., & Faivre, A. (1993). Automating the generation and sequencing of test cases from model-based specifications. In FME’93, (pp. 268–284).

  • 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).

  • 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.

  • Friedman, G., Hartman, A., Nagin, K., & Shiran,T. (2002). Projected state machine coverage for software testing. In ISSTA, (pp. 134–143).

  • Graf, S., & Saidi, H. (1997). Construction of abstract state graphs with PVS. In CAV’97, vol. 1254 of LNCS.

  • Hoare, C. A. R. (1969). An axiomatic basis for computer programming. Communications of the ACM, 10(12), 576–580.

    Article  Google Scholar 

  • Heimdahl, M. P. E., & Whalen, M. W. (1997) Reduction and slicing of hierarchical state machines. In ESEC / SIGSOFT FSE, (pp. 450–467).

  • 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.

  • 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.

  • Leuschel, M., & Butler, M. (2008). ProB: An automated analysis toolset for the B method. Software Tools for Technology Transfer, 10(2), 185–203.

    Article  Google Scholar 

  • Labbé, S., Gallois, J.-P., & Pouzet, M. (2007). Slicing communicating automata specifications for efficient model reduction. In ASWEC, (pp. 191–200).

  • Marlet, R., & Mesnil, C. (2002). Demoney: A demonstrative electronic purse. Technical Report SECSAFE-TL-007, Trusted Logic.

  • 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.

  • Sipma, H., Uribe, T., & Manna, Z. (1999). Deductive model checking. Formal Methods in System Design, 15(1), 49–74.

    Article  Google Scholar 

  • Thimbleby, H. W. (2003) The directed chinese postman problem. Software: Practice and Experience, 33(11), 1081–1096.

    Article  Google Scholar 

  • Tip, F. (1995). A survey of program slicing techniques. Journal of Programming Language, 3(3), 121–189.

    Google Scholar 

  • Utting, M., & Legeard, B. (2006). Practical model-based testing—a tools approach. Amsterdam: Elsevier Science.

    Google Scholar 

  • Weiser, Mark (1984). Program slicing. Software Engineering. IEEE Transactions on SE, 10(4), 352–357.

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to P.-A. Masson.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Julliand, J., Stouls, N., Bué, PC. et al. B model slicing and predicate abstraction to generate tests. Software Qual J 21, 127–158 (2013). https://doi.org/10.1007/s11219-011-9161-8

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11219-011-9161-8

Keywords

Navigation