1991
DOI: 10.1145/107005.107026
|View full text |Cite
|
Sign up to set email alerts
|

Pictures as invariants

Abstract: The development, specification, and use of a loop invariant are useful and underutilized tools in writing code to solve a problem or implement an algorithm.Invariants are especially useful in introductory courses (CS 1 and CS2) but are usually avoided because of the mathematical notation associated with them and because most textbooks have brief, if any, coverage of them. Our intent in this paper is provide several motivating examples of the use of pictures as loop invariant and to provide pointers to literatu… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
3
1
1

Citation Types

0
7
0

Year Published

1998
1998
2023
2023

Publication Types

Select...
2
2
1

Relationship

1
4

Authors

Journals

citations
Cited by 5 publications
(7 citation statements)
references
References 6 publications
0
7
0
Order By: Relevance
“…Tam describes several examples of code construction based on informal Loop Invariants expressed in natural language. Astrachan [1] is probably the closest to our work as he suggests the use of Graphical Loop Invariants in the context of CS1/CS2 courses. However, his approach is incomplete as the suggested drawing lack of completeness (e.g., objects manipulated, such as arrays, are not named according to code variables), might lead to confusion (e.g., variables positions in the drawing are somewhat unclear), and the drawing is not explicitly manipulated to derive particular situations (e.g., code prior and after the loop).…”
Section: Literature Reviewmentioning
confidence: 86%
“…Tam describes several examples of code construction based on informal Loop Invariants expressed in natural language. Astrachan [1] is probably the closest to our work as he suggests the use of Graphical Loop Invariants in the context of CS1/CS2 courses. However, his approach is incomplete as the suggested drawing lack of completeness (e.g., objects manipulated, such as arrays, are not named according to code variables), might lead to confusion (e.g., variables positions in the drawing are somewhat unclear), and the drawing is not explicitly manipulated to derive particular situations (e.g., code prior and after the loop).…”
Section: Literature Reviewmentioning
confidence: 86%
“…This invariably leads to off-by-one bugs, problems running off the end of the array, and problems, with boundary cases (e.g., first zero, last zero). A simple loop with an if statement tracking the last non-zero index leads to short, concise code; see [4]. As another example, considerprocessing run-length encoded representations of black and white pixel data for rectangular images, e.g., 4 1 2 3 represents 0000100111.Withnoguidance,studentsoftentrytowrite nested loops to fill a matrix, rather than a single loop to read the file and populate the matrix.…”
Section: Simple Program Patternsmentioning
confidence: 99%
“…This paper introduces and discusses Café ("Correction Automatique et Feedback des Étudiants" 1 ), an on-line platform for automatically assessing students' programming exercises. The key point of Café is that it not only focuses on the program output but also on the cognitive process inherent to the program construction.…”
Section: Introductionmentioning
confidence: 99%