Assessing Students' Structured Programming Skills with Java: The "Blue, Berry, and Blueberry" Assignment

Introduction Java is an object-oriented programming language. Structured programming skills, however, are fundamental to more advanced Java topics. Compared with structured design and programming, object-oriented design and programming provides a more natural and intuitive way to describe the real world objects by creating classes and their associated instances (also called objects). The relationship between the two, from a software engineering perspective, is as follows: objectoriented design and programming is used at the high level (architectural) design; in contrast, structured design and programming is used at the low level (detailed) design within methods. As such, mastering structured programming skills is a stepping stone for anyone who wants to become proficient in object-oriented programming. Structured programming uses control statements (e.g., selection statements and repetition statements) to control the order of execution of a Java program. A typical Java programming textbook (e.g., Deitel & Deitel, 2009) introduces these control statements in early chapters. Without a thorough understanding or a solid grip of the structured programming concepts and skills, students would quickly become confused and frustrated, leading to early withdrawals or ultimate failures. Structured programming skills with Java include using three forms of control structures--sequence, selection, and repetition (see details in the section on Structured Programming with Java). Effective assessment of whether students have obtained these skills has been a challenging task because there are many control statements and many different ways to combine them. This article describes the "Blue, Berry, and Blueberry" assignment, which can be used to effectively assess students' structured programming skills with Java. It includes a review of the history of structured programming, an overview of structured programming with Java, the specification of the program, the course background as well as the grading rubric and report, and the students' perceptions about the assignment. The History of Structured Programming The idea of structuring a program with nested procedures or subroutines is not new (Wilkes, 1976). In 1949, Wheeler invented the term "closed subroutine" (Wilkes, 1976). In 1951, Wilkes, Wheeler, and Gill started to promote the "master routine calling subroutines and the subroutines calling other subroutines" style of programming, which could be regarded as a primitive form of structured programming (Wilkes, 1976). In 1968, Dijkstra published the "Goto statement considered harmful" article, which advocated abolishing the goto statement from all "higher level" programming languages. In 1972, Dijkstra published the "Notes on structured programming" article, advocating restricting program control to three structures: sequence, selection, and repetition. Dijkstra's work "triggered the structured programming movement" (Chen, 2002, p. 21) and "fundamentally altered human expectations and achievements in software development" (Mills, 1986, p. 58). Structured programming advocates a "top-down" approach with a "divide-and-conquer" process to writing programs. In a "top-down" approach, programmers first formulate an overarching view of the program under development, then divide it into smaller subunits. Each subunit is then refined in greater detail and if necessary, divided into even smaller sub-subunits. The previous step repeats until the specification of each and every lowest subunit can be easily translated into simple programming language syntaxes. It is claimed that this "top-down" approach leads to "a disciplined method of programming with the following advantages" (Wilkes, 1976, p. 274): (1) The program, being modular in nature, is easy to understand and check. (2) There is a possibility of proving it correct. (3) It is easy to maintain and modify. By comparing two sets of program profiles, one set with and the other without using structured programming techniques, Elshoff (1977) shows that programs developed with structured programming techniques (1) have a more restrained flow of control, (2) are more readable and understandable, and (3) are expected to have a much longer lifetime. …