13th Workshop “Software Engineering Education and Reverse

37 Slides1.35 MB

13th Workshop "Software Engineering Education and Reverse Engineering" Using Flowchart-based Programming Environments for Simplifying Programming and Software Engineering Processes Stelios Xinogalos Department of Applied Informatics School of Information Sciences University of Macedonia Thessaloniki, Greece [email protected]

INTRODUCTION Visual formalisms have attracted great interest and have been heavily used in Computer Science and related fields. A characteristic example is Harel’s statecharts that resulted from an effort to define diagrams that describe the behavior of reactive systems. Statecharts were initially devised for avionics, but are now used in telecommunications, hardware design, control systems and other areas, while a variant of them has become part of UML.

INTRODUCTION Flowcharts are a type of charts that have been heavily utilized in the past as a means of introducing novices to algorithms and programming. Flowcharts can be very effective for visual learners both for writing and comprehending algorithms. After several years of utilizing flowcharts as a means of learning algorithms and programming, they were gradually abandoned due to: – the fact that designing and especially modifying flowcharts using paper and pencil is an impractical, time-consuming and tedious process for novices – flowcharts in paper format are static and do not provide any help for comprehending neither the dynamic nature of program execution nor the control structures

CONTENTS Comparative analysis flowchart-based environments. Emphasis is given on fundamental technologies and advanced features of contemporary environments. Experiences on using RAPTOR for preparing educational material for an introductory programming course. Conclusions are drawn regarding possibilities for research on the field and for utilization of such environments for a brief and simplified introduction to other fundamental fields, concepts and models of software engineering (in addition to programming).

PART I: COMPARATIVE ANALYSIS OF FLOWCHART-BASED PROGRAMMING ENVIRONMENTS

FUNDAMENTAL TECHNOLOGIES Syntax-directed editing Structure editors Iconic programming languages Software visualization Program animation

COMPARATIVE ANALYSIS Flowchart-based programming environments that were developed for academic and not commercial purposes are reviewed. For each environment important data are presented regarding: availability program development program execution automatic source code generation evaluation

COMPARATIVE ANALYSIS - availability Environment BACCII/ BACII FLINT SFC Editor RAPTOR SICAS SICAS-COL H-SICAS ProGuide B# Iconic Programmer Progranimate Available Several programming environments based on an iconic, flowchart-based notation have been developed, starting back from 1994 with BACCII. Four out of the eleven most referenced environments reviewed are available. This kind of programming environments has attracted so much interest that even nowadays the development of new environments is announced.

COMPARATIVE ANALYSIS - availability Iconic Programmer RAPTOR Progranimate SFC Editor

COMPARATIVE ANALYSIS - notation same common Environment shaped symbols icons BACCII/ BACII FLINT SFC Editor RAPTOR SICAS SICAS-COL H-SICAS ProGuide B# Iconic using Programmer text Progranimate Programs are developed with the form of a flowchart. In some cases, symbols have the same shape and a characteristic icon: iconic programming languages. Iconic programming languages, usually, have an extended instruction set. Some environments use a hybrid approach. For example, in Iconic Programmer same shaped icons are used with a label showing the type of the statement. In RAPTOR, UML class diagrams are also supported when the user selects

COMPARATIVE ANALYSIS – programming paradigm Environment BACCII/ BACII FLINT SFC Editor RAPTOR SICAS SICAS-COL H-SICAS ProGuide B# Iconic Programmer Progranimate Imperative procedural Object Oriented The vast majority of flowchartbased programming environments support the imperative-procedural programming. BACCII and RAPTOR support both procedural and objectoriented programming. RAPTOR: – UML class diagrams – Inheritance, polymorphism, class nesting, association, composition, aggregation and dependency can be depicted – structured flowcharts are used for implementing the body of each method declared in a class

COMPARATIVE ANALYSIS - execution Program animation provides great support in: – comprehending the semantics of programming structures – comprehending flow of control – locating and correcting logic errors Automatic update of variables gives the ability to run the program with different data sets and comprehend both the role and modification of variables depicted in the chart

COMPARATIVE ANALYSIS - execution Environment BACCII/ BACII FLINT SFC Editor RAPTOR SICAS SICAS-COL H-SICAS ProGuide B# Iconic Programmer Progranimate Program animation Flowcharts are executed using program animation with automatic update of variables (exceptions: BACII/BACCII , SFC) SICAS: backward step by step execution is possible B#: users can execute the Borland Pascal source code automatically generated from the flowchart ProgrAnimate: synchronized step by step execution of both the flowchart and the code automatically generated Iconic Programmer: explanatory visualization is used for presenting explanatory messages in natural language

COMPARATIVE ANALYSIS – automatic source code generation Supports novices in comprehending the relation between algorithms described with a flowchart and its implementation in a programming language. Gives the chance to study and run the program that corresponds to their algorithm, without having to be concentrated from the very beginning to the difficult, time-consuming and sometimes frustrating process of debugging. The ability of generating source code in various languages presents in a clear manner the fact that a well-designed algorithm can be easily translated to various programming languages. The most important factor in solving a problem is designing an algorithm and not thinking of it in the context of the programming language that will be used for implementing it.

COMPARATIVE ANALYSIS – automatic source code generation Environment BACCII/ BACII FLINT SFC Editor RAPTOR SICAS SICAS-COL H-SICAS ProGuide B# Iconic Programmer Progranimate Languages Pascal, C, Fortran, Basic, C Pseudo code in C or Pascal Ada, C#, C , Java Pseudo code, C, Java Borland Pascal Pseudo code, Java, Turing, C/C Java-like pseudo code, Java, VisualBasic.NET, VisualBasic 6.0, Pascal, JavaScript Most of the environments offer more than one target language choices, with more common Pascal and Java. BACCII/BACCII , RAPTOR, SICAS, B#, Iconic Programmer and Progranimate generate syntactically correct source code, ready to execute B# supports the execution of the source code within the environment Progranimate supports the synchronized execution of the flowchart and the source code. RAPTOR offers the ability of developing a generator of source code for other languages by developing a C# class.

COMPARATIVE ANALYSIS - evaluation Environment BACCII/ BACII FLINT SFC Editor RAPTOR SICAS SICAS-COL H-SICAS ProGuide B# Iconic Programmer Progranimate Evaluation Evaluation results are available for several of the environments reviewed. However, all these studies were carried out by, or with the participation of, the teams that developed them. Unfortunately, we could not locate independent studies not even for RAPTOR that according to its developers is used in seventeen countries around the world. Such evaluation seems to be more easily carried out for Progranimate, since evaluation materials and links both for students and experts are available in the web site of the tool.

COMPARATIVE ANALYSIS – special features Environment Special features FLINT Imposes the waterfall programming model RAPTOR Notation: UML class diagram Source code generation: allows development of source code generators for other languages SICAS Execution: stepping backward SICAS-COL Supports collaborative activities H-SICAS Adaptation of SICAS for usage on mobile devices ProGuide Uses a tutoring system model B# Both the flowchart and the generated program can be executed Iconic Execution: explanatory visualization Programmer Progranimate Deployment: can be integrated into a web page Execution: synchronized execution of flowchart & source code

PART II: EXPERIENCE IN PREPARING EDUCATIONAL MATERIAL WITH RAPTOR

MOTIVATION After teaching for several years an introductory Computer Programming (imperative-procedural, based on C) course at the Technology Management Department at the University of Macedonia it was clear that students face several difficulties. Taking into account the facts that: Most of our students have been introduced to the main principles of procedural-imperative programming at the 3rd Grade of the Lyceum, with the use of a pseudo-language and flowcharts. Students always ask for exemplary solved exercises. the decision to prepare supplementary material for standalone study by students was taken.

USING MULTIPLE REPRESENTATIONS The material was decided to contain a set of exemplary solved exercises using multiple representations : pseudo-code flowchart program in C along with methodology for solving similar problems. Hypothesis: both visual and non-visual learners, as well as experienced and non-experienced students would be able to select as a starting point the representation that better suits them for comprehending basic programming concepts. RAPTOR was representation”. utilized for designing the “flowchart

EXPERIENCE WITH RAPTOR Basic statements: variables, input, output, assignment, expression Selection structures: if, if.else, if else if, switch, nesting Repetition structures: while, for, do while, nesting Functions: defining and calling functions, return type, parameters, arguments Arrays Pointers: using pointers as parameters Strings: strings as arrays of characters, functions for manipulating strings

EXPERIENCE WITH RAPTOR – things to be aware of Basic statements: variables, input, output, assignment, expression In RAPTOR there is no explicit variable and data type declaration. RAPTOR variables: – – – are implicitly declared on first use (assignment or input statement) they must be assigned a value on first use and based on that value it’s data type will be Number, String, or an Array of Numbers Automatically generated C source code: int main() { ? b; ? a;

EXPERIENCE WITH RAPTOR – things to be aware of Selection structures: if.else, if else if, switch 1 2 if (GPA 3) { cout "Dean's list!" endl; } else { } if, 1 2 if (GPA 2) { cout "Academic Probation" endl; } else { cout "Cadet in good standing" endl; }

EXPERIENCE WITH RAPTOR – things to be aware of 3 if (GPA 3,5) { GPA Grade "A"; } else { if (GPA 3) { GPA Grade "B"; } else { if (GPA 2) { GPA Grade "C"; } else { GPA Grade "Fail"; } } } 3 Nested if/else structures are used in the generated source code

EXPERIENCE WITH RAPTOR – things to be aware of RAPTOR proposal There is one kind of loop but with the possibility to check the condition in different places. The RAPTOR loops stop executing when the condition becomes true! If you want to exit when the condition is false set the HKEY LOCAL MACHINE\Software\Raptor\reverse loop logic to true. registry entry

EXPERIENCE WITH RAPTOR – things to be aware of int main() { ? n; N 1; while (1) { cout N " squared is " N ** 2 endl; if (N 10)) break; N N 1; } return 0; } A for loop can be depicted, but the generated source code is a middle-exit while loop.

EXPERIENCE WITH RAPTOR – things to be aware of Functions: defining and calling functions, return type, parameters, arguments RAPTOR has built-in functions (math, trigonometric, string), but it supports only user-defined procedures and not functions. RAPTOR procedures can have: – input parameters – output parameters – input/output parameters

EXPERIENCE WITH RAPTOR – things to be aware of Even when the user creates a subprogram that returns just one value (function) in RAPTOR it is created as a procedure with an output parameter: pointers Automatically generated C source code: void separation ( ? i; ? Variable *y1; ? Variable *y2; ? Variable *y3) { y1 i % 10; y2 floor(i/100); y3 floor(i/10) % 10; }

EXPERIENCE WITH RAPTOR – results No formal evaluation of the didactical value of the material has taken place yet. However based on discussions with students, it seems that: several students find the material useful for comprehending programming concepts and carrying out their weekly assignments students with prior experience in pseudo-language/flowcharts are supported in making the connection to the more strict syntax in C – however, it is not clear whether pseudo-language or flowcharts are more heavily utilized students without prior experience are also supported in comprehending programming concepts and algorithms expressed in the pseudo-language

PART III: CONCLUSIONS & POSSIBILITIES FOR RESEARCH

CONCLUSIONS (1) Contemporary Flowchart-based environments have advanced features: Support for object-oriented programming and UML class diagrams [RAPTOR] Running through the program automatically generated from the flowchart, and not just the flowchart [B#] Synchronized execution of a flowchart and the corresponding source code [Progranimate] Explanatory visualization [Iconic Programmer, partially in Progranimate] Integration into a Learning Management System, or utilizing it for developing an enhanced e-learning system [Progranimate] Support for collaborative activities [SICAS-COL] Usage in mobile devices [H-SICAS] Integrating a tutoring system model [ProGuide]

CONCLUSIONS (2) A Flowchart-based environment integrating the recorded advanced features would be even more effective: It would be interesting to devise an environment that integrates the advanced features that appear in different environments in a way that the environment does not lose its simplicity. Such an environment could support: – procedural and object-oriented programming – step by step execution and data visualization – automatic generation of syntactically correct source code in various modern production programming languages – collaborative activities and distributed pair programming and – ideally run on the web and mobile devices that are currently part of students’ everyday life

CONCLUSIONS (3) RAPTOR supports effectively the fundamental imperativeprocedural programming concepts/constructs Input, output, assignment, selection, repetition, functions, arrays, functions User-friendly GUI Step by step execution with automatic data visualization Automatic generation of source code, which however needs some interventions It works fully only on Windows and with some features removed on Ubuntu

CONCLUSIONS (4) Evaluation of the didactical/pedagogical value of flowchartbased programming environments is required: The advanced features of programming environments based on an iconic, flowchart-based notation are based on technologies that have generally proven useful in the area of programming. However, they have not been adequately evaluated in the context of the specific kind of programming environments. Research on this area is required in order to shed light on the true didactic and pedagogical value of flowchart-based programming environments in introducing novices to programming.

CONCLUSIONS (5) Investigation of potential usage of such environments for introducing students to SE concepts: It would be interesting to investigate at what degree such environments could be used for introducing novices to other fields, concepts and models of software engineering in addition to programming. RAPTOR, which is the most complete environment of this kind, could be used for devising special hands-on activities for familiarizing students with various software engineering topics in a simplified manner: – presenting the importance of software design (in the context of a problem demanding “good” design, i.e a game) – utilization of UML diagrams (designing multiple class solutions) – necessity for software testing (taking into advantage program animation) – synergy of programming paradigms

REFERENCES Stelios Xinogalos. 2013. Using Flowchart-based Programming Environments for Simplifying Programming and Software Engineering Processes. In Proceedings of 4th IEEE EDUCON Conference, Berlin, Germany, 13-15 March 2013, IEEE Press, 1313-1322. Presented in the Special Session “Technical Didactic Software Engineering” Stelios Xinogalos. 2012. Programming Techniques and Environments in a Technology Management Department. In Proceedings of the 5th Balkan Conference in Informatics (BCI 2012), 16-20 September, Novi Sad, Serbia, ACM, New York, NY, USA, 136-141.

Thank you!

Back to top button