Skip to main content

Stateful Dynamic Partial Order Reduction for Model Checking Event-Driven Applications that Do Not Terminate

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 13182)

Abstract

Event-driven architectures are broadly used for systems that must respond to events in the real world. Event-driven applications are prone to concurrency bugs that involve subtle errors in reasoning about the ordering of events. Unfortunately, there are several challenges in using existing model-checking techniques on these systems. Event-driven applications often loop indefinitely and thus pose a challenge for stateless model checking techniques. On the other hand, deploying purely stateful model checking can explore large sets of equivalent executions.

In this work, we explore a new technique that combines dynamic partial order reduction with stateful model checking to support non-terminating applications. Our work is (1) the first dynamic partial order reduction algorithm for stateful model checking that is sound for non-terminating applications and (2) the first dynamic partial reduction algorithm for stateful model checking of event-driven applications. We experimented with the IoTCheck dataset—a study of interactions in smart home app pairs. This dataset consists of app pairs originated from 198 real-world smart home apps. Overall, our DPOR algorithm successfully reduced the search space for the app pairs, enabling 69 pairs of apps that did not finish without DPOR to finish and providing a 7\(\times \) average speedup.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-030-94583-1_20
  • Chapter length: 25 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
eBook
USD   79.99
Price excludes VAT (USA)
  • ISBN: 978-3-030-94583-1
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   99.99
Price excludes VAT (USA)
Fig. 1.
Fig. 2.
Fig. 3.
Fig. 4.
Fig. 5.

References

  1. Lock it when i leave (2015). https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/61b864535321a6f61cf5a77216f1e779bde68bd5/smartapps/smartthings/lock-it-when-i-leave.src/lock-it-when-i-leave.groovy

  2. Abdulla, P., Aronis, S., Jonsson, B., Sagonas, K.: Optimal dynamic partial order reduction. In: Proceedings of the 2014 Symposium on Principles of Programming Languages, pp. 373–384 (2014). http://doi.acm.org/10.1145/2535838.2535845

  3. Abdulla, P.A., Aronis, S., Atig, M.F., Jonsson, B., Leonardsson, C., Sagonas, K.: Stateless model checking for TSO and PSO. In: Proceedings of the 21st International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 353–367 (2015). http://link.springer.com/chapter/10.1007

  4. Abdulla, P.A., Atig, M.F., Jonsson, B., Ngo, T.P.: Optimal stateless model checking under the release-acquire semantics. Proc. ACM Program. Lang. 2(OOPSLA) (2018). https://doi.org/10.1145/3276505

  5. Burckhardt, S., Alur, R., Martin, M.M.K.: CheckFence: checking consistency of concurrent data types on relaxed memory models. In: Proceedings of the 2007 Conference on Programming Language Design and Implementation, pp. 12–21 (2007). http://doi.acm.org/10.1145/1250734.1250737

  6. Chatterjee, K., Pavlogiannis, A., Toman, V.: Value-centric dynamic partial order reduction. Proc. ACM Program. Lang. 3(OOPSLA) (2019). https://doi.org/10.1145/3360550

  7. Clarke, E.M., Grumberg, O., Minea, M., Peled, D.: State space reduction using partial order techniques. Int. J. Softw. Tools Technol. Transf. 2(3), 279–287 (1999)

    CrossRef  Google Scholar 

  8. Clarke Jr, E.M., Grumberg, O., Peled, D.: Model Checking. MIT press, Cambridge (1999)

    Google Scholar 

  9. Demsky, B., Lam, P.: SATCheck: SAT-directed stateless model checking for SC and TSO. In: Proceedings of the 2015 Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 20–36 (October 2015). http://doi.acm.org/10.1145/2814270.2814297

  10. Desai, A., Qadeer, S., Seshia, S.A.: Systematic testing of asynchronous reactive systems. In: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, pp. 73–83 (2015)

    Google Scholar 

  11. Dwyer, M.B., Hatcliff, J.: Bogor: an extensible and highly-modular software model checking framework. ACM SIGSOFT Softw. Eng. Notes 28(5), 267–276 (2003)

    CrossRef  Google Scholar 

  12. Flanagan, C., Godefroid, P.: Dynamic partial-order reduction for model checking software. ACM Sigplan Not. 40(1), 110–121 (2005)

    CrossRef  Google Scholar 

  13. Godefroid, P.: Partial-Order Methods for the Verification of Concurrent Systems: An Approach to the State-Explosion Problem. Springer-Verlag, Berlin, Heidelberg (1996)

    CrossRef  Google Scholar 

  14. Godefroid, P.: Model checking for programming languages using verisoft. In: Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 174–186 (1997)

    Google Scholar 

  15. Godefroid, P.: Software model checking: the verisoft approach. Form. Methods Syst. Des. 26(2), 77–101 (2005)

    CrossRef  Google Scholar 

  16. Google: Android things website (2015). https://developer.android.com/things/

  17. Gueta, G., Flanagan, C., Yahav, E., Sagiv, M.: Cartesian partial-order reduction. In: Bošnački, D., Edelkamp, S. (eds.) SPIN 2007. LNCS, vol. 4595, pp. 95–112. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73370-6_8

    CrossRef  Google Scholar 

  18. Holzmann, G.J.: The SPIN Model Checker: Primer and Reference Manual, vol. 1003 (2003)

    Google Scholar 

  19. Huang, J.: Stateless model checking concurrent programs with maximal causality reduction. In: Proceedings of the 2015 Conference on Programming Language Design and Implementation, pp. 165–174 (2015). http://doi.acm.org/10.1145/2813885.2737975

  20. Huang, S., Huang, J.: Maximal causality reduction for TSO and PSO. In: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 447–461 (2016). http://doi.acm.org/10.1145/2983990.2984025

  21. IFTTT: IFTTT (September 2011). https://www.ifttt.com/

  22. Jensen, C.S., Møller, A., Raychev, V., Dimitrov, D., Vechev, M.: Stateless model checking of event-driven applications. ACM SIGPLAN Not. 50(10), 57–73 (2015)

    CrossRef  Google Scholar 

  23. Katz, S., Peled, D.: Defining conditional independence using collapses. Theor. Comput. Sci. 101(2), 337–359 (1992)

    CrossRef  MathSciNet  Google Scholar 

  24. Kokologiannakis, M., Lahav, O., Sagonas, K., Vafeiadis, V.: Effective stateless model checking for C/C++ concurrency. Proc. ACM Program. Lang. 2(POPL) (2017). https://doi.org/10.1145/3158105

  25. Kokologiannakis, M., Raad, A., Vafeiadis, V.: Effective lock handling in stateless model checking. Proc. ACM Program. Lang. 3(OOPSLA) (2019). https://doi.org/10.1145/3360599

  26. Lauterburg, S., Karmani, R.K., Marinov, D., Agha, G.: Evaluating ordering heuristics for dynamic partial-order reduction techniques. In: Rosenblum, D.S., Taentzer, G. (eds.) FASE 2010. LNCS, vol. 6013, pp. 308–322. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-12029-9_22

    CrossRef  Google Scholar 

  27. Li, X., Zhang, L., Shen, X.: IA-graph based inter-app conflicts detection in open IoT systems. In: Proceedings of the 20th ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded Systems, pp. 135–147 (2019)

    Google Scholar 

  28. Li, X., Zhang, L., Shen, X., Qi, Y.: A systematic examination of inter-app conflicts detections in open IoT systems. Technical report TR-2017-1, North Carolina State University, Dept. of Computer Science (2017)

    Google Scholar 

  29. Loring, M.C., Marron, M., Leijen, D.: Semantics of asynchronous Javascript. In: Proceedings of the 13th ACM SIGPLAN International Symposium on on Dynamic Languages, pp. 51–62 (2017)

    Google Scholar 

  30. Maiya, P., Gupta, R., Kanade, A., Majumdar, R.: Partial order reduction for event-driven multi-threaded programs. In: Proceedings of the 22nd International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS 16) (2016)

    Google Scholar 

  31. Mazurkiewicz, A.: Trace theory. In: Brauer, W., Reisig, W., Rozenberg, G. (eds.) ACPN 1986. LNCS, vol. 255, pp. 278–324. Springer, Heidelberg (1987). https://doi.org/10.1007/3-540-17906-2_30

    CrossRef  Google Scholar 

  32. Musuvathi, M., Park, D.Y., Chou, A., Engler, D.R., Dill, D.L.: CMC: a pragmatic approach to model checking real code. ACM SIGOPS Oper. Syst. Rev. 36(SI), 75–88 (2002)

    Google Scholar 

  33. Musuvathi, M., Qadeer, S., Ball, T.: Chess: a systematic testing tool for concurrent software (2007)

    Google Scholar 

  34. Noonan, E., Mercer, E., Rungta, N.: Vector-clock based partial order reduction for JPF. SIGSOFT Softw. Eng. Notes 39(1), 1–5 (2014)

    CrossRef  Google Scholar 

  35. openHAB: openhab website (2010). https://www.openhab.org/

  36. Ozkan, B.K., Emmi, M., Tasiran, S.: Systematic asynchrony bug exploration for android apps. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 455–461. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21690-4_28

    CrossRef  Google Scholar 

  37. Peled, D.: Combining partial order reductions with on-the-fly model-checking. In: Proceedings of the International Conference on Computer Aided Verification, pp. 377–390 (1994)

    Google Scholar 

  38. Racine, Y.: Fireco2alarm smartapp (2014). https://github.com/yracine/device-type.myecobee/blob/master/smartapps/FireCO2Alarm.src/FireCO2Alarm.groovy

  39. Racine, Y.: grovestreams smartapp (2014). https://github.com/uci-plrg/iotcheck/blob/master/smartapps/groveStreams.groovy

  40. Rodríguez, C., Sousa, M., Sharma, S., Kroening, D.: Unfolding-based partial order reduction. In: CONCUR (2015)

    Google Scholar 

  41. Saarikivi, O., Kähkönen, K., Heljanko, K.: Improving dynamic partial order reductions for concolic testing. In: 2012 12th International Conference on Application of Concurrency to System Design, pp. 132–141. IEEE (2012)

    Google Scholar 

  42. Sen, K., Agha, G.: Automated systematic testing of open distributed programs. In: Baresi, L., Heckel, R. (eds.) FASE 2006. LNCS, vol. 3922, pp. 339–356. Springer, Heidelberg (2006). https://doi.org/10.1007/11693017_25

    CrossRef  Google Scholar 

  43. Sen, K., Agha, G.: A race-detection and flipping algorithm for automated testing of multi-threaded programs. In: Bin, E., Ziv, A., Ur, S. (eds.) HVC 2006. LNCS, vol. 4383, pp. 166–182. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-70889-6_13

    CrossRef  Google Scholar 

  44. SmartThings: Device handlers (2018). https://docs.smartthings.com/en/latest/device-type-developers-guide/

  45. SmartThings: Smartthings public github repo (2018). https://github.com/SmartThingsCommunity/SmartThingsPublic

  46. SmartThings, S.: Samsung smartthings website (2012). http://www.smartthings.com

  47. Tasharofi, S., Karmani, R.K., Lauterburg, S., Legay, A., Marinov, D., Agha, G.: TransDPOR: a novel dynamic partial-order reduction technique for testing actor programs. In: Giese, H., Rosu, G. (eds.) FMOODS/FORTE -2012. LNCS, vol. 7273, pp. 219–234. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-30793-5_14

    CrossRef  Google Scholar 

  48. Trimananda, R., Aqajari, S.A.H., Chuang, J., Demsky, B., Xu, G.H., Lu, S.: Iotcheck supporting materials (2020). https://github.com/uci-plrg/iotcheck-data/tree/master/Device

  49. Trimananda, R., Aqajari, S.A.H., Chuang, J., Demsky, B., Xu, G.H., Lu, S.: Understanding and automatically detecting conflicting interactions between smart home IoT applications. In: Proceedings of the ACM SIGSOFT International Symposium on Foundations of Software Engineering (November 2020)

    Google Scholar 

  50. Trimananda, R., Luo, W., Demsky, B., Xu, G.H.: Iotcheck dpor (2021). https://github.com/uci-plrg/iotcheck-dpor, https://doi.org/10.5281/zenodo.5168843, https://zenodo.org/record/5168843#.YQ8KjVNKh6c

  51. Trimananda, R., Luo, W., Demsky, B., Xu, G.H.: Stateful dynamic partial order reduction for model checking event-driven applications that do not terminate. arXiv preprint arXiv:2111.05290 (2021)

  52. Valmari, A.: A stubborn attack on state explosion. In: Clarke, E.M., Kurshan, R.P. (eds.) CAV 1990. LNCS, vol. 531, pp. 156–165. Springer, Heidelberg (1991). https://doi.org/10.1007/BFb0023729

    CrossRef  Google Scholar 

  53. Valmari, A.: Stubborn sets for reduced state space generation. In: Rozenberg, G. (ed.) ICATPN 1989. LNCS, vol. 483, pp. 491–515. Springer, Heidelberg (1991). https://doi.org/10.1007/3-540-53863-1_36

    CrossRef  Google Scholar 

  54. Vicaire, P.A., Hoque, E., Xie, Z., Stankovic, J.A.: Bundle: a group-based programming abstraction for cyber-physical systems. IEEE Trans. Ind. Inf. 8(2), 379–392 (2012)

    CrossRef  Google Scholar 

  55. Vicaire, P.A., Xie, Z., Hoque, E., Stankovic, J.A.: Physicalnet: a generic framework for managing and programming across pervasive computing networks. In: Real-Time and Embedded Technology and Applications Symposium (RTAS), 2010 16th IEEE, pp. 269–278. IEEE (2010)

    Google Scholar 

  56. Visser, W., Havelund, K., Brat, G., Park, S., Lerda, F.: Model checking programs 10, 203–232 (2003)

    Google Scholar 

  57. Wang, C., Yang, Yu., Gupta, A., Gopalakrishnan, G.: Dynamic model checking with property driven pruning to detect race conditions. In: Cha, S.S., Choi, J.-Y., Kim, M., Lee, I., Viswanathan, M. (eds.) ATVA 2008. LNCS, vol. 5311, pp. 126–140. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-88387-6_11

    CrossRef  Google Scholar 

  58. Wood, A.D., et al.: Context-aware wireless sensor networks for assisted living and residential monitoring. IEEE Netw. 22(4) (2008)

    Google Scholar 

  59. Yagita, M., Ishikawa, F., Honiden, S.: An application conflict detection and resolution system for smart homes. In: Proceedings of the First International Workshop on Software Engineering for Smart Cyber-Physical Systems, pp. 33–39. SEsCPS 2015, IEEE Press, Piscataway, NJ, USA (2015). http://dl.acm.org/citation.cfm?id=2821404.2821413

  60. Yang, Y., Chen, X., Gopalakrishnan, G., Kirby, R.M.: Distributed dynamic partial order reduction based verification of threaded software. In: Proceedings of the 14th International SPIN Conference on Model Checking Software, pp. 58–75 (2007)

    Google Scholar 

  61. Yang, Yu., Chen, X., Gopalakrishnan, G., Kirby, R.M.: Efficient stateful dynamic partial order reduction. In: Havelund, K., Majumdar, R., Palsberg, J. (eds.) SPIN 2008. LNCS, vol. 5156, pp. 288–305. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-85114-1_20

    CrossRef  Google Scholar 

  62. Yang, Y., Chen, X., Gopalakrishnan, G., Wang, C.: Automatic discovery of transition symmetry in multithreaded programs using dynamic analysis. In: Proceedings of the 16th International SPIN Workshop on Model Checking Software, pp. 279–295 (2009)

    Google Scholar 

  63. Yi, X., Wang, J., Yang, X.: Stateful dynamic partial-order reduction. In: Liu, Z., He, J. (eds.) ICFEM 2006. LNCS, vol. 4260, pp. 149–167. Springer, Heidelberg (2006). https://doi.org/10.1007/11901433_9

    CrossRef  Google Scholar 

  64. Zhang, N., Kusano, M., Wang, C.: Dynamic partial order reduction for relaxed memory models. In: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 250–259 (2015). http://doi.acm.org/10.1145/2737924.2737956

Download references

Acknowledgment

We would like to thank our anonymous reviewers for their thorough comments and feedback. This project was supported partly by the National Science Foundation under grants CCF-2006948, CCF-2102940, CNS-1703598, CNS-1763172, CNS-1907352, CNS-2006437, CNS-2007737, CNS-2106838, CNS-2128653, OAC-1740210 and by the Office of Naval Research under grant N00014-18-1-2037.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rahmadi Trimananda .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

Trimananda, R., Luo, W., Demsky, B., Xu, G.H. (2022). Stateful Dynamic Partial Order Reduction for Model Checking Event-Driven Applications that Do Not Terminate. In: Finkbeiner, B., Wies, T. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2022. Lecture Notes in Computer Science(), vol 13182. Springer, Cham. https://doi.org/10.1007/978-3-030-94583-1_20

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-94583-1_20

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-94582-4

  • Online ISBN: 978-3-030-94583-1

  • eBook Packages: Computer ScienceComputer Science (R0)