cse 303 concepts and tools for soware development · make your life easier in subsequent classes,...

31
CSE 303 Concepts and Tools for So4ware Development Magdalena Balazinska (a.k.a. “Magda”) Winter 2010 Lecture 1 – Course IntroducKon

Upload: others

Post on 14-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

CSE303ConceptsandToolsforSo4wareDevelopment

MagdalenaBalazinska(a.k.a.“Magda”)

Winter2010Lecture1–CourseIntroducKon

Page 2: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

TheGoalof303

  LearntowritecrypKcstufflikethis(1week)if [$# -lt 3] then ... fi f1=$1; f2=$2 if [[ -a "$f1" && -a "$f2" ]] then ... fi

  Orlikethat(3weeks)char ** ans = (char**)malloc(height*sizeof(char*)); int i; for(i=0; i < height; ++i) ans[i] = (char*)malloc(width*sizeof(char));

  Andsaythingssuchas“Icheckedouttheprojectbutcouldnotcommitmychangesbecausethesubdirectoryincvswasnotgroupwritable.”(afewweeks)

2CSE303‐Winter2010

Page 3: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

MoreSeriously...MainGoalsofCSE303

  Putyouonthepathtobecomingamatureandefficientso4waredeveloper

  Makeyourlifeeasierinsubsequentclasses,internships,researchprojects,andjobs

  RaiseyoursensibilitytothesocietalandethicalimplicaKonsofso4waresystems

  Inthepast,so4waredevelopershadtoacquireontheirowntheskillsandconceptstaughtincse303

3CSE303‐Winter2010

Page 4: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

OutlineforToday

  Classmechanics-  Staffandresources-  Lectures

-  AssignmentsandevaluaKon

  Overviewoftopicsandclassschedule

  Generaladvice  IntroducKontoLinux,thefilesystem,&shell

4CSE303‐Winter2010

Page 5: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

ClassResources

  Mailinglist:announcementsandotherinfo-  Youshouldalreadyberegisteredtothelist

  Staff:officehourspostedoncoursewebsite-  MichaelRatanapintha(TA)

-  MagdalenaBalazinska(instructor)

  CompuKngresources:undergradlab  Messageboard:linkoncoursewebsite

http://www.cs.washington.edu/303/

  Your number 1 resource: course website

5CSE303‐Winter2010

Page 6: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

Lectures

  Threelecturesperweek:MWF@10:30‐11:20-  Introduceimportantconceptsandtools-  Pointtoaddi4onalreadings

-  WedonotexpectyoutotakeexhausKvenotes-  ParKcipate&jotdownkeywordstolook‐uplater

-  Classmaterialpostedonlinea4erlecture-  Advice:useclassforconceptsanddocumentaKon/booksfordetails

-  Remember:Thisisa300‐levelcourse!

6CSE303‐Winter2010

Page 7: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

Assignments

  Duesoona4ercontentiscoveredinclass

  SpendmostofyourKmeonassignments  Workoneachassignmentinseveralsessions-  Becauseyouwillbeusingnewtools...

-  Youwillfeelaconstantenergydrain...-  YouwillsomeKmesgetstuckandneedtolookupdocumentaKonorgotoofficehours

-  Again,rememberthatthisisa300‐levelcourse!

-  Note:Weexpectalmosteveryonetoget100%

7CSE303‐Winter2010

Page 8: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

EvaluaKon

  25%Midterm:February12thinclass

  25%Final:Monday,March15thinclass  40%Assignments:total6-  2onlinux,shellscripts,anduKliKes

-  2onCandtools-  1onC++

-  1onso4wareengineeringandtools

  10%Issuepaperonsocietyandethics

8CSE303‐Winter2010

Page 9: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

MoreAbouttheAssignments

  Allassignmentscanbedoneingroupsofuptotwo

  CollaboraKonpolicybetweengroups-  Books,lecturenotes,manpages,theweb-  Youcanpointeachothertodocumenta3on

-  BUTeachteammustproducetheirownsoluKon

-  YoumayNOTlookatsoluKonsofothergroups

  Latepolicy:totalofthreelate‐daysthatyoumayuseanyKmeinchunksof24hours

  Extracredit:smalleffectonyourgrade

9CSE303‐Winter2010

Page 10: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

OverviewofAssignment1

  HW1willbepostedonwebsitethisWednesday

  Duedate:Wednesday,January13th  Assignmentcontent-  TryvariousprogramsandopKons

-  Tryafewusefulshortcuts-  TryusingmanandGoogle

-  Writeasimpleshellscript

  Useofficehoursthisweekornextweekforhelplogginginandgeongstarted!

10CSE303‐Winter2010

Page 11: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

WheretoGoforInformaKon

  Requiredtexts:-  LinuxPocketGuidebyDanielJ.Barrep,O'Reilly,2004.-  ProgramminginC(3rdEdi4on)byStephenG.Kochan,SamsPublishing,2005.

  Coursewebsite-  Lecturenotes-  LinkstoaddiKonaldocumentaKon

  AlotofinformaKonisavailableontheweb  Manpages

11CSE303‐Winter2010

Page 12: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

That'sitfortheclasslogisKcs...nowlet'stakealookattheclasscontent

Page 13: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

FiveHigh‐LevelTopics

  Expediteandautomatetasks-  BecomefamiliarwithLinuxandvariousuKliKes-  Manipulatefilesandstrings

-  Writeshellscripts:bash

  LearntoprograminC-  “Lowerlevel”thanJava-  Emphasisonmemorymanagementandpointers

-  AliplebitofC++togetyoustarted-  Atasteofthreadsandconcurrencycontrol

13CSE303‐Winter2010

Page 14: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

FiveHigh‐LevelTopics

  Learnbasictoolsforso4waredevelopment-  Buildtools(compiling,linking,andautomaKng)-  Debuggers

-  Versioncontrolsystems-  Profilers(ifwehaveKme)

  Acquirebasicso4wareengineeringconcepts-  SpecificaKons,interfaces,andtesKng

-  MulKpersonprogramming-  Securityanddefensiveprogramming

14CSE303‐Winter2010

Page 15: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

FiveHigh‐LevelTopics

  SocietalandethicalimplicaKonsofso4ware-  Becausetechnologyaffectssociety-  Asprofessionals/scienKsts/engineers,wemustunderstandsocietalimplicaKonsofwhatwedo

-  4in‐classdiscussions-  Topicwillbeannouncedbeforetheclass

-  Examples:so4warepatents,digitalprivacy,digitalrightsmanagement,electronicvoKng,etc.

15CSE303‐Winter2010

Page 16: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

CourseSchedule

  Postedschedulesubjecttosmallchanges

  Visitcoursewebsiteregularly

16CSE303‐Winter2010

Page 17: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

GeneralAdvice

  WewillconKnuouslylearnnewtools-  Wewillbarelyscratchthesurfaceforeachtool-  Thegoalistogetyoustartedandhelpyoulearn

-  Youmayconstantlyfeelacertainunease

  Lecturesalonearenotenough-  BooksanddocumentaKonprovidedetails-  AssignmentsgiveyoupracKce

  Workonclassaliplebita4ereachlecture-  Assignmentsduesoona4erwecovermaterial!

-  Enjoyitwhenyougetsomethingtowork!

17CSE303‐Winter2010

Page 18: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

TheGoodNews

  Weassumeyoudon'tknowmuch,justsomeJavaprogrammingandsomesimpledatastructures

  SoaskquesKons

  NowisthebestKme!

18CSE303‐Winter2010

Page 19: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

Summary

  Goal:maturityandefficiency-  Command‐line-  C/C++

-  Programmingtools-  So4ware‐developmentconcepts

-  Social/ethicalimplicaKonsofcompuKng

  Thisclassisjustthebeginning

  Youwilllearnthroughoutyourcareer

19CSE303‐Winter2010

Page 20: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

That'sitfortheclassintroducKon.Wehavealottocoverthisquarter...

solet'sgetstarted

Page 21: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

OperaKngSystem

•  Opera4ngsystem:ManagesacKviKesandresourcesofacomputer:–  So4warethatactsasaninterfacebetweenhardwareanduser–  ProvidesalayerofabstracKonforapplicaKondevelopers

•  FeaturesprovidedbyanoperaKngsystem:–  Abilitytoexecuteprograms (andmulK‐tasking)–  Memorymanagement (andvirtualmemory)–  Filesystems,diskandnetworkaccess–  Aninterfacetocommunicatewithhardware–  Auserinterface (o4engraphical)

•  Kernel:Thelowest‐levelcoreofanoperaKngsystem21CSE303‐Winter2010

hpp://en.wikipedia.org/wiki/OperaKng_system

Page 22: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

Linux

•  Linux:AnoperaKngsystembasedonthelinuxkernel–  Unix‐like–  Commonlyseen/usedtodayinservers,mobile/embeddeddevices,…

•  AfullLinuxoperaKngsystemusuallycomprises–  UKliKesandlibrariesfromtheGNUProject–  TheXWindowSystem–  TheGNOMEandKDEdesktopenvironments–  TheApacheHTTPServer

•  Distribu4on:Apre‐packagedsetofLinuxso4ware–  Examples:Ubuntu,Fedora

•  KeyfeaturesofLinux–  OpensourcesoEware:sourcecanbedownloaded–  Freetouse–  Constantlybeingimproved/updatedbythecommunity

22CSE303‐Winter2010

Page 23: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

Let'sStartattheBeginning

  First,loginwithusernameandpassword

  Youwillgetashell  Whatisashell?-  ProgramthatworkswiththeOSasacommandprocessor,usedtoentercommandsandiniKatetheirexecuKon.

  Typically,acommandisaprogramnamewithopKonsandargument:ls -al dirA

  Theshellalsoprovides“built‐in”commands:cd ..

23CSE303‐Winter2010

Page 24: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

ExploringtheFilesystem

  Thefilesystemisatree(ratheradag)-  Thetopis / -  Interiornodesaredirectories

-  Directoriescontainfilesandsubdirectories-  Movingaround:cd

-  Gotlost?lsandpwd

  Eachuserhasahome-  Typicallyitisin: /home/username/ -  Butitcanbesomewhereelse

24CSE303‐Winter2010

Page 25: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

ConKnuingtoExplore...

  Specialdirectorynames-  Rootdirectory= / -  Current(working)directory=.

-  Parentdirectory=.. -  User'shomedirectory=~

  Paths-  Absolutepathnamestartsfromtheroot

/home/username/dirA

-  RelaKvepathnamestartsfromcurrentdirectory~/dirA or ../dirA

25CSE303‐Winter2010

Page 26: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

Permissions

  Permissions(read,write,execute)-  Yourusernamedeterminesyourpermissions-  Differentpermissionsforauserandforeveryone

-  UserssomeKmesworktogetherinagroup-  Changingpermissions:chmod

26CSE303‐Winter2010

Page 27: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

BasicFileManipulaKon

  Examiningfilescat,head,tail,less

  CreaKnganddestroying-  Files: cp, mv, rm, rm -f -  Directories: mkdir, rmdir, mv, cp -r

27CSE303‐Winter2010

Page 28: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

CommandsandPrograms

  Ithelpstorememberimportantcommands-  ls, cd, pwd, cp, mv, rm, mkdir,...

  Manycommandscorrespondtoprograms-  ls, pwd, cp, mv, rm, mkdir

  Somecommandsareshell“builKns”-  cd, echo, exit

  UsetypetodisKnguishthem

  Arunningprogramisaprocess-  (couldbemorethan1)

28CSE303‐Winter2010

Page 29: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

WhyUseaShell?

  IcandoallthiswithaGUI.Whyuseashell?

  Poweruserscangofasterwithashell  Simplerandfasterwhenlogginginremotely  EnablestaskautomaKon:programmability

  EnablescustomizaKonoflinuxsession  MostcomputerscienKstsuseboth  WindowsandLinuxprovideboth

29CSE303‐Winter2010

Page 30: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

ShellScripts

  Seriesofindividualcommandscombinedintooneexecutablefileformashellscript

  Shellisaninterpreterforaprogramminglanguageofthesamename-  Variables

-  Someprog.constructs:condiKonal,loops,...-  IntegerarithmeKc

-  etc.

30CSE303‐Winter2010

Page 31: CSE 303 Concepts and Tools for Soware Development · Make your life easier in subsequent classes, internships, research projects, and jobs Raise your sensibility to the societal and

Readings

  Sec4onsfromtheLinuxPocketGuide-  What'sinThisBook(pages1‐5)

-  GeongHelp(pages7‐8)-  IntheFilesystemsecKon

  IntroducKon(page13)  HomeDirectories(pages14‐15)

  FileProtecKons(pages19‐20)

-  TheShell(pages19‐33)  SkipsubsecKononInstallingSo4ware

-  Pages37‐46givemoredetailsaboutthecommandsthatweusedtoday

31CSE303‐Winter2010