founda’ons of so,ware engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates...

46
Founda’ons of So,ware Engineering Lecture 24: Open Source Claire Le Goues 1

Upload: others

Post on 25-Apr-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Founda'onsofSo,wareEngineering

Lecture24:OpenSourceClaireLeGoues

1

Page 2: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Learninggoals•  Understandtheterminology“freeso?ware”andexplainopensourcecultureandprinciples.

•  Expressaneducatedopiniononthephilosophical/poliFcaldebatebetweenopensourceandproprietaryprinciples.

•  Reasonaboutthetradeoffsoftheopensourcemodelonissueslikequalityandrisk,bothingeneralandinaproprietarycontext.

2

Page 3: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Mo'va'ontounderstandopensource.•  Companiesworkonopensourceprojects.•  Companiesuseopensourceprojects.•  Companiesarebasedaroundopensourceprojects.•  Principlespercolatethroughoutindustry.•  PoliFcal/philosophicaldebate,andbeinginformedishealthy.

3

Page 4: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Quickandeasydefini'ons

•  Proprietaryso?ware–so?warewhichdoesn’tmeettherequirementsoffreeso?wareoropensourceso?ware

•  Freeso?ware–so?warewithastrongemphasisonuserrights

•  Opensourceso?ware–so?warewherethesourcecodeissharedwiththecommunity

•  DoesFreeSo?ware=OpenSource?4

Page 5: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

“Freeasinfreespeech.”

5

Page 6: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

6

Page 7: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Stallmanvs.Gates

7

Page 8: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

FreeSo,warevsOpenSource•  Freeso?wareorigins(70-80s~Stallman)

–  PoliFcalgoal–  So?warepartoffreespeech

•  freeexchange,freemodificaFon•  proprietaryso?wareisunethical•  security,trust

–  GNUproject,Linux,GPLlicense•  Opensource(1998~O'Reilly)

–  RebrandingwithoutpoliFcallegacy–  Emphasisoninternetandlargedev./userinvolvement–  Opennesstowardproprietaryso?ware/coexist–  (Think:NetscapebecomingMozilla)

8

Page 9: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

TheCathedralandtheBazaar

9

Page 10: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

TheCathedralandtheBazaar

•  Cathedral(closedsource)– Top-downdesignwithfocusonplanning

•  Bazaar(opensource)– Organicbohom-upmovement– Codealwayspublicoverinternet– Linux/Fetchmailstories

10EricRaymond.Essay1997

Page 11: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

TheCathedralandtheBazaar–Lessons(selec'on)•  Everygoodworkofso?warestartsbyscratchingadeveloper'spersonalitch

•  TosolveaninteresFngproblem,startbyfindingaproblemthatisinteresFngtoyou

•  Releaseearly,releaseo?en•  Givenalargeenoughbeta-testerandco-developerbase,almosteveryproblemwillbecharacterizedquicklyandthefixobvioustosomeone

•  Thenextbestthingtohavinggoodideasisrecognizinggoodideasfromyourusers.SomeFmesthelaherisbeher.

11EricRaymond.Essay1997

Page 12: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

OpenSourceTeams

•  PotenFallyopenforeverybody•  ProcesstovetcontribuFons•  Typicallymanycontributorsbutsmallcoreteams

12

Page 13: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

13ApacheStudy–Herbsleb,CMU

Page 14: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

SocialCoding•  Github,Bitbucket,etc.•  Addsocialnetworkingfeaturestocoding–  Followusers– Watchrepositories

•  Allowsteamstructuretoemergeasopposedtopreviousplanning

14

Page 15: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Howdoopensourceprogramsmakemoney?

• RedHat–revenuesofabout$2Billionlastyearandisworthapproximately$15Billion.

• Mozilla–hasrevenuesof$300Millionannually

• ApacheSo?wareFoundaFon–recentrevenueof$1Million

15

Page 16: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

OpenSourceBusinessModels

•  Opensourceashobby;resumebuilding•  Sellingsupport/experFseinsteadofso?ware– RedHat

•  Sellingcomplementaryservices– Wordpress

•  Developershiredasconsultants,forextensions

16

Page 17: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

OtherOpenSourceBusinessModels•  Companiesdedicateresourcestoprojectswhichhelpthemandthecommunity– ApachereceivesdonaFons

•  Sellingmerchandise–Canonical(Ubuntu)•  SellingadverFsingorcustomertraffic–Mozilla

17

Page 18: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Quality?!

“TherearenotechnicalrequirementsforthepluginsasidefromthembeingabletobeinstalledonafreshEclipseplaoorm.Weleaveittothecommunitytofindandreportbugsrelatedtotechnicalfeaturesandconflicts.”-EclipseMarketplace,Dec2014

18

Page 19: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

OpenSourceFamousPhrases

Linus’sLaw-Manyeyesmakeallbugsshallow

CollaboraFonoverCompeFFon…isopensourcecodeofhigherquality?– Howwouldwebeabletotell?

19

Page 20: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

ACaseStudyofOpenSourceSo,wareDevelopment:TheApacheServerMeasure Apache Proprietary

SystemAProprietarySystemC

ProprietarySystemD

Post-releasedefects/KLOCA

2.64 0.11 0.1 0.7

Post-releasedefects/KDelta

40.8 4.3 14 2.8

Post-featuretestDefects/KLOCA

2.64 * 5.7 6.0

Post-featuretestDefects/KLOCA

40.8 * 164 196

20

Page 21: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

CoverityReportofOpenSource

[Coverity,2012,hhp://www.coverity.com/press-releases/annual-coverity-scan-report-finds-open-source-and-proprietary-so?ware-quality-beher-than-industry-average-for-second-consecuFve-year/]

OnlytestedprogramswhichuseCoverityDefectdensity:defectsper1,000linesAveragedefectdensityof0.69foropensourceand0.68forproprietaryso?ware,surpassingtheindustrystandardof1orless

Proprietary OpenSource

500,000-1,000,000(LOC)

0.98 0.44

1,000,000+(LOC) 0.66 0.75

DefectDensityBasedonSize

21

Page 22: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Twoyearslater…

•  In2014,opensourcedefectdensitywentdownto0.61from0.69in2012•  Proprietarydefectdensitywentupto0.76from0.68in2012

•  …verdict?

22

Page 23: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

OPENSOURCEINAPROPRIETARYCONTEXT(BENEFITSVS.RISK)

23

Page 24: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

hhps://www.tesla.com/blog/all-our-patent-are-belong-you

24

Page 25: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Hilariousirony

25

Page 26: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

hhps://mailman.cs.umd.edu/pipermail/findbugs-discuss/2016-November/004321.html

26

Page 27: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

27

Page 28: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

OpenSSL/Heartbleed.•  In2013,OpenSSLmade

$2,000indonaFons(andsomefromothersources)

•  OnefullFmeprogrammer•  Heartbleed(2014):

Vulnerabilitywasfoundthateffectedabout17.5%ofwebservers(halfamillion)

•  UsedbyYahoo,Twiher,Google

•  Whoisresponsible?

28

Page 29: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

CaseStudy:OpenSSL

•  WhenHeartBleedoccurred,Googlereportedthebugandlatersubmihedapatch

•  A?ertheHeartBleedbug,morethan17companiesagreedtoeachcontribute$100,000annuallyfor3yeartotheCoreInfrastructureIniFaFve.

•  CoreInfrastructureIniFaFvedistributesfundstoneedybutimportantprojects

29

Page 30: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

BugBoun'es•  Facebook,Google,Yahoo,Microso?,andothercompanieshaverewardsforfindingbugsandreporFngthem

•  Usually$100ormoreforsimplebugsandhigherrewardsformoreseriousbugs

•  BounFescansavethecompanyfrommaliciousexploits,whichcancostthecompanymuchmore.– PonemonInsFtutereportsaveragecostof$3.79millionpercompanydatabreech(2014)

30

Page 31: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Risksofnotopensourcingsomething?

31

Page 32: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Proprietarymethodstogaincommunitybenefits•  Releaseearly,releaseo?en;ConFnuousorsmallupdatesinsteadofbigversionchanges

•  “Manyeyesmakeallbugsshallow”•  Recognizegoodideasfromyourusers.•  CollaboraFonovercompeFFon•  Promoteuserstoreportbugsandmonitornewreleases(easierifusingso?wareasaservice)

•  Allowuserstowritemodsfortheproduct(usuallyinacontrolledway)orpromotefeaturerequests

32

Page 33: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

ONEMORERISKINPROPRIETARYCONTEXT:LICENSES

33

Page 34: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Whylearnaboutlicenses?

•  Companieswillavoidcertainlicenses–commonlythecopyle?licenses•  SpecificlicensesmayprovidecompeFFveadvantages•  Youmayeventuallywanttoreleaseopensourceso?wareorbecomemoreinvolvedinanopensourceproject

34

Page 35: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

OpenSourceLicensesSo,ware Percentage

MITLicense 24%

GNUGeneralPublicLicense(GPL)2.0 23%

ApacheLicense2.0 16%

GNUGeneralPublicLicense(GPL)3.0 9%

BSDLicense2.0(3-clause,NeworRevised)License

6%

GNULessorGeneralPublicLicense(LGPL)2.1

5%

ArFsFcLicense(Perl) 4%

GNULesserGeneralPublicLicense(LGPL)3.0

2%

Microso?PublicLicense 2%

EclipsePublicLicense 2%

Listfrom:hhps://www.blackduckso?ware.com/resources/data/top-20-open-source-licenses

35

Page 36: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

GNUGeneralPublicLicense:TheCopyle,License•  Nobodyshouldberestrictedbytheso?waretheyuse.Therearefourfreedomsthateveryusershouldhave:–  thefreedomtousetheso?wareforanypurpose,–  thefreedomtochangetheso?waretosuityourneeds,–  thefreedomtosharetheso?warewithyourfriendsandneighbors,and

–  thefreedomtosharethechangesyoumake.•  Codemustbemadeavailable•  AnymodificaFonsmustberelicensedunderthesamelicense(copyle?)

36

Page 37: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

GPL2.0and3.0–Addressesfreeso,wareproblems•  2.0-CourtrulingcannotnullifythelicenseandifacourtdecisionandthislicensecontradictindistribuFonrequirements,thentheso?warecannotbedistributed

•  3.0–patentgrantandpreventTivoizaFon•  NotcompaFblewitheachother;Can’tcopyle?bothatthesameFme–phrase:“GLPVersion3oranylaterversion”

37

Page 38: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Whywouldprojectschooseonelicenseoveranother?

[Fromhhp://choosealicense.com/licenses/]38

Page 39: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

DualLicenseBusinessModel

• ReleasedasGPLwhichrequiresacompanyusingtheopensourceproducttoopensourceit’sapplicaFon

• Orcompaniescanpay$2,000to$10,000annuallytoreceiveacopyofMySQLwithamorebusinessfriendlylicense 39

Page 40: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

Risk:Incompa'bleLicenses•  SunopensourcedOpenOffice,butwhenSunwasacquiredbyOracle,Oracletemporarilystoppedtheproject.

•  ManyofthecommunitycontributorsbandedtogetherandcreatedLibreOffice

•  OracleeventuallyreleasedOpenOfficetoApache•  LibreOfficechangedtheprojectlicensesoLibreOfficecancopychangesfromOpenOfficebutOpenOfficecannotdothesameduetolicenseconflicts

40

Page 41: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

MITLicense

•  Mustretaincopyrightcredit•  So?wareisprovidedasis•  Authorsarenotliableforso?ware•  NootherrestricFons

41

Page 42: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

LGPL

•  So?waremustbealibrary•  SimilartoGPLbutnocopyle?requirement

42

Page 43: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

BSDLicense

•  Noliabilityandprovidedasis.•  Copyrightstatementmustbeincludedinsourceandbinary•  Thecopyrightholderdoesnotendorseanyextensionswithoutexplicitwrihenconsent

43

Page 44: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

ApacheLicense

•  Apache– SimilartoGPLwithafewdifferences– Notcopyle?– Notrequiredtodistributesourcecode– Doesnotgrantpermissiontouseproject’strademark– DoesnotrequiremodificaFonstousethesamelicense

44

Page 45: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

PercepFon:•  Anarchy•  Demagoguery•  Ideology•  Altruism•  Manyeyes

45

Page 46: Founda’ons of So,ware Engineeringckaestne/17313/2016/25-1-dec-open-source.pdf · small updates instead of big version changes • “Many eyes make all bugs shallow” • Recognize

OpenSourceReality•  AggressivecollaboraFvetooluse– versioncontrol,CI,issuetracker,reviews,…

•  Carefulmanagementofpeople•  Processrigor•  O?enaimedatexpertusers

•  Intellectualproperty•  O?enindustrysupported•  O?enaddressingcommonassets

46