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

Post on 14-Aug-2020

0 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CSE303ConceptsandToolsforSo4wareDevelopment

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

Winter2010Lecture1–CourseIntroducKon

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

MoreSeriously...MainGoalsofCSE303

  Putyouonthepathtobecomingamatureandefficientso4waredeveloper

  Makeyourlifeeasierinsubsequentclasses,internships,researchprojects,andjobs

  RaiseyoursensibilitytothesocietalandethicalimplicaKonsofso4waresystems

  Inthepast,so4waredevelopershadtoacquireontheirowntheskillsandconceptstaughtincse303

3CSE303‐Winter2010

OutlineforToday

  Classmechanics-  Staffandresources-  Lectures

-  AssignmentsandevaluaKon

  Overviewoftopicsandclassschedule

  Generaladvice  IntroducKontoLinux,thefilesystem,&shell

4CSE303‐Winter2010

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

Lectures

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

-  WedonotexpectyoutotakeexhausKvenotes-  ParKcipate&jotdownkeywordstolook‐uplater

-  Classmaterialpostedonlinea4erlecture-  Advice:useclassforconceptsanddocumentaKon/booksfordetails

-  Remember:Thisisa300‐levelcourse!

6CSE303‐Winter2010

Assignments

  Duesoona4ercontentiscoveredinclass

  SpendmostofyourKmeonassignments  Workoneachassignmentinseveralsessions-  Becauseyouwillbeusingnewtools...

-  Youwillfeelaconstantenergydrain...-  YouwillsomeKmesgetstuckandneedtolookupdocumentaKonorgotoofficehours

-  Again,rememberthatthisisa300‐levelcourse!

-  Note:Weexpectalmosteveryonetoget100%

7CSE303‐Winter2010

EvaluaKon

  25%Midterm:February12thinclass

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

-  2onCandtools-  1onC++

-  1onso4wareengineeringandtools

  10%Issuepaperonsocietyandethics

8CSE303‐Winter2010

MoreAbouttheAssignments

  Allassignmentscanbedoneingroupsofuptotwo

  CollaboraKonpolicybetweengroups-  Books,lecturenotes,manpages,theweb-  Youcanpointeachothertodocumenta3on

-  BUTeachteammustproducetheirownsoluKon

-  YoumayNOTlookatsoluKonsofothergroups

  Latepolicy:totalofthreelate‐daysthatyoumayuseanyKmeinchunksof24hours

  Extracredit:smalleffectonyourgrade

9CSE303‐Winter2010

OverviewofAssignment1

  HW1willbepostedonwebsitethisWednesday

  Duedate:Wednesday,January13th  Assignmentcontent-  TryvariousprogramsandopKons

-  Tryafewusefulshortcuts-  TryusingmanandGoogle

-  Writeasimpleshellscript

  Useofficehoursthisweekornextweekforhelplogginginandgeongstarted!

10CSE303‐Winter2010

WheretoGoforInformaKon

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

  Coursewebsite-  Lecturenotes-  LinkstoaddiKonaldocumentaKon

  AlotofinformaKonisavailableontheweb  Manpages

11CSE303‐Winter2010

That'sitfortheclasslogisKcs...nowlet'stakealookattheclasscontent

FiveHigh‐LevelTopics

  Expediteandautomatetasks-  BecomefamiliarwithLinuxandvariousuKliKes-  Manipulatefilesandstrings

-  Writeshellscripts:bash

  LearntoprograminC-  “Lowerlevel”thanJava-  Emphasisonmemorymanagementandpointers

-  AliplebitofC++togetyoustarted-  Atasteofthreadsandconcurrencycontrol

13CSE303‐Winter2010

FiveHigh‐LevelTopics

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

-  Versioncontrolsystems-  Profilers(ifwehaveKme)

  Acquirebasicso4wareengineeringconcepts-  SpecificaKons,interfaces,andtesKng

-  MulKpersonprogramming-  Securityanddefensiveprogramming

14CSE303‐Winter2010

FiveHigh‐LevelTopics

  SocietalandethicalimplicaKonsofso4ware-  Becausetechnologyaffectssociety-  Asprofessionals/scienKsts/engineers,wemustunderstandsocietalimplicaKonsofwhatwedo

-  4in‐classdiscussions-  Topicwillbeannouncedbeforetheclass

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

15CSE303‐Winter2010

CourseSchedule

  Postedschedulesubjecttosmallchanges

  Visitcoursewebsiteregularly

16CSE303‐Winter2010

GeneralAdvice

  WewillconKnuouslylearnnewtools-  Wewillbarelyscratchthesurfaceforeachtool-  Thegoalistogetyoustartedandhelpyoulearn

-  Youmayconstantlyfeelacertainunease

  Lecturesalonearenotenough-  BooksanddocumentaKonprovidedetails-  AssignmentsgiveyoupracKce

  Workonclassaliplebita4ereachlecture-  Assignmentsduesoona4erwecovermaterial!

-  Enjoyitwhenyougetsomethingtowork!

17CSE303‐Winter2010

TheGoodNews

  Weassumeyoudon'tknowmuch,justsomeJavaprogrammingandsomesimpledatastructures

  SoaskquesKons

  NowisthebestKme!

18CSE303‐Winter2010

Summary

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

-  Programmingtools-  So4ware‐developmentconcepts

-  Social/ethicalimplicaKonsofcompuKng

  Thisclassisjustthebeginning

  Youwilllearnthroughoutyourcareer

19CSE303‐Winter2010

That'sitfortheclassintroducKon.Wehavealottocoverthisquarter...

solet'sgetstarted

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

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

Let'sStartattheBeginning

  First,loginwithusernameandpassword

  Youwillgetashell  Whatisashell?-  ProgramthatworkswiththeOSasacommandprocessor,usedtoentercommandsandiniKatetheirexecuKon.

  Typically,acommandisaprogramnamewithopKonsandargument:ls -al dirA

  Theshellalsoprovides“built‐in”commands:cd ..

23CSE303‐Winter2010

ExploringtheFilesystem

  Thefilesystemisatree(ratheradag)-  Thetopis / -  Interiornodesaredirectories

-  Directoriescontainfilesandsubdirectories-  Movingaround:cd

-  Gotlost?lsandpwd

  Eachuserhasahome-  Typicallyitisin: /home/username/ -  Butitcanbesomewhereelse

24CSE303‐Winter2010

ConKnuingtoExplore...

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

-  Parentdirectory=.. -  User'shomedirectory=~

  Paths-  Absolutepathnamestartsfromtheroot

/home/username/dirA

-  RelaKvepathnamestartsfromcurrentdirectory~/dirA or ../dirA

25CSE303‐Winter2010

Permissions

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

-  UserssomeKmesworktogetherinagroup-  Changingpermissions:chmod

26CSE303‐Winter2010

BasicFileManipulaKon

  Examiningfilescat,head,tail,less

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

27CSE303‐Winter2010

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

WhyUseaShell?

  IcandoallthiswithaGUI.Whyuseashell?

  Poweruserscangofasterwithashell  Simplerandfasterwhenlogginginremotely  EnablestaskautomaKon:programmability

  EnablescustomizaKonoflinuxsession  MostcomputerscienKstsuseboth  WindowsandLinuxprovideboth

29CSE303‐Winter2010

ShellScripts

  Seriesofindividualcommandscombinedintooneexecutablefileformashellscript

  Shellisaninterpreterforaprogramminglanguageofthesamename-  Variables

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

-  etc.

30CSE303‐Winter2010

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

top related