0% found this document useful (0 votes)
16 views7 pages

Translation From Problem To Code in Seven Steps

Uploaded by

Pooja Vashisth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views7 pages

Translation From Problem To Code in Seven Steps

Uploaded by

Pooja Vashisth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Translation from Problem to Code in Seven Steps

Andrew D. Hilton Genevieve M. Lipp Susan H. Rodger


Duke University Duke University Duke University
Durham, NC, United States Durham, NC, United States Durham, NC, United States
[email protected] [email protected] [email protected]

ABSTRACT ITiCSE working group study [9] showed that some students in in-
Students in introductory programming courses struggle with how troductory courses may have a fragile grasp of the skills needed to
to turn a problem statement into code. We introduce a teaching problem solve. In this study they tested students on predicting the
technique, “The Seven Steps,” that provides structure and guidance outcome of short code segments and on completing near-complete
on how to approach a problem. The first four steps focus on devising code from a small set of possibilities. Many students were weak at
an algorithm in English, then the remaining steps are to translate these tasks, especially the latter.
that algorithm to code, test the algorithm, and debug failed test cases. Some approaches to teaching programming instruct students
This approach not only gives students a way to solve problems, to first devise an algorithm, and then write code. They may have
but also ideas for what to do if they get stuck during the process. several steps in their approach with the algorithm as only one of
Furthermore, it provides a way for instructors to work examples those steps [16, 19]. However, devising an appropriate algorithm is
in class that focus on the process of devising the code—instructors the more difficult part of the programming process. Students should
can show how to come up with the code, rather than just showing not only be told to devise an algorithm, but also be instructed in
an example. We describe our experience with this technique in how to devise an algorithm. In this paper, we present The Seven
several introductory programming courses—both in the classroom Steps—the approach we teach our students to devise and implement
and online. an algorithm. This process, which we describe in Section 3, not only
describes how to develop an algorithm and turn it into code, but
CCS CONCEPTS also gives students strategies for when they are stuck on a particular
step. We use this approach with small problems in introductory
• Social and professional topics → CS1.
programming courses. For larger problems, the problem could be
broken down into components and our approach applied to each
KEYWORDS
component.
CS1, introductory programming, from problem to code, metacogni- The Seven Steps forms not only a way for students to work
tion, computational thinking problems, but also a way for instructors to present material. Rather
ACM Reference Format: than showing students example code (which students are often
Andrew D. Hilton, Genevieve M. Lipp, and Susan H. Rodger. 2019. Transla- prone to try to memorize), an instructor teaching with The Seven
tion from Problem to Code in Seven Steps. In ACM Global Computing Educa- Steps can present an example of how to come up with a piece of
tion Conference 2019 (CompEd ’19), May 17–19, 2019, Chengdu,Sichuan, China. code. The instructor can work through The Seven Steps, starting
ACM, New York, NY, USA, 7 pages. https://doi.org/10.1145/3300115.3309508 from a problem statement, and follow the steps to produce working
code. In such an approach, students can understand the logical
1 INTRODUCTION thinking that led to the algorithm and ultimately code to solve the
Novice programmers often struggle to take a problem statement example problem. Such an approach takes more instructional time
and turn it into working code. This struggle arises from needing than simply showing students working code but in our experience
to both devise an algorithm to solve a class of problems, as well has far better results.
as to turn that algorithm into working code. This struggle is seen In the remainder of this experience report, we describe related
in a multi-national ITiCSE working group study [11] that showed work (Section 2), then describe The Seven Steps (Section 3), includ-
students do not know how to program at the conclusion of an in- ing some examples of its use. In Section 4 we discuss its usage in
troductory programming course. Their study collected data on over our in-person courses at Duke University, as well as in two online
200 students from four institutions in which the average student Coursera specializations. In Section 5 we evaluate The Seven Steps
score was 21%. Many students struggled to write any code at all. based on student anecdotes, as well as an end-of-semester survey.
They were stuck on the algorithm design. Another multi-national Finally, we conclude in Section 6.

Permission to make digital or hard copies of all or part of this work for personal or 2 BACKGROUND AND RELATED WORK
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full citation There are many practices to help novice programmers succeed in
on the first page. Copyrights for components of this work owned by others than ACM learning to program. Some practices provide support to learners,
must be honored. Abstracting with credit is permitted. To copy otherwise, or republish,
to post on servers or to redistribute to lists, requires prior specific permission and/or a such as Peer Instruction [3] and Pair Programming [12, 20]. Some
fee. Request permissions from [email protected]. practices focus on the subject matter of the material as a motivating
CompEd ’19, May 17–19, 2019, Chengdu,Sichuan, China factor, such as Media Computation [5]. For example, Porter and
© 2019 Association for Computing Machinery.
ACM ISBN 978-1-4503-6259-7/19/05. Simon [15] showed that combining Peer Instruction, Pair Program-
https://doi.org/10.1145/3300115.3309508 ming, and Media Computation resulted in a 31% improvement in
Identified problem Step 5:
Translate to code
Step 6:
(1) Work an Implementation Test Success!
(2) Write down (3) Generalize (4) Test
instance exactly what your steps your problem program Program
yourself from (2) steps Program is appears
you just did
Step 7: incorrect correct
Algorithmic
Debug
problem
program
Can’t find pattern

Figure 1: Diagram of The Seven Steps

retention of students in their CS1 course. Some practices provide a Step 2: Write down exactly what you just did. The next step
programming environment that aids the programmer in creating is to write down the details of how you worked the problem by
the code, such as the drag-and-drop interface in Alice [18] and hand in Step 1. If you get stuck on this step because you “just knew
Scratch [14]. Some practices focus on providing an environment for it," you should try a more complex example that you cannot just
debugging the code, such as the program visualization tool Python solve by inspection.
Tutor [4]. All of these practices help the novice programmer in Step 3: Generalize. Once you have worked at least one example
some way, but not in understanding how to develop an algorithm by hand and written down the process, you can begin to generalize.
from a problem statement. Why did you do something a certain number of times? Where did
Problem solving in the context of introductory programming can you start? When did you stop? It is often necessary to have worked
be defined in many ways, and we list four such ways. First, compu- several examples by hand to generalize well. In fact, if you have
tational thinking [21] includes the core concepts of abstraction, al- trouble with this step, you should repeat Steps 1 and 2 on different
gorithmic thinking, decomposition, and generalization and pattern instances of the problem.
recognition—different meanings of it were discussed in two work- Step 4: Test your algorithm. Now that you have a draft of a gen-
shops [7, 8]. Second, Problem-Based Learning (PBL) was adapted eralized algorithm, apply it to a new instance of the problem, and
to computer programming [13] with group work PBL sessions that see if you get the correct answer. This is essential for catching gen-
involved seven steps: 1) examination of the case, 2) identification of eralization mistakes. Finding mistakes before translating to code
problem, 3) brainstorming, 4) sketching explanatory model, 5) estab- avoids wasting time. You can go back to Step 3 if you identify a
lishing learning goals, 6) independent studying, and 7) discussion. generalization mistake.
Third, the ITiCSE Working group [11] defined problem solving as Step 5: Translate to code. Steps 1–4 can be done with pencil and
the learning objectives for their assessment in a five-step process: 1) paper and are independent of language. For Step 5, you need to
abstract the problem from its description, 2) generate sub-problems, know the syntax of a language and how to translate parts of the
3) transform sub-problems into sub-solutions, 4) re-compose, and algorithm, such as counting or decision-making constructs. It is
5) evaluate and iterate. These three methods are very abstract. We often helpful to start with your algorithm steps as comments before
were interested in defining concrete steps that students could more you write any code. If any of the lines in your algorithm do not
easily follow. immediately translate into one or two lines of code, they should
A fourth approach to problem solving in introductory program- be abstracted out into their own function: make a good name for
ming is metacognition, being aware of and understanding one’s the function, call it here, and make yourself a note about what it
own thought processes. In [10] the authors give explicit instruc- does. After you finish translating this algorithm, go implement that
tions on problem solving in stages that involve reinterpreting the function. That function is itself a programming problem (for which
problem, searching for similar solutions, evaluating those solutions you wrote the problem statement), so use The Seven Steps.
and then implementing a solution. Our approach is different in that Step 6: Test. Another round of testing is important because you
four of our seven steps focus on working out an algorithm with a could have a correct algorithm and still have made mistakes in
sequence of small problems solvable by hand. the implementation in code. You also can have the computer run
many more test cases more quickly than you can do them by hand.
Testing is the act of finding bugs, and you want to find as many as
3 THE SEVEN STEPS
you can by writing a robust set of test cases. While it is not possible
Because many students do not have much experience thinking to know for certain that your program is correct, you can become
about how they solve problems (they just do), we introduce The more and more certain with good testing.
Seven Steps, shown in Figure 1 to give them a framework for think- Step 7: Debug. Debugging is the act of fixing bugs you identified
ing about solving a programming problem. Here is a summary of in the testing stage. Once you’ve identified a problem, you need to
the explanation we give students: figure out if the issue is with the algorithm or code implementation
Step 1: Work an example yourself. The first step is to work an and go back to Step 3 or Step 5, respectively. We teach debugging by
example yourself by hand. If you cannot yet do that, it means either the scientific method, rather than ad hoc, as many students would
that you need to further specify the problem or that you need do otherwise.
domain knowledge.
Write down exactly how you solved the
problem: (9) Compared 7.81
p to 7.07—7.07 is smaller
√ (10) Computed (−4)2 + (−4)2 = 5.66
(1) Computed 12 + 82 = 8.06
(11) Compared 5.66 to 7.07—5.66 is smaller
√ best choice of (2, 7)
(2) Started with
(3) Computed 92 + 62 = 10.82
(12) p choice to (−3, −5)
Updated best
(13) Computed (−9)2 + 12 = 9.06
(4) Compared 10.82 to 8.06—8.06 is smaller
p (14) Compared 9.06
p to 5.66—5.66 is smaller
(5) Computed 72 + (−1)2 = 7.07
(15) Computed (−6)2 + 72 = 9.22
(6) Compared 7.07 to 8.06—7.07 is smaller
(16) Compared 9.22 to 5.66—5.66 is smaller
p choice to (8, −2)
(7) Updated best
(17) Gave an answer of (−3, −5)
(8) Computed 62 + (−5)2 = 7.81

(a) Step 1: Working this example by


hand (b) Step 2: Write down exactly what you did

Figure 2: Steps 1 and 2 of the closest point example

We give examples on how we teach with this technique from update bestDist to currDist
two courses at Duke University. ECE 551 is an intensive introduc- Give an answer of bestChoice
tory programming course in C and C++, for graduate students in
Engineering. CompSci 101 is an introductory programming course Here is more explanation. Each compute uses ∆x and ∆y from
in Python, for undergraduates. point P to each point in S, so we generalize this to “Computed
(Si ’s x − P’s x)2 + (Si ’s y − P’s y)2 , (call it currDist).” Each com-
p

3.1 Example 1 from ECE 551 parison always compares currDist to something. We realize that
we are implicitly keeping track of the bestDist, and the update
From ECE 551 we give an example of executing The Seven Steps
only happens when currDist is smaller than bestDist.
for the closest point problem—finding the closest point in a set
Step 4. We tested this code for several inputs, including the corner
of points to a given point in the plane. We use this problem, as
case where there are zero points in S. This reveals a problem with
it not only illustrates many algorithm concepts but is useful in a
the algorithm, so we add the line
wide variety of applications: from maps to tagging data based on
similarity. If S is empty, give an answer of "no answer exists"
Step 1. We pick a set of points S and single point P and find which
Steps 5–7. This example was used in the first part of ECE 551,
point in S is closest to P
before students learned to write code, so we only practiced Steps
S = {(2, 7), (10, 5), (8, −2), (7, −6), (−3, −5), (−8, 0), (−5, 6)} (1) 1–4. Later in the course, when students are learning about pointers
P = (1, −1) (2) and arrays, we revisit this problem. The students work through the
translation to code, building their understanding of these concepts
We strongly encourage drawing a diagram. We also identify the do- and how they relate to the algorithm that was designed earlier.
main knowledge needed to solve this problem, namely the p Pythagorean
theorem, rearranged into the distance formula: d = ∆x 2 + ∆y 2 . 3.2 Example 2 from CompSci 101
By hand, we calculate the distance between each point in S and P,
finding that (−3, −5) has a distance of 5.66, smaller than each of the In CompSci 101, we use The Seven Steps to solve the following
other distances calculated, and shown in Figure 2a. problem (from the TopCoder website [17]). Given a word, translate
Step 2. We write down exactly what we did in Step 1, with a focus it into a cryptic text message using the following rules. 1) If the
on being precise and complete. See Figure 2b. word is only vowels, it is not changed. 2) If the word has at least
Step 3. We generalize the results from Step 2, recognizing some one consonant, then write only the consonants that do not have
key patterns: the “compute” and “compare” lines come in pairs; another consonant immediately following them, and do not include
updating the best choice only happens sometimes, and some lines any vowels. 3) Vowels are ‘a’, ‘e’, ‘i’, ‘o’, and ‘u’.
only happen at the start and end. Step 1. Work an example. The word is “please”. We step through
The resulting algorithm is the word on paper, letter by letter, and end up with the result “ps”.
Compute the distance from S_0 to P--call it bestDist Step 2. Write down exactly what you did. 1) Word is "please".
Start with best choice of S_0 Create empty answer. 2) First letter is "p", consonant, no consonant
Count from 1 to the number of points in S exclusive, before, include it, answer is "p". 3) Next letter is "l", consonant with
call each number i consonant before it, do not include it. 4) Next letter is "e", vowel,
Compute the distance from S_i to P do not include. 5) Next letter is "a", vowel, do not include. 6) Next
If currDist is smaller than bestDist, letter is "s", consonant, vowel before, include, answer is "ps". 7) Next
Then update bestChoice to S_i and letter is "e", vowel, do not include. Our answer is "ps".
Step 3. Generalize. In generalizing, we discuss how we find repet- code. Three of the early chapters are entirely devoted to detailed
itive behavior and conditional behavior, as is typical of many al- discussion of The Seven Steps (one focuses on Steps 1–4, one focuses
gorithms. For this problem, we see how making the lines in the on Step 5, and one focuses on Steps 6 and 7). This course also makes
algorithm repetitive is done most easily by “pretending” that there is use of the Lego Lab, described in Section 4.3.
a vowel before the word—doing so removes special cases and makes Furthermore, when students seek help, the instructors and TAs
the algorithm uniform. Generalization results in an algorithm that give assistance within the framework of The Seven Steps. For ex-
looks like this: ample, we respond to students saying “I’m stuck on this problem”
start with before being 'a' with “Which step are you having problems with?” When students
ans is empty say “I cannot find the pattern in these steps,” then we respond that
for each letter in word it is quite good that they can precisely identify the problem they
If letter is a consonant, and before is a vowel, are having and work with them on how to find the pattern in the
then add letter to ans. steps they wrote.
set before to the current letter
give back ans as your answer 4.2 CompSci 101
Step 4. Test your algorithm. We follow the algorithm with the CompSci 101 is an introductory Python programming course for
word "message" and get "msg". It works! undergraduates. This course is the first computer science course for
Step 5. Translate to Python code. Translation to code proceeds the major, and typically 80% of the students have never programmed
in a straightforward fashion: each line in the algorithm corresponds before. We integrate examples of The Seven Steps into the course
directly to one line of code. Checking if a letter is a vowel (or and illustrate with those examples how this technique helps to write
consonant) are logical choices to abstract out into another function. code. We introduce the technique in the fifth lecture and show them
Students are familiar with the function isVowel(), so they can all of The Seven Steps for solving a particular problem. We work
simply use it without solving another problem. The resulting code the first four steps with pencil and paper and then work Steps 5–7
is: on the computer. We ask them for input as we work through all
seven steps. We spend a lot of time on this first example so students
before = 'a'
can see how we would solve each step. Writing an algorithm by
ans = ''
hand and going through all seven steps in such detail takes a long
for ch in word:
time. For later examples, we built the problem solving steps into our
if not(isVowel(ch)) and isVowel(before):
lecture slides so that we could cover them more quickly and have
ans += ch
time to go over more examples in detail. We used this technique in
before = ch
eight of the 26 lectures (30%), spread throughout the semester, and
return ans
used it in the Lego Lab, described in Section 4.3. In the majority
Step 6. Test. Testing shows that this algorithm works on many of the examples we focused on the first four steps, and in a few
cases, but not on the string "a" (where the result should be "a", but examples we worked through all seven steps.
is ""). In two consecutive lectures, we revisited a problem to show a
Step 7. Debug. Debugging shows us that the problem was with different translation to code. In the first lecture for this problem
our algorithm, so we return to Step 3. We note that repairing this we went through all seven steps to solve the problem, with the
algorithm likely requires working more examples, as none of the code resulting in a loop that iterates through all of the elements. In
examples previously worked behave like the problematic test case. the next lecture we learned about indexing with a loop. Then we
Once the algorithm is repaired, it can be translated back into code revisited the same problem from the previous lecture, but started
(repeating Step 5), and re-tested to find that it is now correct. with step 4, the same algorithm we had previously developed. This
time we translated each line from that algorithm into different code
4 USAGE OF THE SEVEN STEPS IN COURSES that used indexing, resulting in a cleaner solution for the problem.
4.1 ECE 551 In another lecture, we were able to show the value in putting
time into developing an algorithm before coding. In this lecture we
ECE 551 is an intensive programming class for Masters students in
worked through the first four steps for a problem. Then we trans-
Electrical and Computer Engineering. This course builds fundamen-
lated each line of the algorithm with live coding with suggestions
tals from the ground up, to take students from whatever their prior
from students. We ran the program on several sets of test data and
programming background might be (including nothing) to solid
it worked correctly the first time! Students were very impressed.
programmers ready to take graduate-level computer engineering
This really showed how investing a lot of time in the first four steps
courses the next semester. This course has pervasive use of The
meant that little to no time was spent on debugging.
Seven Steps—we discuss it (and its importance) on day 1 of the
course, and use it as the primary way to teach examples.
This course uses a flipped classroom, so the examples are not 4.3 Lab with The Seven Steps
done in lecture. Instead, the students watch them in videos, which Both courses do a lab which focuses on Steps 1–4 of The Seven
are part of the textbook [6] that we wrote for this course (which Steps, in which students determine and write down the algorithm
has embedded videos). This book includes 19 video examples where used to place Legos on boards in a sequence of boards that defines
we use The Seven Steps to devise an algorithm and turn it into a particular pattern. Patterns typically start with one lego on a
board, then two legos on a board, then three legos on a board, After the students have had sufficient time to devise their al-
etc. Students are suppose to identify an algorithm so that given a gorithms, they are instructed to execute their own algorithm for
particular number, say 8, they could put down 8 legos on a board the next value of N (e.g., if they were given N = 0–4, they are
that following the pattern. The goal of this lab is to completely instructed to execute N = 5). When they complete this task, they
decouple Steps 1–4 from anything dealing with code (it can be done swap algorithms (but not boards) with a group who had a different
before students have even learned any syntax of any programming pattern (“A” swaps with “B”).
language). The students are then instructed to execute the algorithm they
An example Lego pattern is shown in Figure 3. This pattern received for a value of N , say N = 5 (or whatever value was just
would be appropriate when students have learned about repetition, used). This means that an “A” group is executing a “B” group’s
conditionals, and modulus. This example uses two types of legos, algorithm, without having seen the “B” pattern or any of the “B”
square brown legos and orange rectangular legos that are twice boards—the only information they have to go on is what is written
the size of the square legos. The pattern is the following. The first in the algorithm.
board labeled 0 has one lego, a square lego in the bottom left corner. When the groups finish executing the algorithm they received,
The second board labeled 1 uses two legos, a rectangular lego in they are told to compare results with the group whose algorithm
the bottom left corner and a square lego that starts four columns they executed. The students are instructed to discuss the discrepan-
over and one row up. Each consecutive board has one more lego. cies in their results with each other, as well as any difficulties they
Students will need to make observations to help them in writing an had following the instructions.
algorithm that describes the pattern. They may notice the first lego This lab provides students with a lot of insight into Steps 2 and 3
on each board alternates from square to rectangle to rectangle, and of The Seven Steps (with Steps 1 and 4 being quite helpful in being
then repeats. Meaning the seventh board would start with a square successful). Often, students overlook important details (e.g., color,
lego in the bottom left corner. They may notice that consecutive size, or orientation of their Legos) when writing their algorithms—
legos on a board are always four columns over and one row up. It this is the key skill of Step 2 and is critical to programming. Of
can be a challenge for students to write an algorithm for the N th course, finding the patterns in the Lego placement is key to writing
board that describes the placement of the N legos on that board. a general algorithm, so students practice Step 3 as well. Sometimes
Prior to the lab, the instructors prepare two different patterns: students who struggle to find a pattern try to give instructions like
the “A” and the “B” pattern. The algorithm one writes to explain a “etc.” “and then keep doing it similarly,” or even “you know what
pattern is parameterized over one integer (N ). The complexity of I mean”—other groups struggle to follow such ambiguous steps
the algorithm should be appropriate to the amount of practice/skill and report their frustrations back to the group who wrote the poor
the students have. The concepts involved should be appropriate algorithm. The fact that the algorithm is completely separated from
to the material covered recently. Instructors (or TAs) execute the writing code is crucial—the students can see that it is not a problem
algorithm for N = 0, 1, 2, 3, 4 (more values of N if needed for a of remembering the syntactic details of a particular language, but
complex algorithm). Each parameter value is done on a separate rather that they are not being clear, and/or not finding patterns
Lego board. Boards are labeled with the value of N with a post-it accurately.
note.
4.4 Other uses
0) 1) 2) Beyond our use of The Seven Steps in our in-person courses, we
have two different online introductory programming specializations
in Java [1] and C [2], which make heavy use of The Seven Steps. In
these courses, major examples are worked through with The Seven
Steps, to go from a problem statement to working code. As with
3) 4) many in-class examples, we typically focus on Steps 1–5.
We are also seeing other instructors who are aware of The Seven
Steps put it to use in their own courses. We are aware of a class at
another University which makes use of the textbook [6] that we
wrote for ECE 551. As previously mentioned, this textbook heavily
Figure 3: Example Lego boards for an algorithm with N=0–4. emphasizes The Seven Steps.

For the actual lab session, students are divided into groups (ap- 5 EVALUATION
proximately 4 students per group). The groups are then divided
into “A” and “B” groups. Each “A” group is given a set of boards on
5.1 Student Anecdotes
which the “A” pattern is shown for e.g., N = 0 to 4 legos, and each One of the clearest indicators of the success of The Seven Steps
“B” group is given a set of boards representing the “B” pattern. “A” in our classes is the stories that students tell us of their program-
groups should not be able to see “B” boards, and vice-versa. The ming success. For example, one student in CompSci 101 wrote the
students are then instructed to devise and write down an algorithm following e-mail to Rodger towards the end of the semester:
which would produce the pattern of Legos for any value of N . Each I just want to tell you that I tried the seven step
group has some spare Legos and boards so that they can work method, and I worked on all of my code for one or
examples themselves. two hours before I even looked at the computer. AND
50 Reported Use of The Seven Steps 5.0 All Students

Reported Importance
Percent of Class
Course A 4.5
40 Course B
4.0
30 3.5
20 3.0
10 2.5
2.0
0 1.5
Neve Rare Som Ofte Alwa
r ly etim n ys 1.0
es Th Th Pa Pa Me Me Pr Pr
ink ink tte tte m m ec ec
ing ing rns rns ori ori isio isio
Figure 4: Students’ use of The Seven Steps, by course. (B (A (B (A zing zing n (B n (A
efo fte efo fte (B (A efo fte
re r) re r) efo fte r r)
) ) re r) e)
)
IT WORKED! I got all my code right on the first try!
For the first time ever, I don’t have to go to the help Figure 5: Mean student perceptions of skill importance
lab for hours on end. I just wanted to tell you how
satisfied I am. Yay! Have a good day and thank you
for re-teaching me the strategy.
Three of these skills—Thinking before starting to write code, Finding
We find this story particularly telling, as the student clearly has patterns in a set of directions, and Being able to carefully and
been struggling to write code on her own. However, when she precisely articulate how you solved a problem—are important to
follows The Seven Steps—and uses them to carefully plan before programming, and we would hope students both learn them, and
writing any code—she is able to write correct code on the first try. learn that they are important. The other skill—Memorizing example
She is excited about the success and empowered by the ability to code that you have seen—is not important for programming, even
write working code without help. though many students think that it is, based on prior academic
A student in one of our online courses wrote the following: success from memorization.
I have been programming for a couple of years. Learned Figure 5 shows the average rating, on a scale of 1 (“not at all
from so many resources but none said how to write important”), 2 (“slightly important”), 3 (“neutral”), 4 (“very impor-
the algorithm, they just say you should write your tant”), and 5 (“extremely important”), for each of these four skills
algorithm first. The steps illustrated here are beautiful before the course (shown in solid bars) and after the course (shown
and definitely help to understand how to decompose in striped bars). We plot error bars for a 95% confidence interval
a problem. around the mean on each bar.
Even though this student has some experience programming, we The first observation is that the students’ perception of what
find this story important—the student contrasts The Seven Steps is important moves in the correct direction on all four skills: it
with the approaches he has tried to use before. While he does not increases for the three that are actually useful for programming
say what the prior approaches were or in what context they were and decreases on memorizing code. This change is statistically sig-
used, he notes that “none said how to write the algorithm.” nificant for the first two skills. Unfortunately, there is no control
group available, so we cannot draw conclusions about whether
5.2 Survey Results these changes come from The Seven Steps in particular, or pro-
At the end of the semester, we conducted an anonymous, voluntary gramming in general. However, The Seven Steps explicitly places
survey of both courses. We asked the students to report how often emphasis on these skills. We also divided this data by gender, and
they used The Seven Steps, how useful they found various steps found similar results and trends for both male and female students.
in the process, how important they thought various skills were We also examined the relationship between how often students
(at start and end of course), and how confident they were in their reported using The Seven Steps, and the level of confidence that
programming ability. In total we received 132 responses from a they reported in their programming ability at the end of the course.
total of 463 students (122 from ECE 551 and 341 from CompSci 101). While results were not statistically significant, those with more use
Of these responses, 70 students reported their gender as “male,” 61 of The Seven Steps reported higher confidence on average.
reported their gender as “female,” and 1 student did not report.
Figure 4 shows the percentage of students in each class who 6 CONCLUSIONS
reported using The Seven Steps never, rarely, sometimes, often, or The Seven Steps provides students a step-by-step approach to work
always. ECE 551 shows a remarkably higher rate of use of The through programming problems, from problem statement to work-
Seven Steps than CompSci 101. One logical explanation is that The ing code. It is important for instructors to integrate this technique
Seven Steps was emphasized much more strongly in ECE 551, as into solving problems throughout the semester. We have had great
described in Section 4. However, other factors, such as the age and success using this technique in a variety of courses, both in the
maturity of the students, may also contribute to these differences. classroom and online—and other faculty are beginning to adopt
One set of these questions asked students to rate their perceived this technique. We highly recommend this approach to other CS
importance of four skills at the end and the start of the semester. instructors for use in their own classrooms.
REFERENCES [10] Dastyni Loksa, Andrew J Ko, Will Jernigan, Alannah Oleson, Christopher J
[1] Owen Astrachan, Robert Duvall, Andrew Hilton, and Susan Rodger. 2018. Mendez, and Margaret Burdett. 2016. Programming, Problem Solving, and Self-
Java Programming and Software Engineering Fundamentals Specialization. Awareness: Effects of Explicit Guidance. CHI 2016 (2016), 1449–1461.
(Dec. 2018). Retrieved December 12, 2018 from https://www.coursera.org/ [11] Michael McCracken, Vicki Almstrum, Danny Diaz, Mark Guzdial, Dianne Hagan,
specializations/java-programming Yifat Ben-David Kolikant, Cary Laxer, Lynda Thomas, Ian Utting, , and Tadeusz
[2] Anne Bracy, Andrew Hilton, Genevieve Lipp, and Liz Wendland. 2018. Introduc- Wilusz. 2001. A Multi-national, multi-institutional study of assessment of pro-
tion to Programming in C Specialization. (Dec. 2018). Retrieved December 12, gramming skills of first-year CS students, An ITiCSE 2001 Working Group Report.
2018 from https://www.coursera.org/specializations/java-programming SIGCSE Bulletin 33, 4 (Dec. 2001), 125–140.
[3] Catherine H. Crouch and Eric Mazur. 2001. Peer Instruction: Ten years of experi- [12] Charlie McDowell, Linda Werner, Heather E. Bullock, and Julian Fernald. 2006.
ence and results. American Journal of Physics 69, 9 (Sept. 2001), 970–977. Pair Programming improves student retention, confidence and program quality.
[4] Philip J. Guo. 2013. Online Python Tutor: Embeddable Web-based Program Commun. ACM 49, 8 (Aug. 2006), 90–95.
Visualization for CS Education. SIGCSE 2013 (2013), 579–584. [13] Esko Nuutila, Seppo Törmä, and Lauri Malmi. 2005. PBL and Computer Program-
[5] Mark Guzdial and Barbara Ericson. 2007. Introduction to computing and program- ming — The Seven Steps Method with Adaptations. Computer Science Education
ming with Java: A multimedia approach. Pearson Prentice Hall, Upper Saddle 15, 2 (2005), 123–142.
River, NJ. [14] Massachusetts Institute of Technology. 2018. Scratch website. (Dec. 2018).
[6] Andrew Hilton and Anne Bracy. 2015. All of Programming. Retrieved December 12, 2018 from http://scratch.mit.edu
https://play.google.com/store/books/details/All_of_Programming?id=- [15] Leo Porter and Beth Simon. 2013. Retaining Nearly One-Third more Majors with
zViCgAAQBAJ&hl=en, online book. a Trio of Instructional Best Practices in CS1. SIGCSE 2013 (2013), 165–170.
[7] Marcia Linn, Alfred Aho, M. Brian Blake, Robert Constable, Yasmin B. Kafal, [16] Stephen Prata. 2013. C Primer Plus (6th ed.). Addison-Wesley Professional, United
Janet L. Kolodner, Lawrence Snyder, and Uri Wilensky. 2010. Report of a Workshop States.
on the Scope and Nature of Computational Thinking. The National Academies [17] Topcoder. 2018. Topcoder Competitive Programming. (Dec. 2018).
Press, Washington, D.C. Retrieved December 12, 2018 from https://www.topcoder.com/community/
[8] Marcia Linn, Alfred Aho, M. Brian Blake, Robert Constable, Yasmin B. Kafal, competitive-programming/
Janet L. Kolodner, Lawrence Snyder, and Uri Wilensky. 2011. Report of a Workshop [18] Carnegie Mellon University. 2018. Alice website. (Dec. 2018). Retrieved December
on the Pedagogical Aspects of Computational Thinking. The National Academies 12, 2018 from http://www.alice.org
Press, Washington, D.C. [19] Wikibooks. 2018. Five Steps of Programming. (Dec. 2018). Retrieved De-
[9] Raymond Lister, Elizabeth S. Adams, Sue Fitzgerald, William Fone, John Hamer, cember 12, 2018 from https://en.wikibooks.org/wiki/The_Computer_Revolution/
Morten Lindholm, Robert McCartney, Jan Erik Moström, Kate Sanders, Otto Programming/Five_Steps_of_Programming
Seppälä, Beth Simon, and Lynda Thomas. 2004. A Multi-national Study of Reading [20] Laurie Williams and Robert Kessler. 2003. Pair Programming Illuminated. Pearson
and Tracing Skills in Novice Programmers, An ITiCSE 2004 Working Group Education, Boston, Ma.
Report. SIGCSE Bulletin 36, 4 (Dec. 2004), 119–150. [21] Jeannette M. Wing. 2006. Computational Thinking. Commun. ACM 49, 3 (March
2006), 33–35.

You might also like