In this essay, we explore a new pedagogical framing ofway of pedagogically and teaching the Liskov Substitution Principle (LSP). In addition to, or perhaps even in place of, teaching the specifics of the rule itself, we advocatepropose teaching an operationalised version of the rule: that a subtype must pass its supertype’s black box tests for each of its overriding methods. We leverage the fact that black box tests should be written to capture conformance to a specification without overfitting or checking implementation internalsdetails (as would be checked by glass box tests). A type that violates the rules of substitutability will also fail a potential corresponding black box test for the supertype. Additionally, we argue that the over-strict nature of the classical LSP Postcondition Rule (which has been improved in subsequent work) can be a source of confusion for both instructors and for students learning this crucial concept for the first time. Pleasingly, many of the technical subtleties of this nuanced but important concept drop out naturally when thinking of substitutability via black box tests. Thus we put forward We propose that this test-oriented means of teaching substitutability is a valuable alternative to the classical sense of checking the LSP, with the benefit of being intuitively accessible to students.
{"title":"Reframing the Liskov substitution principle through the lens of testing","authors":"E. Baniassad, Alexander J. Summers","doi":"10.1145/3484272.3484965","DOIUrl":"https://doi.org/10.1145/3484272.3484965","url":null,"abstract":"In this essay, we explore a new pedagogical framing ofway of pedagogically and teaching the Liskov Substitution Principle (LSP). In addition to, or perhaps even in place of, teaching the specifics of the rule itself, we advocatepropose teaching an operationalised version of the rule: that a subtype must pass its supertype’s black box tests for each of its overriding methods. We leverage the fact that black box tests should be written to capture conformance to a specification without overfitting or checking implementation internalsdetails (as would be checked by glass box tests). A type that violates the rules of substitutability will also fail a potential corresponding black box test for the supertype. Additionally, we argue that the over-strict nature of the classical LSP Postcondition Rule (which has been improved in subsequent work) can be a source of confusion for both instructors and for students learning this crucial concept for the first time. Pleasingly, many of the technical subtleties of this nuanced but important concept drop out naturally when thinking of substitutability via black box tests. Thus we put forward We propose that this test-oriented means of teaching substitutability is a valuable alternative to the classical sense of checking the LSP, with the benefit of being intuitively accessible to students.","PeriodicalId":159099,"journal":{"name":"Proceedings of the 2021 ACM SIGPLAN International Symposium on SPLASH-E","volume":"5 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126489284","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}
Compilers are large software systems. In course projects it is often a challenge for students to build a significant compiler on their own with features like memory management, closures, inheritance, and more. We report on our experience splitting a relatively large compiler, with several of these advanced features, among project groups in a graduate compilers course. In addition to allowing students to engage with a larger system than groups would have been able to build on their own, we also believe based on anecdotal feedback that this had positive effects on student morale and community. There were several concrete logistics and content decisions we made that were effective, along with other recommendations and refinements for when we run the course again.
{"title":"Course experience report: full-class compiler collaboration","authors":"J. Politz, Yousef Alhessi","doi":"10.1145/3484272.3484961","DOIUrl":"https://doi.org/10.1145/3484272.3484961","url":null,"abstract":"Compilers are large software systems. In course projects it is often a challenge for students to build a significant compiler on their own with features like memory management, closures, inheritance, and more. We report on our experience splitting a relatively large compiler, with several of these advanced features, among project groups in a graduate compilers course. In addition to allowing students to engage with a larger system than groups would have been able to build on their own, we also believe based on anecdotal feedback that this had positive effects on student morale and community. There were several concrete logistics and content decisions we made that were effective, along with other recommendations and refinements for when we run the course again.","PeriodicalId":159099,"journal":{"name":"Proceedings of the 2021 ACM SIGPLAN International Symposium on SPLASH-E","volume":"11 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126409308","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 2021 ACM SIGPLAN International Symposium on SPLASH-E","authors":"","doi":"10.1145/3484272","DOIUrl":"https://doi.org/10.1145/3484272","url":null,"abstract":"","PeriodicalId":159099,"journal":{"name":"Proceedings of the 2021 ACM SIGPLAN International Symposium on SPLASH-E","volume":"8 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132724418","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}