Alex Gerdes, John Hughes, Nicholas Smallbone, Meng Wang
QuickCheck allows us to verify software against particular properties. A property can be regarded as an abstraction over many unit tests. QuickCheck uses generated random input data to test such properties. If a counterexample is found, it becomes immediately clear what we have tested. This is not the case when all tests pass, since we do not (and shall not) see the actual generated test cases. How can we be sure about what is tested? QuickCheck has the ability to gather statistics about the test cases, which is insightful. But still it does not tell us whether the particular unit test scenarios we have in mind are included. For this reason, we have developed a tool that can answer this question. It checks if a given unit test can be generated by a property, making it easier to judge the property's quality. We have applied our tool to an industrial use case of testing the AUTOSAR basic software modules and shows that it can handle complex models and large unit tests.
{"title":"Linking unit tests and properties","authors":"Alex Gerdes, John Hughes, Nicholas Smallbone, Meng Wang","doi":"10.1145/2804295.2804298","DOIUrl":"https://doi.org/10.1145/2804295.2804298","url":null,"abstract":"QuickCheck allows us to verify software against particular properties. A property can be regarded as an abstraction over many unit tests. QuickCheck uses generated random input data to test such properties. If a counterexample is found, it becomes immediately clear what we have tested. This is not the case when all tests pass, since we do not (and shall not) see the actual generated test cases. How can we be sure about what is tested? QuickCheck has the ability to gather statistics about the test cases, which is insightful. But still it does not tell us whether the particular unit test scenarios we have in mind are included. For this reason, we have developed a tool that can answer this question. It checks if a given unit test can be generated by a property, making it easier to judge the property's quality. We have applied our tool to an industrial use case of testing the AUTOSAR basic software modules and shows that it can handle complex models and large unit tests.","PeriodicalId":266108,"journal":{"name":"Proceedings of the 14th ACM SIGPLAN Workshop on Erlang","volume":"34 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124635694","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}
We propose a new "generic" abstraction for Erlang/OTP that aids in the implementation of dataflow programming languages and models on the Erlang VM. This abstraction simplifies the implementation of "processing elements" in dataflow languages by providing a simple callback interface in the style of the gen_server and gen_fsm abstractions. We motivate the use of this new abstraction by examining the implementation of a distributed dataflow programming variant called Lasp.
{"title":"The implementation and use of a generic dataflow behaviour in Erlang","authors":"Christopher S. Meiklejohn, P. V. Roy","doi":"10.1145/2804295.2804300","DOIUrl":"https://doi.org/10.1145/2804295.2804300","url":null,"abstract":"We propose a new \"generic\" abstraction for Erlang/OTP that aids in the implementation of dataflow programming languages and models on the Erlang VM. This abstraction simplifies the implementation of \"processing elements\" in dataflow languages by providing a simple callback interface in the style of the gen_server and gen_fsm abstractions. We motivate the use of this new abstraction by examining the implementation of a distributed dataflow programming variant called Lasp.","PeriodicalId":266108,"journal":{"name":"Proceedings of the 14th ACM SIGPLAN Workshop on Erlang","volume":"36 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"133546428","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}
Many functions take a value of a particular (recursive) data structure as input and compute an output value by traversing the structure and collect, combine, or update values in that data structure. Some examples are: collecting all hyperlink tags in a HTML tree, calculating the depth of a binary tree, or adding a prefix to every free variable name in an abstract syntax tree. When defining such functions we need to write code that takes care of traversing a data structure. This code is often repeated for functions that operate on the same data structure, and is often not essential for the operation we want to perform. This type of repetitive code is often referred to as boilerplate code. Abstraction is a way to remove this boilerplate code, for example by defining higher-order functions. Higher-order functions can be used to separate the boilerplate code from the essential parts. Common examples of higher order functions are map and fold.
{"title":"Attribute grammars in Erlang","authors":"U. Norell, Alex Gerdes","doi":"10.1145/2804295.2804296","DOIUrl":"https://doi.org/10.1145/2804295.2804296","url":null,"abstract":"Many functions take a value of a particular (recursive) data structure as input and compute an output value by traversing the structure and collect, combine, or update values in that data structure. Some examples are: collecting all hyperlink tags in a HTML tree, calculating the depth of a binary tree, or adding a prefix to every free variable name in an abstract syntax tree. When defining such functions we need to write code that takes care of traversing a data structure. This code is often repeated for functions that operate on the same data structure, and is often not essential for the operation we want to perform. This type of repetitive code is often referred to as boilerplate code. Abstraction is a way to remove this boilerplate code, for example by defining higher-order functions. Higher-order functions can be used to separate the boilerplate code from the essential parts. Common examples of higher order functions are map and fold.","PeriodicalId":266108,"journal":{"name":"Proceedings of the 14th ACM SIGPLAN Workshop on Erlang","volume":"66 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114656955","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}
We consider the problem of adapting distributed Erlang applications to large or heterogeneous architectures to achieve good performance in a portable way. In many architectures, and especially large architectures, the communication latency between pairs of virtual machines (nodes) is no longer uniform. We propose two language-level methods that enable programs to automatically adapt to heterogeneity and non-uniform communication latencies, and both provide information enabling a program to identify an appropriate node when spawning a process. We provide a means of recording node attributes describing the hardware and software capabilities of nodes, and mechanisms that allow an application to examine the attributes of remote nodes. We provide an abstraction of communication distances that enables an application to select nodes to facilitate efficient communication. We have developed open source libraries that implement these ideas. We show that the use of attributes for node selection can lead to significant performance improvements if different components of the application have different processing requirements. We report a detailed empirical investigation of non-uniform communication times in several representative architectures, and show that our abstract model provides a good description of the hierarchy of communication times.
{"title":"Performance portability through semi-explicit placement in distributed Erlang","authors":"K. Mackenzie, Natalia Chechina, P. Trinder","doi":"10.1145/2804295.2804299","DOIUrl":"https://doi.org/10.1145/2804295.2804299","url":null,"abstract":"We consider the problem of adapting distributed Erlang applications to large or heterogeneous architectures to achieve good performance in a portable way. In many architectures, and especially large architectures, the communication latency between pairs of virtual machines (nodes) is no longer uniform. We propose two language-level methods that enable programs to automatically adapt to heterogeneity and non-uniform communication latencies, and both provide information enabling a program to identify an appropriate node when spawning a process. We provide a means of recording node attributes describing the hardware and software capabilities of nodes, and mechanisms that allow an application to examine the attributes of remote nodes. We provide an abstraction of communication distances that enables an application to select nodes to facilitate efficient communication. We have developed open source libraries that implement these ideas. We show that the use of attributes for node selection can lead to significant performance improvements if different components of the application have different processing requirements. We report a detailed empirical investigation of non-uniform communication times in several representative architectures, and show that our abstract model provides a good description of the hierarchy of communication times.","PeriodicalId":266108,"journal":{"name":"Proceedings of the 14th ACM SIGPLAN Workshop on Erlang","volume":"43 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125576575","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}
This paper discusses an MC/DC analysis tool built for the Erlang programming language. Code coverage metrics are one way to measure the adequacy of a test suite, however, despite widespread industrial use in business-critical software, the only coverage metric readily available for Erlang is statement coverage, provided by the Cover tool that is distributed by the OTP standard libraries. An alternative to statement cover is Multiple Condition/Decision Coverage (MC/DC) -- one of the most extensive coverage metrics, which is mandated by many software safety standards. Here we describe the application of MC/DC analysis to Erlang programs, and include an extension to traditional MC/DC analysis that applies the underlying philosophy to the pattern matching decision structures of functional languages. We have implemented the approach in the Smother tool that we also describe here as well as its use by our industrial project partners.
{"title":"Smother: an MC/DC analysis tool for Erlang","authors":"Ramsay G. Taylor, J. Derrick","doi":"10.1145/2804295.2804297","DOIUrl":"https://doi.org/10.1145/2804295.2804297","url":null,"abstract":"This paper discusses an MC/DC analysis tool built for the Erlang programming language. Code coverage metrics are one way to measure the adequacy of a test suite, however, despite widespread industrial use in business-critical software, the only coverage metric readily available for Erlang is statement coverage, provided by the Cover tool that is distributed by the OTP standard libraries. An alternative to statement cover is Multiple Condition/Decision Coverage (MC/DC) -- one of the most extensive coverage metrics, which is mandated by many software safety standards. Here we describe the application of MC/DC analysis to Erlang programs, and include an extension to traditional MC/DC analysis that applies the underlying philosophy to the pattern matching decision structures of functional languages. We have implemented the approach in the Smother tool that we also describe here as well as its use by our industrial project partners.","PeriodicalId":266108,"journal":{"name":"Proceedings of the 14th ACM SIGPLAN Workshop on Erlang","volume":"30 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132272522","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}
{"title":"Proceedings of the 14th ACM SIGPLAN Workshop on Erlang","authors":"Hans Svensson, M. Tóth","doi":"10.1145/2804295","DOIUrl":"https://doi.org/10.1145/2804295","url":null,"abstract":"","PeriodicalId":266108,"journal":{"name":"Proceedings of the 14th ACM SIGPLAN Workshop on Erlang","volume":"58 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130792603","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}