Model-Driven Programming Education

download Model-Driven Programming Education

If you can't read please download the document

description

Model-Driven Programming Education. Workshop @ ACE 2013. Michael E. Caspersen Department of Computer Science and Centre for Science Education Aarhus University, Denmark [email protected]. Three Perspectives on Programming. Instructing the computer (coding) - PowerPoint PPT Presentation

Transcript of Model-Driven Programming Education

Programmering fra instruktion til modellering

Model-DrivenProgramming EducationMichael E. CaspersenDepartment of Computer Scienceand Centre for Science EducationAarhus University, [email protected]

Workshop @ ACE 2013ACE 2013, Adelaide, AUSModel-Driven Programming Education2Three Perspectives on ProgrammingInstructing the computer (coding)the purpose of programming is to instruct the computerfocus is on aspects of program execution such as storage layout, control flow, parameter passing, etc.

Managing the program descriptionthe purpose of programming is to create a software architecture that provides overview and understanding of the entire programfocus is on aspects such as visibility, scope, encapsulation, modularity, software design etc.

Conceptual modelingthe purpose of programming is to express concepts, structure and relationsfocus is on constructs for describing concepts, phenomena and relations between theseACE 2013, Adelaide, AUSModel-Driven Programming Education3Characterization and ExpectationsCharacterise the introductory programming course at your home institutionother views on programming?how are the views balanced in the intro course?what defines the progression in your intro course?

What are your expectations for this workshop?ACE 2013, Adelaide, AUSModel-Driven Programming Education4Contents and ProgressionTraditional approachtypical textbooks only address the first and to some extend the second perspectivetopics are organized according to the syntactical structures in the programming language (bottom-up)tendency to completeness in coverage of topicssyntax-driven progression

Our approacha balanced coverage of all three viewsconceptual modeling is leading the waysystematic programming (no more pulling rabbits out of the hat)early bird & spiral approachmodel-driven progression5Sample Exam Assignment PlaylistString playlistNamevoid addTrack(Track t)void removeTrack(Track t)Track findShortestTrack()List find(String s)void printSortedTracks()* TrackString artistString songNameint minint secString toString() Drivervoid exam()Create a simple class Track ... with constructor and a toString methodCreate a test method examCreate two instanciesCreate a new class Playlist ...Implement the methods addTrack and removeTrackModify the test method to create a Playlist objectImplement and test method findShortestTrackImplement and test method findTracksByArtist Let the Track class implement interface Comparable Implement the method printSortedTracks and modify ...ACE 2013, Adelaide, AUSModel-Driven Programming Education56The Complete Model PlaylistString playlistNamevoid addTrack(Track t)void removeTrack(Track t)Track findShortestTrack()List find(String s)void printSortedTracks() TrackString artistString songNameint minint secString toString() Drivervoid exam()Collectionsvoid sort(List l)Comparableint compareTo(T e)Javas Collections Framework*ACE 2013, Adelaide, AUSModel-Driven Programming Education

6Learning Goals and Examination FormBy the end of the course the students must be able toapply fundamental constructs in an ordinary PLexplain the architecture of simple programsexplain the semantics of simple specification modelsimplement simple specification models in an ordinary PLapply selected classes from a standard class libraryACE 2013, Adelaide, AUSModel-Driven Programming Education7Oral ExamWritten ExamMultiple ChoicePractical Exam

AlignmentWeekly mandatory assignments prepare the students for the exambut dont count in the final grading

ACE 2013, Adelaide, AUSModel-Driven Programming Education8Course Context and StructureA Quarter (7 weeks)1234567Q2Q3Q4An Academic YearQ1ProgressionComplexity of class models (language stuff added by need)89Course Phases (week numbers)(1) Getting startedOverview of fundamental concepts. Learning the IDEs and other tools.(2) Introduction to the basicsClass, object, state, behaviour, control structures.(3-4) Conceptual framework and structural patterns Control structures, data structures (collections),class relationship, patterns for implementingstructure (association).(4-5) Programming methodSTREAM, patterns for implementing functionality (algorithmic patterns).(6) Subject specific assignmentPractice on harder problems.(7 (+ 8-9)) PracticeAchieve routine in solving standard tasks (prep for exam).ACE 2013, Adelaide, AUSModel-Driven Programming Education9ACE 2013, Adelaide, AUSModel-Driven Programming Education10Key Points (and Agenda)Conceptual modellingConceptual modelling is the defining characteristic of OO

ProgressionProgression in terms of complexity of class models (not syntax of a programming language)

Systematic programmingSystematic programming revealed through basic (structural and algorithmic) patterns and STREAM (a programming method for novices)

Learning-theoretic foundationA learning-theoretic foundation (Cognitive Load Theory, Cognitive Apprenticeship, and Worked Examples)

Me: 25+ years of teaching experience- introductory programming for 25+ years- introductory object-oriented programming for 20+ years

Drop-out rates down from 48% to ~10%10ACE 2013, Adelaide, AUSModel-Driven Programming Education11ReferencesO.L. Madsen, B. Mller-Pedersen and K. Nygaard (1993): Object-Oriented Programming in the BETA Programming Language, Addison-Wesley. [ Link ]M.E. Caspersen (2007),Educating Novices in the Skills of Programming, DAIMI PhD Dissertation PD-07-4, ISSN 1602-0448 (paper), 1602-0456 (online). [ Link ]M.E. Caspersen and J.B. Bennedsen (2007),Instructional Design of a Programming Course: A Learning-Theoretic Approach, Proceedings of the 3rd International Computing Education Research Workshop, ICER 2007, Atlanta, GA, USA, September 2007, pp. 111-122. [ Link ]J.B. Bennedsen and M.E. Caspersen (2007),Assessing Process and Product A Practical Lab Exam for an Introductory Programming Course, Innovation in Teaching and Learning in Information and Computer Sciences, Vol. 6 (4), Special Issue on Innovative Methods of Teaching Programming, pp. 183-202. [ Link ]J.B. Bennedsen, M.E. Caspersen and M. Klling (2008),Reflections on the Teaching of Programming, Lecture Notes in Computer Science, Vol. 4821, Springer-Verlag. [ Link, ToC ]J. B. Bennedsen and M.E. Caspersen (2008),Model-Driven Programming, in [5], pp. 116-129.[Link ]M.E. Caspersen and M. Klling (2009),STREAM: A First Programming Process, ACM Transactions on Computing Education (TOCE), Vol. 9 (1), Article No. 4, pp. 1-29. [ Link ]Me: 25+ years of teaching experience- introductory programming for 25+ years- introductory object-oriented programming for 20+ years

Drop-out rates down from 48% to ~10%11A Conceptual Framework forObject-Oriented ProgrammingThere is more to OO than Java...ACE 2013, Adelaide, AUSModel-Driven Programming Education13Kristen Nygaard on Object-Orientation

A program execution is regarded as a physical model system simulating the behavior of either a real or imaginary part of the world.

Physical modeling is based upon the conception of reality in terms of phe-nomena and concepts.

A physical model system is construc-ted, modeling phenomena by objects and concepts by categories of objects.

Kristen Nygaard, 1926-2002 An Interlude on ConceptsACE 2013, Adelaide, AUSModel-Driven Programming Education14What is a concept?ACE 2013, Adelaide, AUSModel-Driven Programming Education15Concepts and phenomenons of EPRElectronic Patient Record (EPR)

Patient (Lance Armstrong, John Kerry, ...)

Treatment (bandaging, rest, physical therapy, ...)

Diagnosis (sprained wrist, broken leg, yellow fever, ...)

Operation (removing the appendix, sterilization, brain surgery, ...)

Doctor (Beth Barry, Lou Lazanta, ...)

Nurse (Jane Clemenza, Laura Hopcroft, ...)ACE 2013, Adelaide, AUSModel-Driven Programming Education16Model of EPR

Problem domainModelDoctorPatientDiagnosisTreatmentSeniorDoctorJuniorDoctor...*1**ACE 2013, Adelaide, AUSModel-Driven Programming Education17Conceptual ModellingConceptual model(problem-specific concepts)Problem/vision concerning phenomenaSpecification model (realised concepts)Objects (program, language, OS, machine)abstractionabstractionmodellingProblem domainModelACE 2013, Adelaide, AUS18Phenomena and ConceptsA phenomenon isa thing that has definite, individual existence in reality or in the mind; anything real in itself

A concept isa generalised idea of a collection of phenomena, based on knowledge of common properties of instances in the collectionModel-Driven Programming EducationACE 2013, Adelaide, AUS19Characterisation of ConceptsDesignationThe collection of names (or pictures) by which the concept is known

ExtensionThe collection of phenomena that the concept somehow covers

IntensionThe collection of properties that in some way characterize the phenomena in the extension of the conceptModel-Driven Programming EducationACE 2013, Adelaide, AUS20Examples of ConceptsDesignation ExtensionIntensionHorse

Car

Rectangle

FoodModel-Driven Programming EducationACE 2013, Adelaide, AUS21Aristotelian ViewCharacterisation (intension :-)The intension is a collection of properties that may be divided into two groupsdefining properties that all phenomena in the extension must havecharacteristic properties that the phenomena may haveWell-defined concepts with sharp bordersRelatively homogeneous phenomenaThe extension is uniquely determined by the intension (objectively determinable)

Examples (extension :-)Does to some extend exist in well-established topic areas such as mathematics, physics, zoology, botany, ...Model-Driven Programming EducationACE 2013, Adelaide, AUS22Prototypical ViewCharacterisation (intension :-)The intension of a concept consists of examples of properties that phenomena may have, together with a collection of typical phenomena covered by the concept: prototypesBlurry concepts with vague bordersGreat variation among phenomenaThe extension is not uniquely determined by the intension

Examples (extension :-)Everywhere!Model-Driven Programming EducationACE 2013, Adelaide, AUS23Conceptual Modelling, revisitedProblem Specific Concepts (PSC) are almost always of prototypical nature

Realised Concepts (RC) are Aristotelian (because of our programming languages)

This mismatch represents a challenge for modellingto give an Aristotelian definition to prototypical conceptsProblem domainModelRCPSCModel-Driven Programming EducationACE 2013, Adelaide, AUSModel-Driven Programming Education24Concept FormationIdentification of phenomenaSocratesBatmobileHannibals march across the AlpsNeil YoungSirius 2000HerbieHillary Clinton

ClassificationPersonSocratesNeilHillaryCarBatmobileHerbieJourneySirius 2000Hannibals march across the AlpsACE 2013, Adelaide, AUSModel-Driven Programming Education25Classification in UMLClasses represent concepts,objects represent phenomena

ExampleConcept: PersonPhenomena: Bruce, Paul, MichaelPersonisTeenager()isOld()age()String nameint ageClass: PersonBruce63: PersonPaul70: PersonMichael52Objects

ACE 2013, Adelaide, AUSModel-Driven Programming Education26Classification in Java

class Person { private String name; private int age;

public Person(String name, int age) { this.name = name; this.age = age; }

public void birthday() { age++; }

public isTeenager() { return (age >= 13 && age