首页 > 最新文献

Proceedings of the Tenth ACM SIGPLAN Symposium on Scala最新文献

英文 中文
Towards improved GADT reasoning in Scala 改进Scala中的GADT推理
Pub Date : 2019-07-17 DOI: 10.1145/3337932.3338813
L. Parreaux, Aleksander Boruch-Gruszecki, Paolo G. Giarrusso
Generalized algebraic data types (GADT) have been notoriously difficult to implement correctly in Scala. Both major Scala compilers, Scalac and Dotty, are currently known to have type soundness holes related to them. In particular, covariant GADTs have exposed paradoxes due to Scala's inheritance model. We informally explore foundations for GADTs within Scala's core type system, to guide a principled understanding and implementation of GADTs in Scala.
众所周知,在Scala中正确实现广义代数数据类型(GADT)非常困难。两个主要的Scala编译器,Scalac和Dotty,目前已知都有与它们相关的类型健全性漏洞。特别是,协变gdt暴露了Scala继承模型带来的矛盾。我们非正式地探索Scala核心类型系统中gadt的基础,以指导对Scala中gadt的原则性理解和实现。
{"title":"Towards improved GADT reasoning in Scala","authors":"L. Parreaux, Aleksander Boruch-Gruszecki, Paolo G. Giarrusso","doi":"10.1145/3337932.3338813","DOIUrl":"https://doi.org/10.1145/3337932.3338813","url":null,"abstract":"Generalized algebraic data types (GADT) have been notoriously difficult to implement correctly in Scala. Both major Scala compilers, Scalac and Dotty, are currently known to have type soundness holes related to them. In particular, covariant GADTs have exposed paradoxes due to Scala's inheritance model. We informally explore foundations for GADTs within Scala's core type system, to guide a principled understanding and implementation of GADTs in Scala.","PeriodicalId":436969,"journal":{"name":"Proceedings of the Tenth ACM SIGPLAN Symposium on Scala","volume":"2 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2019-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"128538908","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 5
Tests as maintainable assets via auto-generated spies: a case study involving the scala collections library's iterator trait 通过自动生成的间谍将测试作为可维护的资产:涉及scala集合库的迭代器特性的案例研究
Pub Date : 2019-07-17 DOI: 10.1145/3337932.3338814
Konstantin Läufer, John O'Sullivan, G. Thiruvathukal
In testing stateful abstractions, it is often necessary to record interactions, such as method invocations, and express assertions over these interactions. Following the Test Spy design pattern, we can reify such interactions programmatically through additional mutable state. Alternatively, a mocking framework, such as Mockito, can automatically generate test spies that allow us to record the interactions and express our expectations in a declarative domain-specific language. According to our study of the test code for Scala's Iterator trait, the latter approach can lead to a significant reduction of test code complexity in terms of metrics such as code size (in some cases over 70% smaller), cyclomatic complexity, and amount of additional mutable state required. In this tools paper, we argue that the resulting test code is not only more maintainable, readable, and intentional, but also a better stylistic match for the Scala community than manually implemented, explicitly stateful test spies.
在测试有状态抽象时,通常需要记录交互,例如方法调用,并在这些交互上表达断言。按照Test Spy设计模式,我们可以通过额外的可变状态以编程方式实现这样的交互。另外,mock框架,例如Mockito,可以自动生成测试间谍,允许我们记录交互并用声明性领域特定语言表达我们的期望。根据我们对Scala的Iterator特性的测试代码的研究,后一种方法可以显著降低测试代码的复杂性,比如代码大小(在某些情况下减少了70%以上)、圈复杂度和所需的额外可变状态的数量。在这篇关于工具的文章中,我们认为最终的测试代码不仅更具可维护性、可读性和目的性,而且比手动实现的显式有状态测试间谍更适合Scala社区的风格。
{"title":"Tests as maintainable assets via auto-generated spies: a case study involving the scala collections library's iterator trait","authors":"Konstantin Läufer, John O'Sullivan, G. Thiruvathukal","doi":"10.1145/3337932.3338814","DOIUrl":"https://doi.org/10.1145/3337932.3338814","url":null,"abstract":"In testing stateful abstractions, it is often necessary to record interactions, such as method invocations, and express assertions over these interactions. Following the Test Spy design pattern, we can reify such interactions programmatically through additional mutable state. Alternatively, a mocking framework, such as Mockito, can automatically generate test spies that allow us to record the interactions and express our expectations in a declarative domain-specific language. According to our study of the test code for Scala's Iterator trait, the latter approach can lead to a significant reduction of test code complexity in terms of metrics such as code size (in some cases over 70% smaller), cyclomatic complexity, and amount of additional mutable state required. In this tools paper, we argue that the resulting test code is not only more maintainable, readable, and intentional, but also a better stylistic match for the Scala community than manually implemented, explicitly stateful test spies.","PeriodicalId":436969,"journal":{"name":"Proceedings of the Tenth ACM SIGPLAN Symposium on Scala","volume":"289 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2019-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114201122","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
SoCRATES: Scala radar for test smells 用于测试气味的Scala雷达
Pub Date : 2019-07-17 DOI: 10.1145/3337932.3338815
Jonas De Bleser, D. D. Nucci, Coen De Roover
Test smells are indications of poorly designed unit tests. Previous studies have demonstrated their negative impact on test understanding and maintenance. Moreover, surveys show that developers are not able to identify test smells, hindering optimal software quality. Automated tools can aid developers to handle these issues and detect test smells in the early stage of software development. However, few tools are publicly available and all of them target JUnit -- the most popular testing framework in Java. To overcome these limitations, we propose SoCRATES. This fully automated tool is able to identify six test smells in Scala Test which is the most prevalent testing framework in Scala. An empirical investigation on 164 Scala projects shows that our tool is able to reach a high precision without sacrificing recall. Moreover, the results show that Scala projects have a lower diffusion than Java projects. We make SoCRATES publicly available as an IntelliJ IDEA plugin, as well as an open-source project in order to facilitate the detection of test smells.
测试气味是设计不良的单元测试的标志。先前的研究已经证明了它们对测试理解和维护的负面影响。此外,调查显示开发人员无法识别测试气味,从而阻碍了最佳的软件质量。自动化工具可以帮助开发人员处理这些问题,并在软件开发的早期阶段检测测试气味。然而,很少有工具是公开可用的,而且它们都针对JUnit——Java中最流行的测试框架。为了克服这些限制,我们提出苏格拉底。这个完全自动化的工具能够识别Scala test中的六种测试气味,Scala test是Scala中最流行的测试框架。对164个Scala项目的实证调查表明,我们的工具能够在不牺牲召回率的情况下达到高精度。此外,结果表明Scala项目比Java项目具有更低的扩散。我们将苏格拉底作为IntelliJ IDEA插件以及开源项目公开,以方便检测测试气味。
{"title":"SoCRATES: Scala radar for test smells","authors":"Jonas De Bleser, D. D. Nucci, Coen De Roover","doi":"10.1145/3337932.3338815","DOIUrl":"https://doi.org/10.1145/3337932.3338815","url":null,"abstract":"Test smells are indications of poorly designed unit tests. Previous studies have demonstrated their negative impact on test understanding and maintenance. Moreover, surveys show that developers are not able to identify test smells, hindering optimal software quality. Automated tools can aid developers to handle these issues and detect test smells in the early stage of software development. However, few tools are publicly available and all of them target JUnit -- the most popular testing framework in Java. To overcome these limitations, we propose SoCRATES. This fully automated tool is able to identify six test smells in Scala Test which is the most prevalent testing framework in Scala. An empirical investigation on 164 Scala projects shows that our tool is able to reach a high precision without sacrificing recall. Moreover, the results show that Scala projects have a lower diffusion than Java projects. We make SoCRATES publicly available as an IntelliJ IDEA plugin, as well as an open-source project in order to facilitate the detection of test smells.","PeriodicalId":436969,"journal":{"name":"Proceedings of the Tenth ACM SIGPLAN Symposium on Scala","volume":"5 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2019-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123110341","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 9
Dependent object types with implicit functions 具有隐式函数的依赖对象类型
Pub Date : 2019-07-17 DOI: 10.1145/3337932.3338811
A. Jeffery
DOT (Dependent Object Types) is an object calculus with path-dependent types and abstract type members, developed to serve as a theoretical foundation for the Scala programming language. As yet, DOT does not model all of Scala's features, but a small subset. We present the calculus DIF (DOT with Implicit Functions), which extends the set of features modelled by DOT to include implicit functions, a feature of Scala to aid modularity of programs. We show type safety of DIF, and demonstrate that the generic programming focused use cases for implicit functions in Scala are also expressible in DIF.
DOT(依赖对象类型)是一种具有路径依赖类型和抽象类型成员的对象演算,开发它是为了作为Scala编程语言的理论基础。到目前为止,DOT还没有为Scala的所有特性建模,只是一个很小的子集。我们提出了微积分DIF (DOT with隐式函数),它扩展了DOT建模的特征集,包括隐式函数,这是Scala的一个特性,有助于程序的模块化。我们展示了DIF的类型安全性,并演示了Scala中隐式函数的泛型编程用例也可以用DIF表示。
{"title":"Dependent object types with implicit functions","authors":"A. Jeffery","doi":"10.1145/3337932.3338811","DOIUrl":"https://doi.org/10.1145/3337932.3338811","url":null,"abstract":"DOT (Dependent Object Types) is an object calculus with path-dependent types and abstract type members, developed to serve as a theoretical foundation for the Scala programming language. As yet, DOT does not model all of Scala's features, but a small subset. We present the calculus DIF (DOT with Implicit Functions), which extends the set of features modelled by DOT to include implicit functions, a feature of Scala to aid modularity of programs. We show type safety of DIF, and demonstrate that the generic programming focused use cases for implicit functions in Scala are also expressible in DIF.","PeriodicalId":436969,"journal":{"name":"Proceedings of the Tenth ACM SIGPLAN Symposium on Scala","volume":"21 4","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2019-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"120902291","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 3
Effpi
Pub Date : 2019-04-18 DOI: 10.1145/3337932.3338812
A. Scalas, Nobuko Yoshida, Elias Benussi
We present Effpi: an experimental toolkit for strongly-typed concurrent and distributed programming in Dotty, with verification capabilities based on type-level model checking. Effpi addresses a main challenge in creating and maintaining concurrent programs: errors like protocol violations, deadlocks, and livelocks are often spotted late, at run-time, when applications are tested or (worse) deployed. Effpi aims at finding them early, when code is written and compiled. Effpi provides: (1) a set of Dotty classes for describing communication protocols as types; (2) an embedded DSL for concurrent programming, with process-based and actor-based abstractions; (3) a Dotty compiler plugin to verify whether protocols and programs enjoy desirable properties, such as deadlock-freedom; and (4) an efficient run-time system for executing Effpi's DSL-based programs. The combination of (1) and (2) allows the Dotty compiler to check whether an Effpi program implements a desired protocol/-type; and this, together with (3), means that many typical concurrent programming errors are found and ruled out at compile-time. Further, (4) allows to run highly concurrent Effpi programs with millions of interacting processes/actors, by scheduling them on a limited number of CPU cores. In this paper, we give an overview of Effpi, illustrate its design and main features, and discuss its future.
{"title":"Effpi","authors":"A. Scalas, Nobuko Yoshida, Elias Benussi","doi":"10.1145/3337932.3338812","DOIUrl":"https://doi.org/10.1145/3337932.3338812","url":null,"abstract":"We present Effpi: an experimental toolkit for strongly-typed concurrent and distributed programming in Dotty, with verification capabilities based on type-level model checking. Effpi addresses a main challenge in creating and maintaining concurrent programs: errors like protocol violations, deadlocks, and livelocks are often spotted late, at run-time, when applications are tested or (worse) deployed. Effpi aims at finding them early, when code is written and compiled. Effpi provides: (1) a set of Dotty classes for describing communication protocols as types; (2) an embedded DSL for concurrent programming, with process-based and actor-based abstractions; (3) a Dotty compiler plugin to verify whether protocols and programs enjoy desirable properties, such as deadlock-freedom; and (4) an efficient run-time system for executing Effpi's DSL-based programs. The combination of (1) and (2) allows the Dotty compiler to check whether an Effpi program implements a desired protocol/-type; and this, together with (3), means that many typical concurrent programming errors are found and ruled out at compile-time. Further, (4) allows to run highly concurrent Effpi programs with millions of interacting processes/actors, by scheduling them on a limited number of CPU cores. In this paper, we give an overview of Effpi, illustrate its design and main features, and discuss its future.","PeriodicalId":436969,"journal":{"name":"Proceedings of the Tenth ACM SIGPLAN Symposium on Scala","volume":"130 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2019-04-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116878377","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 12
Proceedings of the Tenth ACM SIGPLAN Symposium on Scala 第十届ACM SIGPLAN Scala研讨会论文集
Pub Date : 1900-01-01 DOI: 10.1145/3337932
{"title":"Proceedings of the Tenth ACM SIGPLAN Symposium on Scala","authors":"","doi":"10.1145/3337932","DOIUrl":"https://doi.org/10.1145/3337932","url":null,"abstract":"","PeriodicalId":436969,"journal":{"name":"Proceedings of the Tenth ACM SIGPLAN Symposium on Scala","volume":"91 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132951427","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
期刊
Proceedings of the Tenth ACM SIGPLAN Symposium on Scala
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1