# A Feasibility Study on Learning of Object-Oriented Programming Based on Fairy Tales

Motoki Miura

► To cite this version:

Motoki Miura. A Feasibility Study on Learning of Object-Oriented Programming Based on Fairy Tales. IFIP World Conference on Computers in Education (WCCE), Aug 2022, Hiroshima, Japan. pp.579-590, 10.1007/978-3-031-43393-1_52. hal-05533350

HAL Id: hal-05533350

https://inria.hal.science/hal-05533350v1

Submitted on 2 Mar 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
<figure><img src="image_2.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
# A Feasibility Study on Learning of Object-Oriented Programming Based on Fairy Tales

Motoki Miura(✉) ID

Chiba Institute of Technology, Tsudanuma, Narashino, Chiba, Japan

motoki.miura@p.chibakoudai.jp

**Abstract.** In learning object-oriented programming (OOP), it is necessary to understand the concept of OOP and apply it to actual development. However, acquiring such skills is not easy for novice programmers. We propose a learning method based on fairy tales in order to make it easier for learners to work by assuming a specific situation, and to make it easier for other learners to share the situation. In the proposed method, the learners select one fairy tale as the subject themselves, and express the flow of the story by interaction between characters, changing attributes, exchanging objects, and outputting narrations. Finally, the learners design the classes and methods necessary for expressing them, and actually realize as an executable program. We applied the proposed method in a lecture at the graduate school and confirmed the feasibility.

**Keywords:** Object-Oriented Programming · Software Analysis and Design · Software Engineering

## 1 Introduction

Object-oriented programming (OOP) is a basic programming paradigm, and its importance and need are high. The best feature of OOP is that it can naturally express real-world relationships and events in a practical way. In order to express the real-world relationships and events in an object-oriented (OO) paradigm, OO software analysis is necessary. There are several approaches for OO software analysis that have been developed: (1) the object model approach, (2) the dynamic model approach, and (3) the functional model approach. The difference between these approaches is the model that the developer works with first. However, during the analysis and design, it is expected that the developer considers these approaches while going back and forth.

Generally, it is difficult to understand the concepts of OOP for novice learners [7,9,13]. Therefore, there are many hurdles to master the model approaches in addition to the concepts. We thought that these hurdles can be lowered by considering small situations based on the principle of small steps.

In this paper, we propose a practical OOP learning method that employs fairy tales. In this learning method, the learner selects a specific fairy tale, and defines
the classes and interfaces that are appropriate and necessary for expressing the story. In addition, by describing and implementing it as OOP source code, the relationships and interactions between the characters can be expressed.

## 2 Related Work

There are much research on learning OOP languages and concepts. Dwarika et al. [3] used a visual programming environment called *Alice* for novice programmers to learn OOP concepts, whilst creating animated movies and video games. Using Alice addressed challenges faced by inexperienced learners within the object-oriented domain and increased their motivation to learn OOP. Kanemune and Kuno introduced an object-oriented programming (OOP) language suitable for K12 education named *Dolittle* [5]. Dolittle adopts a prototype-based OOP language such as Javascript for simplicity. Therefore, the users are not required to understand class and abstraction concepts. Although the simple prototype-based language design is appropriate for elementary school education, learning abstract concepts such as class and inheritance is not covered. Miura et al. [8] proposed an interactive workbench software for learning fundamentals of data structures with the concepts of type, variable, object, and their relations in OOP language. When the learner manipulates graphical models, the system immediately generates corresponding codes. Tanielu et al. [12] utilize virtual reality (VR) and analogies of “houses” and its blueprint for OOP concepts learning. VR is used to promote immersiveness and deep involvement. Method calls are represented by entering and exiting the room, and arguments are represented by placing a box on a window sill. This research employs visual elements and its interactions to help the learner understand the OOP language and concepts. Our method also expects the learners to understand OOP, but we focus on the activities of the learners themselves modeling the situation through the story.

Sasaki et al. [11] proposed OOP education using learning content based on stories. In this research, some situations are given by the stories, which facilitate the students to perform tasks. Teachers carefully design and prepare learning content with scenarios. Our proposed method that employs “fairy tales” differs in that the learners themselves freely select the story and then design and implements it to express the story.

Akayama et al. [2] proposed an effective use of Model-driven development (MDD) tools in UML modeling education. By using the MDD tool, the learner can generate the code and check the operation immediately after drawing the class diagram and the state machine diagram. Comparing the case with and without the MDD tool, the group using the MDD tool tends to develop from the bottom up because the operation can be confirmed for each function, and the group without the MDD tool tends to perform top-down development.

Knuth proposed a programming style named “literate programming” [6]. In this programming style, programs and explanatory documents are mixed and described in one literary file, and development can be performed while maintaining the consistency between the two. Although there are similarities in terms of
literary description of the program, the method proposed in this study aims to
understand and establish the learner's knowledge by expressing the story using
the paradigm of OOP.

A web article “Let’s write storytelling code” [10] introduced merits and its importance of OOP with “sense of story” while showing two types of different codes. The author emphasizes the sense of story in the second section that “the class naturally becomes the subject, the method naturally becomes the predicate, and the argument naturally becomes the object,” which is consistent with the basic idea of our proposed method. In our study, as a learning method of OO software design, the learners themself recall a concrete fairy tale, and think about how to express the story with OOP.

3 Method

The proposed OOP learning method based on a story is a learner-centric approach. Firstly, the learners themselves decide a specific “fairy tale” and express the story through OOP. In this process, the learners should consider both class hierarchy and dynamic aspects of OOP. After expressing the story, the learners organize presentation by composing resources such as figures, source code, and execution results. Finally, the learners explain their work and ingenuity along with the chosen fairy tale.

**3.1 Characteristic**

In a fairy tale, characters appear in the story and act along the time axis while interacting with each other. The characters can be categorized into specific types, such as humans and animals, and include attributes such as age, gender, height and weight. Some characters own items, and perform with their emotions. In addition, relationships and responses are dynamically changed. These changes in the story can be expressed by analysis, design, and implementation of an OOP approach. The preconditions and situation settings of a specific “story” become appropriate constraints, and common recognition and understanding are promoted, which facilitates communication. The experience of thinking with a specific story can be applied to the real-world analysis.

## 3.2 Expected Benefits

The following points can be mentioned as the merits assumed by “adopting a
fairy tale as a subject” in the proposed method.

- **The charm of the story:** Existing fairy tale is known over many years, and the story itself is highly attractive.

- **Diversity and degree of freedom:** Since there are many stories in the world, the degree of freedom in selecting a story is high.

- **Concreteness:** After selecting a story and a scene, the characters and events are determined concretely, so it is easy to analyze, design, and implement.
- **Ingenuity and arrangement are possible:** In addition to expressing the story as it is, the learners can arrange some parts such as “what if.”

- **A gap between story and program expression:** There is a gap that expresses a classic story in a modern program notation. The gap creates fun and novelty.

- **Easy to share intentions with other learners:** If the story itself is well known, it is easy to share the meaning and intention when explaining it to other learners.

By expressing the story, it is possible to handle not only the static relationships contained in the story but also the analysis, design, and implementation of dynamic aspects along the time axis. Also, by using an integrated development environment (IDE), the learners can easily check the syntax of implementation while coding.

## 3.3 Issues of Concern

The problems of concern in the proposed method are listed below.

- **Difficult to select a story:** Since the degree of freedom in story selection is high, the learner may stumble at the time of story selection. It may take too much time to select a story.

- **Cannot apply OOP concepts:** We believe that most of fairy tales and stories can be represented by OOP. However, there might be some stories not suitable for the OOP paradigm.

- **Using uncommon stories may reduce effectiveness:** If the selected fairy tale is not well known, mutual understanding between learners is hindered. In such case, the effect of “easy to share intentions with other learners” mentioned in the above merit will be reduced.

# 4 Feasibility Study

In order to investigate the effect of the proposed learning method, we conducted a feasibility study in the lecture.

## 4.1 Course Contents and Assignment

We chose the course “Advanced System Software” for graduate students. The course was held online for 13 weeks, 120 min per week. Seven students took the course. The first half of the course contains object-oriented and design patterns [4] through Java programming. As a summary of the first half, the following assignment was given to the students at the beginning of the 5th course on October 19th, 2021. We explained the detail of the assignment for about 40 min.
Assignment

Select one specific story (old story or fairy tale), define multiple classes required to express that story, and then express the flow of the story as well as the behavior of the characters in Java program.

The purposes of the assignment were (1) to check the knowledge and concepts of OOP learned in the first half of the course, and (2) to confirm if the class can be designed properly by applying the story.

The students were asked to work on this task individually or in groups. As a result, five students worked individually, and two students composed a pair. The students selected a story and created a program while thinking about how to express it in the class. In addition, we asked them to create Web pages containing figures, source code, execution results, etc. as presentation material. The expected time for presentation was 5 min per theme. The presentation was held at the time of the 8th course (November 9th, 2021). There was a three-week period for the assignment.

When presenting the assignment, the teacher explained to the students the following source code example based on "Momotaro." Momotaro (Peach Boy) [1] is one of the famous and popular Japanese folklore.

Figure 1 defines the main method of code example. It represents the beginning of Momotaro. Figure 2 and Fig. 3 show class definitions of "Things" and "Creatures" and its subclasses that appear in Momotaro respectively. Figure 4 is the output of the code example. Note that the name of classes and variables of the following code examples were translated to English.

While showing the code example, we explained the following notes in the course.

- The "story" should be something that everyone is familiar with.

- First, create a class to represent characters and things that appear as objects. At that time, if there is a hierarchical relationship, it is expressed by inheritance, and common members and methods are defined in the parent class.

- The exchanges between characters and the delivery of things are expressed by method calls. We will add the methods necessary for that.

- We recommend adopting the "subject.action(predicate)" format for readability.

Although the design tools and development environment were not particularly specified, many students might use Visual Studio Code and its Extension Pack for Java introduced in the course.

After the presentation, we administered a questionnaire to the students, which consisted of the following questions.

1. How long did it take to decide on the story that explains object-oriented programming?

(1) About 1h (2) About 2h (3) About 3h (4) About 4h (5) More time
<figure><img src="image_3.png" /><figcaption>Fig. 1. Main method of Momotaro.</figcaption></figure>

2. How long did it take to design the classes that express the chosen story?
(Excluding the time to create UML diagrams, etc.)

(1) About 1 h (2) About 2 h (3) About 3 h (4) About 4 h (5) More time

3. After designing the class, how long did it take to create a program to express the story?

(1) About 1 h (2) About 2 h (3) About 3 h (4) About 4 h (5) More time

4. Please say what is challenging when creating a program that expresses a story.
If possible, answer separately for the class definition and the coding.

5. What kind of knowledge and skills do you think you could acquire by creating a program that expresses the chosen story with object-oriented thinking?

6. If you have any ideas for learning object-oriented programming other than using a story, please tell us.

7. If you have any other suggestions for improving the assignment, please tell us.

## 4.2 Student Work

Table 1 shows the characteristics of student work with the title of the fairy tale, number of classes, lines of the program and the explanation time at the presentation. Except for “The Straw Millionaire,” the explanation was based
<figure><img src="image_4.png" /><figcaption>Fig. 2. Class definition regarding “things” in Momotaro.</figcaption></figure>

on valid and executable Java programs. For “The Straw Millionaire,” the concept codes that contain item bartering and class definition of characters were submitted, but concrete codes for representing story were not shown. At least 5 classes (9 on average) including inheritance were defined. In addition, some
<figure><img src="image_5.png" /><figcaption>Fig. 3. Class definition regarding “creatures” in Momotaro.</figcaption></figure>

work adopted design patterns and students mentioned this at the presentation. “Princess Kaguya” used the Singleton pattern not to generate more than two princesses. “The Three Axes” adopted the Template Method pattern for the series of similar events. “The Giant Turnip” utilized recursive function calls to represent the story. “Little One-Inch” adopted the setting that the height is
<figure><img src="image_6.png" /><figcaption>Fig. 4. Output of Momotaro example program.</figcaption></figure>

doubled when using a gavel. Almost all students could clearly explain the intent in both class design and implementations.

<table><caption>Table 1. Characteristics of student works.</caption><thead><tr><th>Fairy Tale</th><th>Num of Classes</th><th>Lines</th><th>Time to explain</th></tr></thead><tbody><tr><td>The Three Axes</td><td>8</td><td>162</td><td>5 m 36 s</td></tr><tr><td>The three little pigs</td><td>11</td><td>110</td><td>3 m 27 s</td></tr><tr><td>The Giant Turnip</td><td>9</td><td>138</td><td>5 m 58 s</td></tr><tr><td>The Straw Millionaire</td><td>14</td><td>117</td><td>3 m 55 s</td></tr><tr><td>Princess Kaguya</td><td>7</td><td>238</td><td>4 m 37 s</td></tr><tr><td>Little One-Inch</td><td>5</td><td>76</td><td>3 m 58 s</td></tr><tr><td>Average</td><td>9.0</td><td>140.2</td><td>4 m 35 s</td></tr><tr><td>Std. Dev.</td><td>3.2</td><td>55.9</td><td>60 s</td></tr></tbody></table>

## 4.3 Result of Questionnaire

Based on the answers of questionnaire items (1) to (3), Fig. 5 shows how much time the students spent on story selection and decision, class design, and programming. From the results, most of the students chose a story in about one hour, and spent more time on class design and program creation. Note that the order of the student ID and the story titles shown in Table 1 does not correspond.

The students' answers to question item (4) is shown below.

- I had a certain idea in my head, but when I actually started writing, I learned that I could express it in various ways, so it was difficult to complete the program as I expected.

- I was a little confused about how much generalization and specialization should be done when defining a class.

- I was wondering what to define for the method of the parent class.

- Conditional branch is not suitable for representing similar stories because the statement becomes too complicated.
<figure><img src="image_7.png" /><figcaption>**Fig. 5.** Result of questionnaire (1) to (3) for 7 students.</figcaption></figure>

The students' answers to question item (5) is shown below.

- By writing while actually thinking, I think I was able to use the knowledge I learned, saying, "If you have this knowledge, you can improve this part by changing it like this." Also, I think that I have become able to look up the information accurately when there is something I do not understand with my ability to think.

- I made a story without using design patterns, but after investigating, I understood that design patterns can be used in such cases.

- I haven't learned this yet, but I got a better understanding by actually making something using object-oriented programming.

- The whole structure can be determined to some extent by using a design pattern.

The students' answers to question item (6) is shown below.

- I wanted to express a famous scene from the game.

- Organizations such as companies

- I thought that the idea of expressing a story in a program would be very educational. I can't think of anything else.

## 4.4 Discussion

As a result of presenting the task based on the proposed method in this experimental course, it can be said that all the learners understood the intention of the
task and were able to apply the idea of object-oriented design to the story. In addition, the ratio of story selection time to the total task execution time was at most one third. From this result, it was found that even if the method of making the learner think from the selection of the story is adopted, the graduate students can carry out the task without any problem. Most students noticed that there is not only one answer for design and implementation, and that appropriate design and implementation differ depending on the situation and purpose.

Since the course explained the design pattern from the 5th week to the 7th week, there were some implementations and presentations related to the design pattern. The results of the questionnaire also showed references to design patterns. By listening to the course while thinking about how to tackle the task of expressing the story, it is possible that the consciousness of utilizing knowledge was strengthened.

# 5 Conclusion

We have proposed a method of using fairy tales as an assignment for learners learning object-oriented programming to work on each phase of analysis, design, and implementation while considering each phase simultaneously and across aspects. In the proposed learning method, the learners select one fairy tale as the subject themselves, and express the flow of the story by interaction between characters, changing attributes, exchanging objects, and outputting narrations. The learners design the classes and methods necessary for expressing them, and implement as an executable program.

Although fairy tales are fiction, they have been popular for a long time and are well known. Therefore, the learner can freely arrange the detailed settings for a part of the fairy tale while following the basic plot. In addition, by carefully examining the program execution results, it is possible to confirm the correctness of the design and implementation. Learners can be trained to analyze fairy tale stories and plots and select the appropriate level of abstraction from a meta perspective.

As a result of applying the proposed method in the lecture at the graduate school, the learner was able to understand the intention and select an appropriate fairy tale. In addition, based on the characteristics of the selected fairy tale, the learner created a program consisting of multiple classes while demonstrating abundant creativity. From these facts, it is considered that the proposed method is highly feasible and has a high learning effect.

**Acknowledgement.** The part of this research was supported by the fund of KAKENHI Grant-in-Aid for Scientific Research (C): Grant Number 22K12319 and 19K03056.

# References

1. Momotaro. https://en.wikipedia.org/wiki/Momotar%C5%8D. Accessed 26 Feb 2022
2. Akayama, S., Hisazumi, K., Hiya, S., Fukuda, A.: Using model-driven development tools for object-oriented modeling education. In: EduSymp@MoDELS (2013)

3. Dwarika, J., de Villiers, M.R.R.: Use of the Alice visual environment in teaching and learning object-oriented programming. In: Proceedings of the 2015 Annual Research Conference on South African Institute of Computer Scientists and Information Technologists, SAICSIT 2015. Association for Computing Machinery, New York (2015). https://doi.org/10.1145/2815782.2815815

4. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software (1994)

5. Kanemune, S., Kuno, Y.: Dolittle: an object-oriented language for K12 education. In: EuroLogo, pp. 144–153 (2005)

6. Knuth, D.E.: Literate programming. Comput. J. 27(2), 97–111 (1984)

7. Liberman, N., Beeri, C., Ben-David Kolikant, Y.: Difficulties in learning inheritance and polymorphism. ACM Trans. Comput. Educ. (TOCE) 11(1), 1–23 (2011)

8. Miura, M., Sugihara, T., Kunifuji, S.: Anchor garden: an interactive workbench for basic data concept learning in object oriented programming languages. In: Proceedings of the 14th Annual ACM SIGCSE Conference on Innovation and Technology in Computer Science Education, pp. 141–145 (2009)

9. Ragonis, N., Ben-Ari, M.: A long-term investigation of the comprehension of OOP concepts by novices (2005)

10. Roku: Let's write storytelling code (2020). https://zenn.dev/ad5/articles/6780d514ed8cda6bdf0f. (in Japanese, Accessed 2 Feb 2022)

11. Sasaki, S., Watanabe, H., Takai, K., Arai, M., Takei, S.: A practice example of object-oriented programming education using WebCT. In: Proceedings of the 2005 Conference on Towards Sustainable and Scalable Educational Innovations Informed by the Learning Sciences: Sharing Good Practices of Research, Experimentation and Innovation, pp. 871–874 (2005)

12. Tanielu, T., 'Akau'ola, R., Varoy, E., Giacaman, N.: Combining analogies and virtual reality for active and visual object-oriented programming. In: Proceedings of the ACM Conference on Global Computing Education, pp. 92–98 (2019)

13. Xinogalos, S., Sartatzemi, M., Dagdilelis, V.: Studying students' difficulties in an OOP course based on BlueJ. In: IASTED International Conference on Computers and Advanced technology in Education, pp. 82–87 (2006)