01 Εισαγωγή - NTUA€¦ · programming is to become an important part of computer research...

Post on 03-Jul-2020

7 views 0 download

Transcript of 01 Εισαγωγή - NTUA€¦ · programming is to become an important part of computer research...

01 ΕισαγωγήΣχολή Hλεκτρολόγων Mηχανικών & Mηχανικών YπολογιστώνΕθνικό Μετσόβιο Πολυτεχνείο

Χειμερινό εξάμηνο 2017‐18

Δρ. Κώστας Σαΐδης ﴾saiko@di.uoa.gr﴿

Διαδικασία ανάπτυξης μικρού καιαπλού λογισμικού

W.W. Royce, www‐scf.usc.edu/~csci201/lectures/Lecture11/royce1970.pdf 2

Ανάπτυξη μεγάλου και σύνθετουλογισμικού;

Τεχνολογία Λογισμικού

Μεθοδολογίες, τεχνολογίες, εργαλεία και πρακτικές για τη βέλτιστηυλοποίηση σύνθετων έργων λογισμικού

3

Τεχνολογία λογισμικούΜεγάλα έργα

Με πολλές και μεγάλες ομάδεςΜε πολύπλοκες απαιτήσειςΜε οικογένειες εφαρμογώνΜε πολλές παράλληλες αλλαγές και εκδόσεις

Που χρησιμοποιούνται για πολλά χρόνια

4

Τεχνολογία ΛογισμικούΓιατί μας απασχολεί η τεχνολογία λογισμικού;

Γιατί το λογισμικό, αν και κατέχει πλέον, σημαίνοντα ρόλο σεόλες σχεδόν τις δραστηριότητες της ανθρωπότητας είναι πολύδύσκολο να αναπτυχθεί "σωστά"!

5

Σωστά;Εντός προϋπολισμούΈγκαιραΙκανοποιώντας πλήρως τους χρήστες του

Χωρίς λάθη και προβλήματα στη λειτουργία τουΝα είναι αξιόπιστο, να είναι εύκολο να συντηρηθεί, ναεπεκταθεί, κτλ.

6

Τι το ιδιαίτερο έχει η ανάπτυξηλογισμικού;Γιατί είναι δύσκολο να γίνει "σωστά";

Most software today is very much like an Egyptian pyramidwith millions of bricks piled on top of each other, with nostructural integrity, but just done by brute force andthousands of slaves.”

Alan Kay

7

Alan Kay"Alan Curtis Kay is an American computer scientist ... bestknown for his pioneering work on object‐orientedprogramming and windowing graphical user interface design."﴾Wikipedia﴿.

Βραβείο Turing ﴾2003﴿.

8

Ένας ﴾πιθανός﴿ λόγοςΣτα μεγάλα έργα λογισμικού εμπλέκονται πολλοί συμμετέχοντες:

ΧρήστεςΠελάτεςΔιοίκηση ﴾ακόμα και Μέτοχοι ή Επενδυτές﴿Προγραμματιστές

ΔοκιμαστέςΣχεδιαστές διεπαφώνΥπεύθυνοι έργουκτλ.

9

ΕπομένωςΚάθε ένας από τους συμμετέχοντες έχει διαφορετικές εμπειρίες,βιώματα, αφετηρίες, στόχους και επιδιώξεις από την υλοποίησητου έργου.

Είναι δύσκολο να επιτευχθεί ένας κοινός τόπος, σωστάιεραρχημένος για το όφελος του έργου και, συνάμα,ικανοποιητικός για όλους τους συμμετέχοντες.

10

Δεύτερος ﴾πιθανός﴿ λόγοςMost software estimates are performed at the beginning ofthe life cycle. This makes sense until we realize that estimatesare obtained before the requirements are defined and thusbefore the problem is understood. Estimation, therefore,usually occurs at the wrong time.

Robert Glass

11

Robert Glass"Robert L. ﴾Bob﴿ Glass ﴾born 1932﴿ is an American softwareengineer and writer, known for his works on softwareengineering, especially on the measuring of the quality ofsoftware design and his studies of the state of the art ofsoftware engineering research." ﴾Wikipedia﴿

12

Robert L. Glass, "Facts and Fallacies of Software Engineering",Addison Wesley, 2002, 0‐321‐11742‐5.

13

Τρίτος ﴾πιθανός﴿ λόγοςΣε επίπεδο υλοποίησης, το κύριο πρόβλημα είναι ηπολυπλοκότητα ﴾complexity﴿:

τυχαία πολυπλοκότητα ﴾accidental﴿

ουσιώδης πολυπλοκότητα ﴾essential﴿

Ακόμα κι αν γίνουν σωστές εκτιμήσεις και βρεθεί κοινός τόπος,ένα έργο λογισμικού μπορεί να αποτύχει λόγω της ουδιώδουςπολυπλοκότητάς του.

14

ΠολυπλοκότηταThe function of good software is to make the complex appearto be simple.

Grady Booch

15

Grady Booch"Grady Booch ﴾born February 27, 1955﴿ is an American softwareengineer, best known for developing the Unified ModelingLanguage ﴾UML﴿ with Ivar Jacobson and James Rumbaugh. He isrecognized internationally for his innovative work in softwarearchitecture, software engineering, and collaborative developmentenvironments." ﴾Wikipedia﴿

16

Τι το ιδιαίτερο έχει η ανάπτυξηλογισμικού;Με τι μοιάζει και σε τι διαφέρει από τα άλλα ανθρώπινα έργα καιπροϊόντα;

Programming is an unnatural act.

Alan Perlis

17

Alan Perlis"Alan Jay Perlis ﴾April 1, 1922 – February 7, 1990﴿ was anAmerican computer scientist and professor at Yale Universityknown for his pioneering work in programming languages andthe first recipient of the Turing Award [Το 1966!]" ﴾Wikipedia﴿.

18

Alan J. Perlis, "Epigrams on Programming", ACM SIGPLAN Notices,Vol. 17, Issue 9, Sep. 1982, p. 7‐13.www.cs.yale.edu/~perlis‐alan/quotes.html

19

Αν το σκεφτείτεΤο λογισμικό:

δεν υπάρχει ﴾δεν έχει φυσική υπόσταση﴿δεν τελειώνει/οριστικοποιείται ποτέ ﴾εκτός από ένα/δυο ﴿πρέπει να λειτουργεί/διατηρείται σε πολλές παράλληλεςεκδόσεις

20

Ο νόμος του WirthΗ ταχύτητα με την οποία το λογισμικό γίνεται πιο αργό είναιμεγαλύτερη από την ταχύτητα με την οποία το υλικό γίνεται πιογρήγορο.

Were it not for a thousand times faster hardware, modernsoftware would be utterly unusable.

Niklaus Wirth

21

Niklaus Wirth"Niklaus Emil Wirth ﴾born 15 February 1934﴿ is a Swisscomputer scientist, best known for designing severalprogramming languages, including Pascal, and for pioneeringseveral classic topics in software engineering." ﴾Wikipedia﴿

Βραβείο Turing ﴾1984﴿.

22

N. Wirth, "A Plea for Lean Software", IEEE Computer, Vol 28, Issue 2,Feb. 1995, p. 64‐68.

23

Ωχ!The most amazing achievement of the computer softwareindustry is its continuing cancellation of the steady andstaggering gains made by the computer hardware industry.

Henry Petroski

24

"Henry Petroski is an American engineer specializing in failureanalysis. A professor both of civil engineering and history atDuke University, he is also a prolific author." ﴾Wikipedia﴿.

25

Henry Petroski, "To Engineer Is Human: The Role of Failure inSuccessful Design", St. Martin's Press, 1985.

26

Σφαίρα από ασήμιSo we hear desperate cries for a silver bullet, something tomake software costs drop as rapidly as computer hardwarecosts do. But, as we look to the horizon of a decade hence, wesee no silver bullet. There is no single development, in eithertechnology or management technique, which by itselfpromises even one order of magnitude improvement inproductivity, in reliability, in simplicity.

Fred Brooks

27

Fred Brooks"Frederick Phillips Brooks, Jr. ﴾born April 19, 1931﴿ is anAmerican computer architect, software engineer, and computerscientist, best known for managing the development of IBM'sSystem/360 family of computers and the OS/360 softwaresupport package, then later writing candidly about the processin his seminal book The Mythical Man‐Month." ﴾Wikipedia﴿.

Βραβείο Turing ﴾1999﴿.

28

Fred P. Brooks, "No Silver Bullet — Essence and Accident inSoftware Engineering", Proceedings of the IFIP Tenth WorldComputing Conference, April 1987, p. 1069‐1076.http://www.cs.nott.ac.uk/~pszcah/G51ISS/Documents/NoSilverBullet.html

Fred P. Brooks, "The Mythical Man Month", Addison‐Wesley, 1975,0‐201‐00650‐2.

29

Ο Μυθικός ανθρωπο‐μήναςΗ προσθήκη ανθρωπο‐προσπάθειας σε ένα αργοπορημένο έργολογισμικού το καθυστερεί ακόμα περισσότερο!

30

Περιεχόμενα διαλέξεων

31

Κύκλος Ζωής του Λογισμικού

Καταγραφή και ανάλυση απαιτήσεων.Σχεδιασμός.Υλοποίηση.Επαλήθευση και επικύρωση.

Εγκατάσταση, έλεγχος, παραμετροποίηση και ολοκλήρωσηλογισμικού στο παραγωγικό του περιβάλλον.Συντήρηση και επέκταση.

32

Μοντέλα ανάπτυξης λογισμικού

Ακολουθιακή διαδικασία ﴾sequential﴿Μοντέλο Καταρράκτη ﴾waterfall﴿

Επαναληπτική διαδικασία ﴾iterative﴿Αυξητική διαδικασία ﴾incremental﴿Ευέλικτη διαδικασία ﴾agile﴿

33

Μεθοδολογίες ανάπτυξης λογισμικού

Ταχεία Πρωτοτυποίηση ﴾Rapid prototyping﴿.«Ακραίος Προγραμματισμός» ﴾Extreme Programming﴿.

Ανάπτυξη βασισμένη σε ελέγχους ﴾Test‐driven Development﴿.Συνεχής παράδοση ﴾Continuous Delivery﴿Ανάπτυξη / Λειτουργία ﴾«DevOps»﴿.

34

Ανάλυση απαιτήσεων

Ανάλυση και μοντελοποίηση απαιτήσεωνΣύνταξη προδιαγραφών και παραδοτέων

35

Σχεδιασμός Λογισμικού

Βασικές αρχές

Αντικειμονοστρεφής σχεδιασμός συστημάτωνΣυστατικά λογισμικού

36

Γλώσσα μοντελοποίησης UML

Διαγράμματα κλάσεων ﴾Class diagrams﴿Διαγράμματα ακολουθιών ﴾Sequence diagrams﴿

Διαγράμματα δραστηριοτήτων ﴾Activity diagrams﴿Διαγράμματα σεναρίων χρήσης ﴾Use‐case diagrams﴿κτλ.

37

Πρότυπα Σχεδίασης ﴾Design Patterns﴿

Κατασκευαστικά πρότυπα ﴾Creational patterns﴿

Δομικά πρότυπα ﴾Structural patterns﴿Πρότυπα συμπεριφοράς ﴾Behavioral patterns﴿

38

Αρχιτεκτονική Λογισμικού

Αρχιτεκτονικός σχεδιασμός σύνθετων κατανεμημένωνσυστημάτων

Βασικές έννοιεςΈμφαση σε εφαρμογές διαδικτύου

Αρχιτεκτονική REST ﴾Representation State Transfer﴿Ανάπτυξη RESTful Application Programming Interfaces ﴾APIs﴿Θέματα ασφάλειαςΘέματα απόδοσης

39

Σχεδιασμός διεπαφής χρήστη

Ευχρηστία, διαδραστικότητα και αποκρισιμότηταΣύγχρονες μεθοδολογίες ανάπτυξης διεπαφής χρήστη

Πρότυπα σχεδίασης Model‐View‐Controller καιObservable

Έμφαση σε τεχνολογίες εφαρμογών διαδικτύου ﴾HTML5,CSS3, Javascript﴿Εφαρμογές μιας σελίδας ﴾Single‐page applications﴿Ασύγχρονες τεχνικές ﴾AJAX, Promises, Reactiveframeworks﴿

40

Διοίκηση και Διαχείριση Έργου Λογισμικού

Διοίκηση έργου ﴾γενικά﴿Εισαγωγή και βασικές έννοιεςΕκτίμηση κόστους έργου

Διοίκηση ομάδας ανάπτυξης λογισμικούΣυνήθεις ρόλοι σε μια ομάδα ανάπτυξης λογισμικούΑλληλεπιδράσεις μεταξύ ρόλων

Καλές διεθνείς πρακτικές

41

Τεχνικές και Εργαλεία Διοίκησης,Παρακολούθησης και Ελέγχου της ΑνάπτυξηςΛογισμικού

Έλεγχος εκδόσεων ﴾Version Control﴿

Έμφαση στο σύστημα Git ﴾το πλέον διαδεδομένο VersionControl System﴿

Αυτοματισμός διαδικασίας «χτισίματος» λογισμικού ﴾Buildautomation﴿

Έμφαση στο σύστημα Gradle ﴾χρησιμοποιείται στηνανάπτυξη Android εφαρμογών﴿

Ανάλυση προγράμματος ﴾program analysis﴿ και αυτόματοςεντοπισμός σφαλμάτων ﴾bug detection﴿

42

Σενάρια ελέγχουUnit testing, Regression testing, Functional testing,Integration testing, test coverage

Συνεχής ολοκλήρωση ﴾Continuous integration﴿Αξιοπιστία λογισμικούΗ έννοια του «τεχνικού/σχεδιαστικού χρέους» ﴾technicaldebt﴿.

43

Διαχείριση συστατικών του λογισμικού

Συστατικά λογισμικού και αλληλεξαρτήσεις τους ﴾softwarecomponents and dependencies﴿

Αποθήκες συστατικών λογισμικού ﴾Software artifactrepositories﴿Διαχείριση εκδόσεων λογισμικού ﴾software releases﴿Μέθοδοι αρίθμησης εκδόσεων ﴾versioning schemes﴿

44

Αν προλάβουμε

Γλώσσες ειδικού σκοπού ﴾Domain specific languages﴿

ReflectionAspect‐oriented programmingMetaprogramming

45

Πριν ξεκινήσουμε

Μια τελευταία οπτική

46

Ανάπτυξη λογισμικού: τέχνη ήεπιστήμη;

When CACM began publication in 1959, the members ofACM's Editorial Board made the following remark as theydescribed the purposes of ACM's periodicals: "If computerprogramming is to become an important part of computerresearch and development, a transition of programming froman art to a disciplined science must be effected." Such a goalhas been a continually recurring theme during the ensuingyears; for example, we read in 1970 of the "first steps towardtransforming the art of programming into a science".Meanwhile we have actually succeeded in making ourdiscipline a science, and in a remarkably simple way: merely bydeciding to call it "computer science."

Donald Knuth 47

Donald KnuthDonald Ervin Knuth is an American computer scientist,mathematician, and professor emeritus at Stanford University.He is the author of the multi‐volume work The Art ofComputer Programming. He contributed to the developmentof the rigorous analysis of the computational complexity ofalgorithms and systematized formal mathematical techniquesfor it ... Knuth is the creator of the TeX computer typesettingsystem, the related METAFONT font definition language andrendering system, and the Computer Modern family oftypefaces.

Βραβείο Turing ﴾1974﴿.

48

Donald E. Knuth, "Computer Programming as an Art",Communications of the ACM, Vol. 7, Issue 12, Dec. 1974, p. 667‐673.

﴾Η ομιλία του D. Knuth κατά τη λήψη του βραβείου Turing το1974﴿

www.cs.bilkent.edu.tr/~canf/knuth1974.pdf

49

Κατά τη γνώμη του KnuthTo summarize: We have seen that computer programming isan art, because it applies accumulated knowledge to theworld, because it requires skill and ingenuity, and especiallybecause it produces objects of beauty. A programmer whosubconsciously views himself as an artist will enjoy what hedoes and will do it better. Therefore we can be glad thatpeople who lecture at computer conferences speak about thestate of the Art.

Donald Knuth

50

Άλλη μια γνώμη σχετικάTo put it in another way: it is my purpose to transmit theimportance of good taste and style in programming, thespecific elements of style presented serve only to illustratewhat benefits can be derived from "style" in general. In thisrespect I feel akin to the teacher of composition at aconservatory: he does not teach his pupils how to compose aparticular symphony, he must help his pupils to find their ownstyle and must explain to them what is implied by this. ﴾It hasbeen this analogy that made me talk about "The Art ofProgramming".﴿

E.W. Dijkstra

51

Edsger Dijkstra"One of the most influential members of computing science'sfounding generation, Dijkstra helped shape the new disciplinefrom both an engineering and a theoretical perspective. Manyof his papers are the source of new research areas. Severalconcepts and problems that are now standard in computerscience were first identified by Dijkstra or bear names coinedby him." ﴾Wikipedia﴿Βραβείο Turing ﴾1972﴿.

52

E.W. Dijkstra, "EWD316: A Short Introduction to the Art ofProgramming", August 1971.

https://www.cs.utexas.edu/users/EWD/transcriptions/EWD03xx/EWD316.html

53

Και μια τελευταίαWhat we can say with some confidence is that these are theglory days of hacking. In most fields the great work is doneearly on. The paintings made between 1430 and 1500 are stillunsurpassed. Shakespeare appeared just as professionaltheater was being born, and pushed the medium so far thatevery playwright since has had to live in his shadow....Over and over we see the same pattern. A new mediumappears, and people are so excited about it that they exploremost of its possibilities in the first couple generations. Hackingseems to be in this phase now. Painting was not, in Leonardo'stime, as cool as his work helped make it. How cool hackingturns out to be will depend on what we can do with this newmedium.

Paul Graham 54

Paul Graham"Paul Graham is an English computer scientist, venturecapitalist, and essayist. He is known for his work on Lisp, forco‐founding Viaweb ﴾later renamed "Yahoo! Store"﴿, and forco‐founding the Y Combinator seed capital firm." ﴾Wikipedia﴿.

55

Paul Graham, "Hackers and Painters", O'Reilly Media, 2004, 0‐596‐00662‐4.

Εδώ το διάσημο ομώνυμο essay:http://www.paulgraham.com/hp.html

56

Να θυμάστε ότιThe best programmers are up to 28 times better than theworst programmers, according to "individual differences"research.

Robert Glass

57