Mystery functions: making specifications, unit tests, and implementations coexist in the mind of undergraduate students

O. Danvy
{"title":"Mystery functions: making specifications, unit tests, and implementations coexist in the mind of undergraduate students","authors":"O. Danvy","doi":"10.1145/3412932.3412934","DOIUrl":null,"url":null,"abstract":"This article documents how to make the concepts of specification, properties of specifications, unit tests, soundness of unit tests, implementation, and satisfaction coexist correctly, harmoniously, and effectively in the mind of undergraduate students, using an off-the-shelf proof assistant. The concepts are instilled through a family of puzzles: given the specification of a mystery function (i.e., conditions this function should satisfy), which functions---if any---satisfy this specification? Each puzzle is solved using a combination of informal induction (as in machine learning), structural recursion (to implement the function), and formal induction (to prove satisfaction), and in a consolidating way such that each concept has a place that makes sense, instead of being perceived as vague, alien, arbitrary, and irreproducible. The eureka moment that concludes each informal induction and the subsequent formal induction that confirms that the student was right make mystery functions rewarding, and repetition makes them addictive. Mystery functions can also be used as a vector for expansion as well as for reflection.","PeriodicalId":235054,"journal":{"name":"Proceedings of the 31st Symposium on Implementation and Application of Functional Languages","volume":"92 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 31st Symposium on Implementation and Application of Functional Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3412932.3412934","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

This article documents how to make the concepts of specification, properties of specifications, unit tests, soundness of unit tests, implementation, and satisfaction coexist correctly, harmoniously, and effectively in the mind of undergraduate students, using an off-the-shelf proof assistant. The concepts are instilled through a family of puzzles: given the specification of a mystery function (i.e., conditions this function should satisfy), which functions---if any---satisfy this specification? Each puzzle is solved using a combination of informal induction (as in machine learning), structural recursion (to implement the function), and formal induction (to prove satisfaction), and in a consolidating way such that each concept has a place that makes sense, instead of being perceived as vague, alien, arbitrary, and irreproducible. The eureka moment that concludes each informal induction and the subsequent formal induction that confirms that the student was right make mystery functions rewarding, and repetition makes them addictive. Mystery functions can also be used as a vector for expansion as well as for reflection.
神秘的功能:制定规范、单元测试和实现在本科生的脑海中共存
本文记录了如何使用现成的证明助手,使规范的概念、规范的属性、单元测试、单元测试的可靠性、实现和满意度在本科生的头脑中正确、和谐和有效地共存。这些概念是通过一系列谜题来灌输的:给定一个神秘函数的说明(即,这个函数应该满足的条件),哪些函数(如果有的话)满足这个说明?每个谜题都是使用非正式归纳法(如机器学习)、结构递归法(实现功能)和形式归纳法(证明满意度)的组合来解决的,并且以一种整合的方式,使每个概念都有一个有意义的地方,而不是被认为是模糊的、陌生的、任意的和不可复制的。每次非正式归纳结束时的顿悟时刻,以及随后确认学生正确的正式归纳,使神秘功能变得有益,而重复使它们上瘾。神秘函数也可以用作展开和反射的向量。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信