Coding Is TOPS in Middle School

Creating learning opportunities that promote problem solving in today’s world.

One fine September morning, a class of eighth graders funneled into Angela’s fourth floor classroom expecting a new logic problem, math puzzle, or challenge.

But not that day. Instead, the students noticed 12 small, sphere-shaped mechanical robots placed around the classroom. They looked like something from a Star Wars set.

“That’s today’s lesson,” Angela told the students, whose eyes had grown wide with curiosity and whose smiles were starting to show. “They’re robots.”

Team-Oriented Problem Solving

Even in an era of public education when standardization is king, Canonsburg Middle School (CMS) in Pennsylvania believes in the importance of providing a whole-child education in these crucial middle years. For the past 12 years, CMS has offered all eighth graders a unique program called Team Oriented Problem Solving (TOPS). TOPS provides students with the opportunity to work collaboratively to solve open-ended problems using mathematics as the common vehicle.

AMLE talks with author Angela Marasco about Coding in the Middle Grades

The goal of TOPS is to promote a team atmosphere similar to the real world where people work together to find solutions to problems. The teacher serves as the facilitator. The class is a five-day, nine-week course, which provides the opportunity for all students to take the course by the end of the school year.

Cornerstones of TOPS

Cooperative learning, recognized as an effective learning strategy at the middle level, is central to our TOPS classroom. Roger and David Johnson provide a plethora of research and publications that support the impact of cooperative learning on students. John Hattie’s meta-analysis work also gives credence to cooperative learning as an effective strategy for student achievement.

Logic is a vital component of TOPS. Students are given logic-based problems that require them to look at a variety of possibilities, knowing that more than one path to the solution is almost inevitable. Teams of students competitively tackle these logic-based problems to see who has the most unique approach to solving them.

Multiple skill application is the third of our cornerstones. Students are required to use multiple skills to solve and complete a TOPS task. This means they must tap into prior knowledge and apply skills learned in other subject areas. For example, students may use math skills such as measurement, probability, geometry, and solving equations; tap into their creativity and writing skills to write a solution; and use their presentation skills to communicate the solution to the class.

Facilitation is the final cornerstone of TOPS. The teacher’s role is to create challenges and facilitate learning as opposed to presenting information and requiring students to duplicate it, then repeat. Angela is a math-certified teacher who understands this important aspect of TOPS. Her primary responsibility is to create the challenge, then facilitate the problem-solving process, knowing that students need to go through the trial-and-error process and feel the frustration before coming to a solution.

Coding Meets TOPS

TOPS looks different today than it did 12 years ago. We need to change our educational opportunities to stay current in our society. TOPS is still based on those four cornerstones, but the tasks have changed to better prepare students for today’s world.

For example, last year, TOPS students took part in the Hour of Code, a global event that focuses on demystifying coding ( It was a natural fit! Coding is computational thinking that requires students to work through logic-based problems. This participation inspired us to make coding a bigger part of TOPS.

The Robotic Ball

While perusing his daily Twitter PLN last year, Greg came across an app-enabled robotic ball—ideal for TOPS! Designed for middle level students, it is controlled by a series of free Android and Apple applications. The apps vary in difficulty, from drag and drop c-based block programming to programming with macros. The makers of the bot provide videos and lesson plan ideas for middle schools to incorporate into the classroom.

Greg contacted the company, which agreed to provide us with a bot for the school. Angela explored the bot’s use in the classroom and saw the natural fit. We purchased 12 bots and 12 tablets for the current school year.

Students, Meet the Bot

The goal of the bot unit is to promote student interest in computer programming while they practice problem-solving skills.

Students learn to control their bot’s movements by programming a variety of apps.

First, students become familiar with the bot’s Draw and Drive and Sphero applications. With the Draw and Drive app, the user draws a picture on the screen of a tablet and the bot follows the pattern the user draws. The Sphero app gives the students the opportunity to drive the bot by using the controls on the tablet. It is similar to a person directing a remote controlled car.

The students immediately realize it is difficult to control the bot with these two applications. The bot has trouble following complex patterns, and the students are unable to specify the speed at which the bot travels. These problems naturally lead to the introduction of apps that allow the students to program exactly what they want the bot to do.

Learning to Program

This is when the MacroLab app is introduced. This app includes a list of commands from which the students can select. The students must specify the parameters of each command. For example, for the “roll” command, the students select how fast, how long, and in what direction the bot will roll.

Students solve problems involving the relationships between speed, time, and distance.

The students use the MacroLab app to solve problems involving the relationship between speed, time, and distance. For example, a team of three students is charged with making the bot travel at 40% speed from the starting point for 5 seconds. The students then choose the amount of time the bot needs to roll in order to travel the same distance at 20% speed.

The bot gives the students the opportunity to test and revise their predictions. The students see their results first-hand and understand why certain values complete the challenge.

Taking Programming to the Next Level

By the end of the unit, the students are ready to use OrbBasic, a more powerful but also less-intuitive app. In OrbBasic, students are given a “blank slate” on which to write code. In other words, OrbBasic has no pre-filled commands, and students need to “write” their own code from scratch to direct the bot’s actions.

In these lessons, the students study an introductory section showing them how to program the bot to do certain tasks and learn specific commands, such as “goroll,” “goto,” “LEDC,” and “if then.”

It is in these lessons that students begin to grasp the basics of programming. By the end of the OrbBasic section, students have made great strides in their understanding and ability to code.

Sharpening Their Skills

Most students begin the bot unit with no programming experience and finish with an understanding of how to write code. The students learn how to use tactics like “variables” and “loops,” and they understand firsthand how code must be typed without errors for the robot to correctly interpret the instructions. As one group learned, if the user types a few lines of flawless code but forgets a necessary comma, the bot will not follow the code.

After completing a survey about the bot unit, one student said, “At first, I thought coding [the bot] was difficult and confusing. After a few days, though, I started to learn how to use it more. Now I have a much better understanding of coding the [bot].” Many other students reported the same growth experience.

Students agreed that the bot unit had increased their interest in programming. One student said, “Having no experience whatsoever coming into the unit, I feel like using the [bot] taught me a lot about coding and how everything is done. I previously had little to no interest in coding. I enjoyed coding [bots] and felt it was a cool introduction to coding.”

In all, the bot unit achieved its goal: to help the students gain an interest in programming while sharpening their problem-solving skills.


  1. I have always loved the idea of incorporating coding and programming into a science class or teaching a STEAM class. Having the students work together to problem solve and use their critical thinking skills to make a robot move requires a lot of teamwork. This is a skill all the students will need to learn if they want to be a part of any group. The students would probably agree that this is much more fun than sitting at their desks with a paper and pencil. The students are not only working together but they also need to use their knowledge about speed. time, and distance to make the robot move the correct distance. This is a great way to get engaged in learning about science. I would love to someday be able to use this in my future classroom.