1 Introduction

In the execution process for solutions in problem-solving, multiple operations is typically performed; however, in many cases, the learner does not recognize why individual operations are performed in the solution. Therefore, the importance of understanding the basis for why individual operations are performed has been pointed out [1]. To fully clarify individual operations in task presentation for learning support, it is necessary to discuss not only the properties of a single task, but also the kind of task sequence that should be designed within a continuous task. In general, the order and grain size of tasks presented to learners in programming learning are determined by the teacher. However, if tasks are not presented in a stepwise manner, the learner may have difficulty or may have an incomplete understanding. Therefore, for continuous tasks, such as programming learning, we assert that a framework based on the qualitative consideration of various properties, such as the order and granularity of tasks presented to learners, is necessary. In addition, for each task, it is beneficial for the learner to understand the previously learned tasks and to gradually progress to the developed state in order to understand the influence of individual operations in combination. Such an approach is known as “gradual learning.”

In the study of progressive learning in physics exercises, a framework called Graph of Microworlds (GMW) has been proposed to design these task sequences [2]. GMW has been proposed based on ICM (Increasingly Complex Microworlds). ICM is a learning support method that not only focuses on experiencing and understanding a phenomenon in a learning environment based on simulations, but also gradually introduces complexity to lead to an understanding of complicated phenomena. In addition to gradually building complex phenomena, GMW supports differences between phenomena gradually experienced by learners.

Consideration of stepwise task sequences (e.g., physical exercise), like GMW, is equally important for gradual programming learning. Therefore, in this research, we examined the nature of tasks to provide a framework for designing stepwise task sequences in programming learning support.

2 Previous Research

Watanabe et al. [3] have conducted learning support using continuous tasks. They proposed a method for stepwise reading by giving the learner the entire code using a technique called stepwise abstraction. For example, each line of the following three-line program is simple assignment: (1) store the value of A in C, (2) store the value of B in A, (3) store the value of C in B. However, by recognizing three rows at once, the learner can identify a specific part, such as “swapping two variables.” When the learner notices this part, if a program with the if-statement (4) if A > B at the beginning of the three lines is presented, the learner can detect a program containing parts called “swapping two variables.” Therefore, the learner can understand the function of the expanded part by considering only the function of the if statement extended to parts described by “swapping two variables.” In this way, this method supports the gradual acquisition of parts by providing the whole program to the learner, summarizing the parts that the learner considers a series of operations from the whole, and considering its meaning. Watanabe et al. insist on the importance of continuous tasks in this stepwise abstraction. By using continuous tasks, learners who solved a certain task within a complex task included a solution for solving the task stepwise. In addition, presenting a simpler task with a narrow solution as an auxiliary problem to learners who are unable to solve a certain task encourages students to understand the solution. Therefore, Watanabe et al. built a task sequence in programming and supported the migration of issues, like in GMW.

In this paper, we discuss task sequences in programming with reference to the task sequence described by Watanabe et al.

3 Task Structure

To construct task sequences, the task itself needs to be structured. In this chapter, we discuss the structuring of problems in programming. First, we point out the limitations of previous research. Next, we focus on the difference between the problem-solving process in general and in programming and discuss the elements to be addressed in the problem-solving process in programming. Finally, we describe the structure and definition of the task based on the elements to be solved.

3.1 Definitions and Problems in Previous Research

To structure the task, Watanabe et al. [3] defined three tasks: (i) the purpose of the code, (ii) the actual process (code), and (iii) verification of the understanding of the task. In addition, the tasks are related to is-a relations or part-of relations and support the transition of learners.

Watanabe et al. discussed the association between a certain process and a specific purpose. However, several processes can achieve the same purpose, and accordingly it is insufficient to discuss one particular process. To discuss multiple processes associated with a purpose, it is necessary to discuss the behavior of the process by which a certain purpose is achieved. Additionally, to position the purpose of a certain task, the purpose as a whole is required. In such a case, a task cannot be reused for other purposes and does not have the property of reusability. In order for a task to be reusable, it is necessary to discuss the functions of the subject, rather than the purpose. Therefore, in this study, we discuss the characteristics of functions, behaviors, and processes separately for the task, and we aimed to make tasks reusable.

3.2 Problem-Solving Process

In general, in the problem-solving process, it is necessary to achieve the target end state by applying the operation sequence to the initial state (Fig. 1). Similarly, in the problem-solving process in physics, it is necessary to achieve the end state by applying the operation sequence for the phenomenon to the initial state. At this point, the difference between the initial state and the end state is observed as a behavior of a certain operation sequence. For example, in Fig. 2, the object M is moving to the right from the initial state to the end state. The movement of object M can be considered a change caused by a series of operations, that is, a behavior. In physics, such a behavior can be interpreted as a function, such as “uniform motion.” Furthermore, it can be interpreted not only as “uniform motion,” but also as “rightward motion” and “frictionless movement.” In other words, the functions that can be inferred from behaviors are not uniquely limited, and multiple interpretations are possible depending on the conditions at each point.

Fig. 1.
figure 1

General overview of the problem-solving process.

Fig. 2.
figure 2

Problem-solving process in physics.

The properties of a task in problem-solving in physics are understood in terms of a superficial difference, such as “an object is hanging on a thread/hanging on a spring.” Despite this superficial similarity, the solution to be applied differs substantially. However, the learner assesses the properties of the task from these surface features and applies a similar or a different solution to the task to which the same solution can be applied. In these cases, Horiguchi et al. [4] argue that it is important not only to determine the surface features of the task (i.e., the surface layer structure), but also to understand the structural features (i.e., the deep layer structure), to which appropriate principles and laws can be applied.

As with physics, even in the target programming in this research, the target end state is achieved by giving the source code as the operation sequence from the initial state of the variable. The source code in this initial state and the end state, that is, the difference caused by processing, can be observed as a behavior (Fig. 3). It is possible to interpret meaningful behaviors as functions. However, it is difficult to interpret behaviors as a function in the form of “C = A” in Fig. 3 without an excess or deficiency. That is, functions and behaviors do not necessarily correspond. If functions and behaviors do not correspond, learners can only obtain a superficial understanding by grasping functions alone. Therefore, they do not develop an understanding of the operation series that should be specifically applied. Horiguchi et al. emphasized that an understanding of functions is an understanding of the surface structure, and an understanding of behavior and processing is an understanding of the deep structure. Based on the points made by Horiguchi et al., we considered that an understanding of functions is an understanding of the surface structure and an understanding of behavior and processing is understanding of the deep structure.

Fig. 3.
figure 3

Problem-solving process in programming.

3.3 Basic Concept in Tasks

As described in Sect. 2, a task includes three properties: processing, behavior, and function. In this section, in order to handle tasks, we discuss the relationships among processing, behavior, and function after positioning each property.

Processing.

The definition of processing in this research is an operation series that causes a difference between the initial state and the end state, that is, the source code. In addition, primitive operations are handled as statements, including assignment statements, if statements, and for statements. In addition, it handles its own abstract language as a method for expressing processing in tasks owing to the focus of this study on a general understanding that does not depend on a specific language in programming learning.

Behavior.

The definition of behavior in this research is the difference occurring between the initial state and the end state of the variable. Variables include iterators, such as for statements. That is, we do not distinguish between specific scopes, such as global or local variable states. The difference between the initial state and the end state of a variable is considered to follow a certain rule that determines the end state via a process, regardless of the value of the variable. Therefore, the behavior itself is described as a set of constraints that can be read from changes in variables between input and output. For example, in Fig. 3, three constraints, “A is B,” “B is A,” and “C is A,” are necessarily satisfied between the initial state and the end state. However, it is difficult to observe such constraints by relying on the input state of variables in recursive processing, such as for statements. Therefore, in this paper, the discussion of behavior is not detailed in the stepwise task sequences.

Function.

The aim of the function in this research is to interpret a certain behavior after estimating the function series based on the goal. Sasajima et al. [5] also stated that a function does not interpret a behavior without excess or deficiency, but implies a certain behavior. On the other hand, Sasajima et al. point out that a valid function is one that interprets a behavior after understanding the ultimate goal. In other words, if a function is regarded as a part, when a structure one level above exists as a whole, for the first time, that part has meaning in the context of a structure, e.g., when the whole function is swap, “temp” meaning, but swap itself has no meaning. The handling of such functions has the advantage that the position of the function is set in the series, so that erroneous function positioning is not possible. However, if a target sequence and its function are positioned, it becomes difficult to reuse the function by directly applying it to other target sequences. Therefore, in this research, we assumed that functions do not necessarily connect with a single goal on a one-to-one basis, and estimate the possible overall goals for each function and position the function.

Relationships Among Processing, Behavior, and Function.

Let us describe the relationships between processing, behavior, and function. For example, the behaviors of two different processes, simple sort and selection sort, are considered to be similar in terms of rearranging the array. Additionally, considering each function, the same function is obtained in the interpretation of “rearranging the arrays.” However, the learner sees these two as the same function, and sometimes judges that it is equivalent in behavior and processing. This is an understanding of a surface structure, as pointed out by Horiguchi et al. [4]. To promote an understanding of a deep structure, it is necessary to understand behavior and processing. Therefore, the task sequences in this research are based on the development of processing.

4 Construction of Task Sequences

In this chapter, as described earlier, we will examine the stepwise task sequence for gradual learning based on the development of processing.

An increase or decrease in the processing of the problem-solving process is equivalent to an increase or decrease in the required solution. By learning stepwise from a solution with a smaller grain size, it is possible to increase the transparency of the basis for executing individual processing [1]. In the task sequences in this chapter, it is assumed that the function is given to the learner, and the processing is handled as a correct answer. Therefore, in order to construct stepwise task sequences based on processing, it is necessary to design functions to be given as tasks in order to create relationships that gradually expand individual processing. Therefore, in this research, with reference to GMW [2], we consider stepwise task sequences based on the development of progressive processing. In GMW, a Microworld is a simulation of a specific phenomenon that limits the scope of handling so that the learner can understand the underlying laws and principles, mainly in physics. In this research, the task is shifted stepwise. By this transition, the learner understands the difference between the tasks and learns gradually. A task migration method includes (1) migration by modifying a part of the process in the same sequence and (2) migration by developing the process to a different sequence. In these transitions, learners can learn to acquire other functions by reworking the processing or to reuse them from the already learned sequence. In addition, the relationship between tasks in task series is classified into three types: (1) part-of relations, (2) is-a relations, and (3) formal part-of relations uniquely defined in this research.

The migration of tasks (1) to (3) includes (a) migration in the same sequence by extending part of the process and (b) migration to another sequence by modifying part of the process (learning-transfer). However, in this paper, we cannot conduct a detailed discussion of the kind of transition relation that should be defined for the link in (b), and it is defined as a migratable link. Furthermore, in this paper, we made prototypes of task sequences for simple sorting, selection sorting, bubble sorting, and insertion sorting.

First, the relationships (1)–(3) will be explained based on the task sequence of simple sorting (Fig. 4). In simple sorting, looking first at the relationship between A1 and A2, since A2 is included in A1, it is understood that it is a part-of relation. Next, looking at the relationship between A2 and A2-a, since A2-a is defined by excluding a part of the behavior of the outer for-loop in A2, A2-a is a specialization of A2. Therefore, this relation is an is-a relation. Then, looking at the relationship between A2-a and A3, A3 performs the same behavior as A2-a, but exhibits a substantial semantical difference depending on the presence or absence of an outer for-loop. Although such task sequences are effective for learning differences from the presence or absence of concepts, they cannot be established in the absence of the relationship between A2 and A3. Therefore, in this research, this relation was regarded as a formal part-of relation.

Fig. 4.
figure 4

Task sequence for simple sort algorithms.

Using the above relationships, assignment sort, bubble sort, and insert sort task sequences were constructed (Figs. 5, 6 and 7). First, learning-transfer will be discussed using task sequences of simple sorting and selection sorting. In the figures, A5 is a common problem between a task sequence and selection sort. Additionally, A4 and B4 are in the migratable link, whose behavior is the same. The same is true for task sequences of the simple sort and bubble sort. On the other hand, the migration between simple sort and insertion sort task sequences is described in Figs. 4 and 7. Between A4 and D3, D3-a, A4 and D3, and A4 and D3-a, a migratable link is established between D3 and D3-a, and a migratable link is established between D3 and D3-a. The relationship between D3 and D3-a is defined by the same learning goal; accordingly, the relationship is unidirectional. However, since A4, D3, and D3-a are equivalent in behavior, it can be said that mutually migratable links are established.

Fig. 5.
figure 5

Task sequence for selection sort algorithms.

Fig. 6.
figure 6

Task sequence for bubble sort algorithms.

Fig. 7.
figure 7

Task sequence for insert sort algorithms.

The selection sort and bubble sort task sequences can be constructed using the description of the simple sort task sequence. As a result, this construction method is effective for constructing other task sequences.

However, the insert sorting task sequence cannot be described conventionally in terms of negating processing in if conditional statements and requiring controlled exit from for-loops. For this reason, we constructed an insertion sort by adding else and break statements. By adding a new notation, we were able to increase the number of tasks that can be dealt with by the construction method of this task sequence. Additionally, recursive processing and other functions can be described in the future. However, it is difficult to understand the essential structure of the process because the notation becomes cumbersome, and accordingly caution is needed.

5 Discussion

In this research, we aimed to build stepwise task sequences in programming. We point out that processing, behavior, and function and the relationships among these features describe the nature of problems in programming, and we examined the trial production of problem series using these properties. In addition, we constructed multiple task sequences and verified the construction method. Moreover, we showed that it is possible to migrate tasks in multiple task sequences.

To enable the migration of the task to the learner, an understanding task is required to grasp the problem. In addition, the authors think that the skills necessary for learners in the migration of tasks are different depending on links between tasks. Therefore, future studies, with reference to the approach of Watanabe et al. [3], should focus on the addition of understanding tasks to each task and examination of necessary understanding skills in links between tasks. In addition, it is possible that tasks with similar behaviors, like those of A5 and C5 in Figs. 4 and 6, can be regarded as common semantic structures from a certain perspective, and this should be evaluated in future studies. Therefore, we believe that a sequence in the semantic structure will be established, and we consider that each task is established as an instance.