BOOP: Write Right Code
Vaani Goenka, Aalok D. Thakkar · 2025
Read BOOP: Write Right Code by Vaani Goenka, Aalok D. Thakkar (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-22085.txt.
Introduction
Vaani Goenka and Aalok Thakkar present a teaching method that puts correct reasoning before code, in a 2025 paper. Beginners often write code first and tweak it until tests pass, with little grasp of why it works. AI coding tools make this worse by handing over neat code built on shaky ideas.
Their method, BOOP, forces four steps in order: state the problem formally, design the steps in plain terms, write the code in OCaml, and prove it right. A classroom tool at Ashoka University enforces the steps. Early results show sharper reasoning and less trial-and-error fixing. Students found the format wordy at first, but teachers saw stronger basic skills.
Catalog record
| CREATOR | Vaani Goenka, Aalok D. Thakkar |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 42 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2507-22085
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
BOOP: Write Right Code Vaani Goenka, Aalok D. Thakkar Abstract Novice programmers frequently adopt a syntax-specific and test-case-driven approach, writing code first and adjusting until programs compile and test cases pass, rather than developing correct solutions through systematic reasoning. AI coding tools exacerbate this challenge by providing syntactically correct but conceptually flawed solutions. In this paper, we introduce BOOP (Blueprint, Operations, OCaml, Proof), a structured framework requiring four mandatory phases: formal specification, language-agnostic algorithm development, implementation, and correctness proof. This shifts focus from “making code work” to understanding why code is correct. BOOP was implemented at our institution using a VS Code extension and preprocessor that enforces constraints and identifies counterproductive patterns. Initial evaluation shows improved algorithmic reasoning and reduced trial-and-error debugging. Students reported better edge case understanding and problem decomposition, though some initially found the format verbose. Instructors observed stronger foundational skills compared to traditional approaches. 1 Introduction Computer Science, at its core, is a discipline of abstraction, logic, and problem-solving. Writing code is a powerful way to express these ideas. Yet, we frequently note that students beginning their journey in computer science at our institution conflate the tool with the discipline and adopt a predominantly program-centric mindset. This manifests in several ways: students incorrectly confuse the expected behaviour of the program on a small set of test cases with total functional correctness, attempt to mechanically patch incorrect programs instead of reasoning from first principles, and develop a syntax-specific mindset in programming. It has been observed that students even tend to overestimate their understanding of program constructions [ 25 ] . This is reflected in students’ prioritisation of coding a solution over understanding the underlying algorithm. Roundabout approaches often result in students only being able to consider test cases that are over-fitted to their code, disregarding the problem’s specifications and total functional correctness. This is more prominent in the age of AI-based programming tools and co-pilots. Students unfamiliar with the computational thinking process are tempted to consult language models for answers to programming problems [ 34 ] . However, language models churn out poor-quality code, and sometimes even inaccurate statements, which leads to unfit programming practices [ 33 , 3 ] . This recursively worsens the student’s skill in and outlook on programming. Students also develop misconceptions about the necessity of learning problem-solving skills when LLMs could generate solutions for them, and even trust LLMs much more than LLMs’ actual accuracy calls for [ 33 ] . The ACM 2023 guidelines for undergraduate computer science education explicitly recommend instruction in proof-writing and correctness verification, including loop invariant application for algorithm correctness and inductive methods for recursive algorithm analysis [ 20 ] . It is imperative to shift the focus in introductory CS courses from ‘writing a program’ to ‘writing right programs.’ This paper explores how instructors can adopt a novel computer science pedagogy paradigm that promotes accurate best-practice programming by design. 2 Related Work Computing education research has extensively documented the challenges students face when learning introductory programming. Research indicates that these difficulties stem not only from the conceptual complexity of programming constructs but also from significant barriers in the practical application of programming knowledge [ 25 ] . Students step in with preconceptions about programming difficulty or develop negative attitudes early in their learning journey, leading to ineffective learning approaches such as rote memorization and, in some cases, academic dishonesty. A common pedagogical intervention is reducing extraneous cognitive load while preserving the essential problem-solving aspects of programming instruction. Constrained environments like mini-languages (turtle graphics) and block-based systems (MIT’s LogoBlocks [ 4 ] ) mimic basic programming concepts like achieving a goal by breaking it down into a correct sequence of instructions. These approaches use syntactic constraints as scaffolding and support “hybrid programming environments that blend block-based and text-based tools” [ 37 ] . Visualization tools and other adaptive systems offer personalized feedback on simplified representations of problem-solving, objects, and functions [ 14 , 7 , 18 ] . However, fundamental programming concepts must not be over-abstracted such that application and formalization become disconnected. While referential frameworks can provide an initial conceptual understanding, students’ learning and evaluation should be guided by a more robust and well-structured system that comprises both formal and informal methods. 2.1 Functional Programming Education Research identifies the most challenging aspects of programming for students as: (1) debugging programs, (2) designing programs to solve specific problems, and (3) decomposing functionality into procedures, all of which are fundamental to functional programming [ 25 , 15 ] . Additionally, students reported that 2 of their top 3 difficulties were error handling and recursion. Moreover, instructors highlighted the need for more problem-solving-oriented pedagogical materials [ 25 , 16 ] . On the topic of problem-solving, Hudak, a pioneer of the International Haskell Committee, emphasizes the importance of developing problem specifications before implementation details while acknowledging the need for effective compilation techniques to make functional languages practical for education [ 19 ] . These are key ideas that guide our research. 2.2 AI and CS Pedagogy Recent research has examined the intersection of artificial intelligence tools and functional programming education, revealing significant pedagogical challenges. While large language models perform well with high-resource languages like Python, their capabilities with low-resource languages such as OCaml remain limited [ 6 ] . Even when ChatGPT provides correct solutions to functional programming problems in OCaml 68% of the time, only half of these solutions are pedagogically valuable or "benefit students in some form" [ 33 ] . Pedagogy can leverage the fact that ChatGPT-generated code exhibits detectable patterns that even remain consistent across prompt variations [ 6 ] . Given students’ inclination toward adopting AI tools, researchers recommend emphasizing code comprehension, debugging, and correctness within structured design frameworks [ 34 , 10 ] . 2.3 Pattern-Based Approaches to Programming Education Educational research has also explored pattern-based pedagogical frameworks such as POSA and GoF [ 5 , 11 ] . These patterns encapsulate successful solution strategies by describing problem contexts, competing forces, and balancing structures. Owen Astrachan of Duke University recommends implementing pattern-based instruction in introductory computer science courses [ 2 ] to promote "reusable thinking", encouraging students to rely on established structure over intuition. Although these ideas are valuable, they take away from the autonomy and worthwhile struggle of a student. A pedagogical approach must emphasize independent pattern discovery and understanding over pattern memorization, prioritizing the development of transferable algorithmic thinking skills. 2.4 Correctness-by-Construction Several frameworks for stable, correct-by-construction programming have emerged. Meyer’s Design By Contract (DbC) is a systematic approach to designing programs where preconditions, postconditions, and invariants are explicitly defined for each component [ 29 ] . Wing explicitly mentions that computational thinking involves using “invariants to describe a system’s behaviour succinctly and declaratively” [ 38 ] . Gries and Schneider emphasize the use of a rigorous, equational style of proving and show how logic can be applied to formally develop programs from specifications [ 13 , 12 ] . Loksa et al. investigated meta-cognitive awareness in novice programmers by identifying six problem-solving stages and explicitly coaching students to recognize which stage they occupied when encountering difficulties [ 28 ] . A study which leveraged their framework to investigate common errors in