-
Example-driven development: bridging tests and documentation
Authors:
Oscar Nierstrasz,
Andrei Chiş,
Tudor Gîrba
Abstract:
Software systems should be explainable, that is, they should help us to answer questions while exploring, developing or using them. Textual documentation is a very weak form of explanation, since it is not causally connected to the code, so easily gets out of date. Tests, on the other hand, are causally connected to code, but they are also a weak form of explanation. Although some tests encode int…
▽ More
Software systems should be explainable, that is, they should help us to answer questions while exploring, developing or using them. Textual documentation is a very weak form of explanation, since it is not causally connected to the code, so easily gets out of date. Tests, on the other hand, are causally connected to code, but they are also a weak form of explanation. Although some tests encode interesting scenarios that answer certain questions about how the system works, most tests don't make interesting reading. Examples are tests that are also factories for interesting system entities. Instead of simply succeeding or failing, an example returns the object under test so that it can be inspected, or reused to compose further tests. An example is causally connected to the system, is always live and tested, and can be embedded into live documentation. Although technically examples constitute just a small change to the way that to test methods work, their impact is potentially ground-breaking. We show (i) how Example-Driven Development (EDD) enriches TDD with live programming, (ii) how examples can be molded with tiny tools to answer analysis questions, and (iii) how examples can be embedded within live documentation to make a system explainable.
△ Less
Submitted 31 August, 2024;
originally announced September 2024.
-
Moldable Exceptions
Authors:
Andrei Chiş,
Tudor Gîrba,
Oscar Nierstrasz
Abstract:
Debugging is hard. Interactive debuggers are mostly the same. They show you a stack, a way to sample the state of the stack, and, if the debugger is live, a way to step through execution. The standard interactive debugger for a general-purpose programming language provided by a mainstream IDE mostly offers a low-level interface in terms of generic language constructs to track down and fix bugs. A…
▽ More
Debugging is hard. Interactive debuggers are mostly the same. They show you a stack, a way to sample the state of the stack, and, if the debugger is live, a way to step through execution. The standard interactive debugger for a general-purpose programming language provided by a mainstream IDE mostly offers a low-level interface in terms of generic language constructs to track down and fix bugs. A custom debugger, such as those developed for specific application domains, offers alternative interfaces more suitable to the specific execution context of the program being debugged. Custom debuggers offering contextual debugging views and actions can greatly improve our ability to reason about the current problem. Implementing such custom debuggers, however, is non-trivial, and poses a barrier to improving the debugging experience. In this paper we introduce "moldable exceptions", a lightweight mechanism to adapt a debugger's interface based on contextual information provided by a raised exception. We present, through a series of examples, how moldable exceptions can enhance a live programming environment.
△ Less
Submitted 31 August, 2024;
originally announced September 2024.
-
Simulation, Modelling and Classification of Wiki Contributors: Spotting The Good, The Bad, and The Ugly
Authors:
Silvia García Méndez,
Fátima Leal,
Benedita Malheiro,
Juan Carlos Burguillo Rial,
Bruno Veloso,
Adriana E. Chis,
Horacio González Vélez
Abstract:
Data crowdsourcing is a data acquisition process where groups of voluntary contributors feed platforms with highly relevant data ranging from news, comments, and media to knowledge and classifications. It typically processes user-generated data streams to provide and refine popular services such as wikis, collaborative maps, e-commerce sites, and social networks. Nevertheless, this modus operandi…
▽ More
Data crowdsourcing is a data acquisition process where groups of voluntary contributors feed platforms with highly relevant data ranging from news, comments, and media to knowledge and classifications. It typically processes user-generated data streams to provide and refine popular services such as wikis, collaborative maps, e-commerce sites, and social networks. Nevertheless, this modus operandi raises severe concerns regarding ill-intentioned data manipulation in adversarial environments. This paper presents a simulation, modelling, and classification approach to automatically identify human and non-human (bots) as well as benign and malign contributors by using data fabrication to balance classes within experimental data sets, data stream modelling to build and update contributor profiles and, finally, autonomic data stream classification. By employing WikiVoyage - a free worldwide wiki travel guide open to contribution from the general public - as a testbed, our approach proves to significantly boost the confidence and quality of the classifier by using a class-balanced data stream, comprising both real and synthetic data. Our empirical results show that the proposed method distinguishes between benign and malign bots as well as human contributors with a classification accuracy of up to 92 %.
△ Less
Submitted 29 May, 2024;
originally announced May 2024.
-
Coalitional game based cost optimization of energy portfolio in smart grid communities
Authors:
Adriana Chis,
Visa Koivunen
Abstract:
In this paper we propose two novel coalitional game theory based optimization methods for minimizing the cost of electricity consumed by households from a smart community. Some households in the community may own renewable energy systems (RESs) conjoined with energy storing systems (ESSs). Some other residences own ESSs only, while the remaining households are simple energy consumers. We first pro…
▽ More
In this paper we propose two novel coalitional game theory based optimization methods for minimizing the cost of electricity consumed by households from a smart community. Some households in the community may own renewable energy systems (RESs) conjoined with energy storing systems (ESSs). Some other residences own ESSs only, while the remaining households are simple energy consumers. We first propose a coalitional cost optimization method in which RESs and ESSs owners exchange energy and share their renewable energy and storage spaces. We show that by participating in the proposed game these households may considerably reduce their costs in comparison to performing individual cost optimization. We further propose another coalitional optimization model in which RESs and ESSs owning households not only share their resources, but also sell energy to simple energy consuming households. We show that through this energy trade the RESs and ESSs owners can further reduce their costs, while the simple energy consumers also gain cost savings. The monetary revenues gained by the coalition are distributed among its members according to the Shapley value. Simulation examples show that the proposed coalitional optimization methods may reduce the electricity costs for the RESs and ESSs owning households by 20%, while the sole energy consumers may reduce their costs by 5%.
△ Less
Submitted 11 May, 2017;
originally announced May 2017.