Context-Oriented Behavioral Programming

Research output: Contribution to journalArticlepeer-review

Abstract

Context: Modern systems require programmers to develop code that dynamically adapts to different contexts, leading to the evolution of new context-oriented programming languages. These languages introduce new software-engineering challenges, such as: how to maintain the separation of concerns of the codebase? how to model the changing behaviors? how to verify the system behavior? and more. Objective: This paper introduces Context-Oriented Behavioral Programming (COBP) — a novel paradigm for developing context-aware systems, centered on natural and incremental specification of context-dependent behaviors. As the name suggests, we combine behavioral-programming (BP) — a scenario-based modeling paradigm — with context idioms that explicitly specify when scenarios are relevant and what information they need. The core idea is to connect the behavioral model with a data model that represents the context, allowing an intuitive connection between the models via update and select queries. Combining behavioral-programming with context-oriented programming brings the best of the two worlds, solving issues that arise when using each of the approaches in separation. Methods: We begin with providing abstract semantics for COBP and two implementations for the semantics, laying the foundations for applying reasoning algorithms to context-aware behavioral programs. Next, we exemplify the semantics with formal specifications of systems, including a variant of Conway's Game of Life. Then, we provide two case studies of real-life context-aware systems (one in robotics and another in IoT) that were developed using this tool. Throughout the examples and case studies, we provide design patterns and a methodology for coping with the above challenges. Results: The case studies show that the proposed approach is applicable for developing real-life systems, and presents measurable advantages over the alternatives — behavioral programming alone and context-oriented programming alone. Conclusion: We present a paradigm allowing programmers and system engineers to capture complex context-dependent requirements and align their code with such requirements.

Original languageAmerican English
Article number106504
JournalInformation and Software Technology
Volume133
DOIs
StatePublished - 1 May 2021

Keywords

  • Behavioral programming
  • Context awareness
  • Context-Oriented Behavioral Programming
  • Context-oriented programming
  • Programming paradigm
  • Scenario-based programming

All Science Journal Classification (ASJC) codes

  • Software
  • Information Systems
  • Computer Science Applications

Fingerprint

Dive into the research topics of 'Context-Oriented Behavioral Programming'. Together they form a unique fingerprint.

Cite this