VC++搜索引擎網(wǎng)絡(luò)爬蟲設(shè)計與實(shí)現(xiàn)_第1頁
VC++搜索引擎網(wǎng)絡(luò)爬蟲設(shè)計與實(shí)現(xiàn)_第2頁
VC++搜索引擎網(wǎng)絡(luò)爬蟲設(shè)計與實(shí)現(xiàn)_第3頁
VC++搜索引擎網(wǎng)絡(luò)爬蟲設(shè)計與實(shí)現(xiàn)_第4頁
VC++搜索引擎網(wǎng)絡(luò)爬蟲設(shè)計與實(shí)現(xiàn)_第5頁
已閱讀5頁,還剩70頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

--#-IntroductionProjectmanagementisanimportantpartinsoftwaredevelopmentorganization(SDO).Withoutproperprojectmanagement,itcanleadtothefailureoftheproject.Manysoftwareprojectsarefacedwithacommonsituation:Theyfailindevelopingtherequiredfunctionalitywithinscheduleandplannedbudget;theresultsoftenlacktherequiredquality.Thus,duringthelastyearsseveralcompanieshavestartedinitiativestoimprovetheirsoftwaredevelopment.Theseinitiativesmostlyfocusonimprovingthesoftwareprocessesandthetechnologyusedduringsoftwaredevelopment.Oneareaoftenunderestimatedbutcrucialforeverysoftwaredevelopmentprojectisprojectmanagement.[1]TheSPMMAhasbeencarriedoutatoneofthemid-sizeITcompany(calledABCforconfidentialityreason).Onepilotprojecthasbeenselected.Theprojectcompriseof40staffsincludingHeadofProject,ProjectManager,ProjectLeader,SystemAnalyst,Programmer,BusinessAnalystandotherpersonnel.Allofthestaffshasinvolvedinthisprogram.TwomoduleshavebeenselectedforSPMMAprogram.ABCcompanyhasinvolvedinmostofthegovernmentsbigproject.Almosteveryprojectinvolveswiththedevelopmentofthesystem.Theyalsoprovideotherservicessuchassupplyinghardwareandsoftware.InABCcompany,planning,projectrequirementsanddevelopmentweremostlyhandledonthefly.ThepractitionersinABCcompanyhavetheirownmentalityandinreality,theyarefacingdifficultiestotagalongtheguidelineintroduced.SPMMAisveryimportanttoABCcompanyinordertoprovidestructuredframeworkforprojectmanagementpractices.Otherthanthat,fromtheSPMMA,itcanhelpsABCcompanytomeasurethestrengthandweaknesses,developactionplanforsoftwareprojectmanagement.Bothprocesscanleadtothedevelopmentofsoftwareprocessimprovementinitiativeforsoftwareprojectmanagementpractices.ThispaperpresentsamodeltoassessSoftwareProjectManagement(SPM)practicesusingourSoftwareProjectManagementMaturityAssessment(SPMMA)model.WehaveusedtheCapabilityMaturityModelIntegration(CMMI)[2]andSoftwareProcessImprovementandCapabilityDetermination(SPICE)[3][4]assessmentmodelstoguidethedevelopmentofSPMMA.SPMMAComponentsWehaveidentifiedasetofcomponentfortheSPMMAasshowninFigure1below:Theassessmentinputs(questionnaires,interviewquestion,checklistandassessmentplan)SPMMAtrainingandteamselectioncriteria.SPMMAProcedureTheassessmentpreliminaryfindingsTheassessmentoutputs(Strengthsandweaknesses,actionplan,assessmentrecordandSPPMAlevel)SPMMAassessmentprocedure-Consistsofaeriesofstepsthatguideanassessmentteamincarryingouttheassessment.Theprinciplegoalsareensuretheassessmentisexecutedwithefficient,guidetheassessmentteamashowtoorganizetheassessment,collect,andanalyzeassessmentdata.Others,SPMMAprocedurealsoguidetheassessorsindevelopingactionplanfortheassessment.SPMMATeamSelection-Theassessmentteamconsistsofateamleader,organizationalunitcoordinator,librarian,facilitator,timekeeper,processareaminiteamandobserver.SPMMAInputs-Therearefour(4)typesofassessmentinstrumentswhichhadbeenproduced.Therewereassessmentplan,questionnaires,interviewquestionandchecklist.Theassessmentplanconsistsofthescopeoftheassessment,theparticipantsfortheinterviewsession,thefacilitiesneedtoperformtheassessment,thescheduleoftheassessmentandotherrelatedaspectontheonsiteassessment.Thequestionnaireshadbeengovernedbasedonthespecificpracticesineachprocessareas.Ithadbeenusedasanadditionalinstrumenttogatherdataindirectlyfromthepractitionersintheproject.Thequestionswereorganizedingroupsofprocessareassuchasprojectplanningandconfigurationmanagement.Therespondentsneedtoselectfour(4)possibleanswersforeachquestion.ThereareYes,No,DoesNotApplyandDontKnow.TheexamplesofthequestionforRiskManagementprocessareaquestionnairesare:Areriskscontingencyactivitiesplanned?Doestheprojectconductmeetingstoidentifycommoncausesofdefects?Onceidentified,arecommoncausesofrisksprioritizedandsystematicallyeliminated?Doestheprojectfollowawrittenorganizationalpolicyforrisksmanagementactivities?Domembersofthesoftwareengineeringgroupandothersoftware-relatedgroupsreceiverequiredtrainingtoperformtheirriskspreventionactivities?Aremeasurementsusedtodeterminethestatusofriskpreventionactivities(e.g.thetimeandcostforidentifyingrisksandthenumberofactionitemsproposed,open,andcompleted)?AretheactivitiesandworkproductsforriskpreventionsubjectedtoSQAreviewandaudit?Besidesthequestionnaires,theinterviewquestionwasuseddirectlyasaninstrumenttoconducttheinterview.Eachpersonnelhadbeenaskedaquestionontherolesandresponsibilitiesinproject,theprocesswhichhadbeendoneintheirdailytask,theproblemsariseinimplementingtheprocessandalsotherecommendationontheprocess.Thesamplequestionsfortheinterviewsessionare:Pleasetellmeaboutyourselfandyourexperienceasitrelatestothisproject?Pleasedescribeyourroleandresponsibilitiesontheproject?Howdoyouknowwhatyouaresupposedtobeworkingon?Whattraininghaveyouhadforyourjob?Areyouinvolvedwithanyoftheestimatingandplanningofthesoftwareproject?Iftherewereanythingyoucouldchangeaboutyourproject,whatwoulditbe?Doyouholdperiodicreviewsoftheproject?Howdoyouknowwhatformattofollow?Thechecklisthadbeenpreparedbasedonthespecificgoalsineachprocessareas.Ithadbeenusedtolistthefindingsfromtheassessment.Thechecklistwouldbefilledupbytheassessmentteam.Theprimarypurposeoftheinterviewsistogivetheassessmentteamabetterunderstandingoftheprojectmanagementpracticesandtheprojectmanagers'perceptionsofstrengthsandweaknessesintheprocess.Otherthanthat,weandtheassessmentteamalsohavetoreviewalltherelatedprojectmanagementdocumentations.PreliminaryFindingsT-hepreliminaryfindingsrepresenttheassessmentteam'sviewofthesoftwareprocesscurrentlyfacestheorganization.Thepreliminaryfindingsarebasedonthequestionnairesresponses,discussionwiththeassessmentparticipantsintheinterviewsessionanddiscussionsamongtheassessmentteammembers.Fromthechecklistweandtheassessmentteamhavetheideaonwhichpracticesisnotreallyfollowbytheproject.Themappingprocessisquitedifficultforthereasonthatthereisalotofinformationthatshouldbecover.Thepreliminaryfindingsrepresentthestartingpointforformulatingrecommendations.Theassessmentteamshouldhaveachieveateamconsensusfortheassessmentfindingsandcompletethepreliminaryfindingspresentation.Tovalidatetheassessmentfindings,ithasbeenpresentedtotheheadoftheproject,projectmanagersandalsoprojectleader.Thepresentationsessionservethepurposeofgettingtheprojectmanagerscommitmenttoundertakespecifimprovementinitiatives.Afterthefindingspresentation,theheadofprojectandtheassessmentteamleaderholdanexecutivemeetingtodiscussnextsteps.Thepurposeofthemeetingistoconfirmthetimefortherecommendationspresentationandfinalreport,todiscusstheimportanceofformingtheactionplanteamandtodeveloptheactionplan,andaddressanyquestionsorconcernsofmanagement.Outputs-Theassessmentteamprepareafinalreportoftheassessmentfindingsandrecommendations.Thepurposeofthefinalreportistodocumenttheassessmentfindings,describethekeyfindings,andmakespecificrecommendationstotheprojectbasedonthefindings.Besides,theassessmentreportalsoconsistthecharacterizationforeachprocessareasassessed.WeusetheformalcharacterizationinSCAMPI[5]suchasFullyImplemented(FI),LargelyImplemented(LI),PartiallyImplemented(PI)andNotImplemented(NI)astheSPMMALevel.Followingtherecommendations,theassessedprojecthavetoprepareanactionplanthatspecifieshow,whenandbywhomeachrecommendationstobeimplemented.Eachactionthataddressesarecommendationiscallanactiontask.Thepurposeoftheactionplanistoidentifyandplantheworkeffortforeachactiontask,identifyresponsibilityandresources,andprovideamechanismfortrackingandreportingontaskstatus.SPMMAModelTestResultAsmentionedinfirstchapter,wehavetesttheSPMMAmodelinamidsizeITcompany.WewillgiveanoverviewoftheresultachievedfromperformingtheassessmentusingSPMMAmodel.Tohelpusinperformingtheassessment,wehaveusedCMMIGenericGoals[2]tohelpusinmeasuringthestrengthandweaknessofthecurrentprocess.Table1showtheresultobtainedinSPMMA.FromthemappingprocessinTable1,wehaveusedtheformalcharacterizationfromSCAMPI.Theintentofthischaracterizationisveryeffectiveinordertosummarizetheassessmentteamsjudgment.Table2showthecharacterizationfortheprocessareasassessed.WehavemadesomerecommendationfortheABCcompany.Forexample,theABCcompanyshouldestablishproperriskidentificationandcontingencylist.BesidesitalsoshouldbewelldocumentedinaRiskManagementdocumentation.FuturePlansWeareplanningtodevelopourown5-levelstructureandourowncharacterizationindicator.Besides,wearealsoplanningtousetheSPMMAmodeltoassessothersoftwareengineeringpractices.Next,wewilldevelopatooltoaidtheassessmentteam.ConclusionFromourexperienceinimplementingSoftwareProcessMaturityAssessment(SPMMA),itisbelievedthatSPMMAcanbeatooltomeasurethelevelormaturityofthesoftwareprojectmanagementpracticesinanorganization.Fromourexperience,SPMMAcanbeanalternativetoformalassessmentbecauseitisnottoocomplicatedratherthanformalassessmentsuchasSCAMPI.WehaveidentifiedthreemainelementstomakesureSPMMAcanbeimplementedsuccessfully.Therearemodel,measurementandalsofullcommitmentfromthetopmanagement.Basedontheresult,itcanhelpABCcompanytoimprovetheirprojectmanagementpractices.Ofcourse,improvingtaskwilltakealotoftimeandeffortfromtheABCcompany.But,fromthatalso,itcanhelpABCcompanytoproducebetterproductsfortheircustomers.ReferenceMandl-StriegnitzP,LichterH.ACaseStudyonProjectManagementinIndustry-ExperiencesandConclusions.ProceedingsoftheEuropeanSoftwareMeasurementConference(FESMA),06.-08.May1998,Antwerp,Belgium,199&pp305-313CMMIProductDevelopmentTeam(2000).CMMIforSystemsEngineering/SoftwareEngineering,Version1.02,.CMU/SEI-2000-TR-018.Pittsburgh,PA:SoftwareEngineeringInstitute.ISO/IECJTC1/WG10,“SPICEProducts,”TechnicalReport,Type2,June1995.Dorling.A.,(1993)SPICE:SoftwareProcessImprovementandCapabilitydEtermination.SoftwareQualityJournal2,209-224.SoftwareEngineeringInstitute,2001.StandardCMMIAppraisalMethodforProcessImprovement(SCAMPI,Version1.1)中文譯文用軟件項目管理完備估價模型評定軟件項目管理實(shí)踐ShukorSanimBinMohdFauzi,NuraminahBtRamli

FacultyofInformationTechnologyandQuantitativeSciences,

UniversitiTeknologiMara,PerlisCampus,

02600Arau,Perlis,Malaysia

shukorsanim@.my

FacultyofInformationandCommunicationTechnology

UniversitiPendidikanSultanIdris,35900TanjongMalimPerak,Malaysia

nuraminah@.my摘要這篇文章展示了一個利用我們的軟件項目管理完備估價(SPMMA)模型評定軟件項目管理(SPM)實(shí)踐.我們討論模型過程,估價輸入和輸出,估價調(diào)查表,SPMMA相關(guān)的隊伍挑選.我們已經(jīng)在一個中型IT公司中測試過了我們的模型?為了完成估價,選擇了一個通過了ISO9001認(rèn)證的領(lǐng)航員項目.對于這個估價版本,只專注于包含項目計劃,項目監(jiān)測,控制和風(fēng)險管理過程范圍的項目管理實(shí)踐.本文也討論了領(lǐng)航員項目當(dāng)前進(jìn)程的強(qiáng)度和弱點(diǎn).關(guān)鍵字:軟件過程完備估價,項目管理,項目計劃,項目監(jiān)控和控制,風(fēng)險管理.介紹在軟件開發(fā)組織(SDO)中,項目管理是一個重要的部分.缺乏了適當(dāng)?shù)捻椖抗芾?會導(dǎo)致項目的失敗.很多軟件項目面臨著一個共同的情形:他們在日程表和計劃了的成本之內(nèi),在開發(fā)必須的功能性時失敗了;結(jié)果常常缺乏必須的質(zhì)量.這樣,在這幾年有些公司開始主動改進(jìn)他們的軟件開發(fā).這些主動主要集中在改進(jìn)軟件過程和軟件開發(fā)中用到的技術(shù).在軟件開發(fā)項目中一個重要的但經(jīng)常被忽視的領(lǐng)域是軟件管理.SPMMA在一家中型IT公司(由于機(jī)密性的原因我們稱為ABC)被實(shí)現(xiàn)了.我們選擇了一個領(lǐng)航員項目.這個項目由40個人員組成,包括項目領(lǐng)袖,項目經(jīng)理,項目領(lǐng)導(dǎo),系統(tǒng)分析員,程序員,商業(yè)分析員和其他職員,所有這些人員都參與了這個程序.SPMMA程序中的2個模塊被選定.ABC公司致力于很多政府的大項目.參與了幾乎每個項目的系統(tǒng)開發(fā).他們也提供其他諸如提供硬件和軟件的服務(wù).在ABC公司,計劃,項目需求和開發(fā)很多都是在飛行中完成的.ABC公司的從業(yè)人員有他們自己的想法.事實(shí)上,他們在順著方針介紹往下走時碰到了困難.SPMMA為ABC公司在項目管理實(shí)踐中提供結(jié)構(gòu)框架很重要.另外,SPMMA可以幫助ABC公司測量強(qiáng)度和缺點(diǎn),并為軟件項目管理開發(fā)行動計劃.這2點(diǎn)在軟件項目管理實(shí)踐中都能將軟件過程開發(fā)主動改進(jìn).這篇文章展示了一個利用我們的軟件項目管理完備估價(SPMMA)模型做成的模型評定軟件項目管理(SPM)的實(shí)踐.我們用了CMMI[2],軟件過程改進(jìn)和容量測定(SPICE兀3]⑷估價模型來領(lǐng)導(dǎo)SPMMA的開發(fā).2.SPMMA組成部分在下面的圖1中,我們已經(jīng)為SPMMA鑒別了一套組成部分:估價輸入(調(diào)查表,調(diào)查問題,清單和估價計劃)SPMMA訓(xùn)練和小組選擇標(biāo)準(zhǔn).SPMMA程序估價初步的發(fā)現(xiàn).估價輸出(強(qiáng)度和缺點(diǎn),行動方案,估價記錄和SPPMA級別)SPMMA估價程序--由一些連續(xù)的步驟組成,指導(dǎo)一個估價小組完成估價.原則目標(biāo)是保證估價有效地完成,指導(dǎo)估價小組怎樣組織估價,收集,分析估價數(shù)據(jù)?另外,SPMMA程序也指導(dǎo)估價員為估價開發(fā)行動計劃.SPMMA小組選擇--估價小組由一個小組組長,組織協(xié)調(diào)者,圖書管理員,促進(jìn)人員,計時員,過程袖珍小組和觀察員.SPMMA輸入-總共有4種類型的估價工具被提出來.估價計劃,調(diào)查表,調(diào)查問題和清單.估價計劃包括估價范圍,會議會見的參與者,完成估價需要的設(shè)備.估價日程表和其他現(xiàn)場估價相關(guān)的方面.每個過程中,參與者基于特定的實(shí)踐被管理著.這被用來當(dāng)成一個額外的工具間接從參與項目的參與者那里收集數(shù)據(jù).每個過程的問題都被組織為一組.例如項目計劃和結(jié)構(gòu)管理.回答者對每個問題選擇可能的四個(4)答案:”是”,”否”,”不確定”,”不知道”.一個關(guān)于風(fēng)險管理過程的調(diào)查表的例子:風(fēng)險的偶然行為計劃了嗎?項目管理會議確定了普遍的缺陷的原因了嗎?一旦確定了,把這些普遍的缺點(diǎn)優(yōu)先級設(shè)定了嗎?系統(tǒng)地排除了嗎?項目遵循了組織對于風(fēng)險管理行為的方針了嗎?軟件工程團(tuán)隊的成員和其他有關(guān)團(tuán)隊需要為完成他們的風(fēng)險預(yù)防行為進(jìn)行練習(xí)嗎?有一個測量方法被用來確定風(fēng)險預(yù)防行為狀態(tài)(例:確定風(fēng)險的時間和成本和行為項目提議,開展和完成的數(shù)量)?風(fēng)險管理主題的行為和工作產(chǎn)品經(jīng)過SQA回顧和審核了嗎?除了調(diào)查表,調(diào)查問題也被直接用做一個工具引導(dǎo)調(diào)查.每個項目中擔(dān)任角色和有責(zé)任的人員被問了一個問題,問題包括他們每天任務(wù)的完成過程,執(zhí)行過程遇到的問題和對該過程的建議.調(diào)查會議問題的例子為:請說一下你和你關(guān)于這個項目的經(jīng)驗(yàn).請描述一下你在這個項目中擔(dān)任的角色和責(zé)任.你是怎么知道你將會進(jìn)行怎樣的預(yù)想的工作?針對你的工作,你進(jìn)行過什么訓(xùn)練?你以前從事過對軟件項目的估計和計劃嗎?如果你覺得你的項目需要改進(jìn),你覺得是哪些地方?你對你的項目進(jìn)行過周期性的重審嗎?你怎么知道你應(yīng)該遵循哪種格式?清單在每個過程針對特定的目標(biāo)被準(zhǔn)備好了.它被用來列出對估價的發(fā)現(xiàn).清單是由估價小組填寫的.調(diào)查首要的目的是讓估價小組對于項目管理實(shí)踐和項目管理過程的強(qiáng)度和缺點(diǎn)有一個更好的認(rèn)識.此外,估價小組和我們也不得不重新審查所有關(guān)于項目管理的文件.初步的發(fā)現(xiàn)--初步的發(fā)現(xiàn)表現(xiàn)出估價小組對于軟件過程現(xiàn)在面對的組織的觀點(diǎn).初步的發(fā)現(xiàn)是基于調(diào)查表結(jié)果,在調(diào)查會議中與估價參與者的討論和估價小組成員的討論的.從列表中我們和估價小組有一個想法,實(shí)踐不真的遵循項目.由于很多應(yīng)該被覆蓋的信息的原因,映射過程相當(dāng)困難.初步的發(fā)現(xiàn)顯示出明確地敘述建議的起始點(diǎn).估價小組對于估價發(fā)現(xiàn)和初步的發(fā)現(xiàn)總結(jié)陳述應(yīng)該有一致的意見.為證實(shí)估價發(fā)現(xiàn),它被反映給項目領(lǐng)袖,項目經(jīng)理和項目領(lǐng)導(dǎo)了.陳述會議基于獲得項目經(jīng)理們的同意進(jìn)行特定的主動改進(jìn)的目的.在發(fā)現(xiàn)陳述之后,項目領(lǐng)導(dǎo)和估價小組組長針對下一個步驟舉行了一個行政會議.會議的目的是確定建議陳述和最終報告的時間.討論形成行動方案小組的重要性,開發(fā)行動計劃和從事任何問題和關(guān)注管理.輸出--估價團(tuán)隊對估價發(fā)現(xiàn)和建議準(zhǔn)備一個最終報告.這個最終報告的目的是證明估價發(fā)現(xiàn),描述關(guān)鍵的發(fā)現(xiàn)和作出基于該發(fā)現(xiàn)的關(guān)于該項目的明確的建議.此外,估價報告也包含了對每個過程的評定的描述.我們用SCAMPI⑸那種形式的描述.比如在SPMMA級別上的充分地實(shí)行(FI),主要地實(shí)行(LI),部分地實(shí)行(PI)和沒有實(shí)行(NI).根據(jù)建議,評定過的項目不得不準(zhǔn)備一個行動計劃以指定每一個建議是怎樣,什么時候,被誰執(zhí)行的.每個從事于該建議的行動稱為行動任務(wù).行動計劃的目的是確定和計劃每一個行動任務(wù)的工作成果,確定責(zé)任和資源,提供跟蹤和報告任務(wù)狀態(tài)機(jī)制的.3.SPMMA模型測試結(jié)果就象第一節(jié)說過的那樣,我們已經(jīng)在一個中等規(guī)模的IT公司測試過了SPMMA模型.我們可以給出一個用SPMMA模型執(zhí)行估價的結(jié)果的總體的概括.為了幫助我們執(zhí)行估價,我們運(yùn)用了CMMI一般目標(biāo)[2]幫助我們測量當(dāng)前過程的強(qiáng)度和缺點(diǎn).表格1顯示出由SPMMA獲得的結(jié)果.在表格1繪制過程中,我們運(yùn)用了SCAMPI的正式的描述.用這種描述的意圖是為了有效地總結(jié)估價小組的判斷.表格2給出過程評定的描述.我們給ABC公司作出了一些建議.例如,ABC公司應(yīng)該建立適當(dāng)?shù)娘L(fēng)險鑒定和偶然的列表.此外還應(yīng)該在一個風(fēng)險管理文件中好好證明它.以后的計劃.我們計劃開發(fā)我們自己的5級結(jié)構(gòu)和我們自己的描述指示器.此外,我們也在計劃用SPMMA模型評定其他軟件工程實(shí)踐.下一步,我們將設(shè)計一個工具來幫助估價小組.總結(jié)從我們在實(shí)現(xiàn)軟件過程完備估價(SPMMA)的經(jīng)驗(yàn)中,有理由相信SPMMA可以被用作一個工具來測量一個組織軟件項目管理實(shí)踐的級別或成熟度?通過我們的經(jīng)驗(yàn),SPMMA可以成為一個可供選擇的正式的估價.因?yàn)樗绕鹌渌恼降墓纼r如SCAMPI來說并不復(fù)雜.我們確定了三個主要的因素來確保SPMMA可以成功地實(shí)現(xiàn).有頂部管理的模型,測量方法和完整的委托事項.基于這些原因,它可以幫助ABC公司實(shí)現(xiàn)他們的項目管理實(shí)踐.當(dāng)然,ABC公司改進(jìn)任務(wù)將花費(fèi)很多時間和努力.但是,也正是這樣一來,它可以幫助ABC公司為他們的顧客生產(chǎn)更好的產(chǎn)品.6.參考資料Mandl-StriegnitzP,LichterH.ACaseStudyonProjectManagementinIndustry—ExperiencesandConclusions.ProceedingsoftheEuropeanSoftwareMeasurementConference(FESMA),06.-08.May1998,Antwerp,Belgium,199&pp305-313CMMIProductDevelopmentTeam(2000).CMMIforSystemsEngineering/SoftwareEngineering,Version1.02,.CMU/SEI-2000-TR-018.Pittsburgh,PA:SoftwareEngineeringInstitute.ISO/IECJTC1/WG10,“SPICEProducts,”TechnicalReport,Type2,June1995.Dorling.A.,(1993)SPICE:SoftwareProcessImprovementandCapabilitydEtermination.SoftwareQualityJournal2,209-224.SoftwareEngineeringInstitute,2001.StandardCMMIAppraisalMethodforProcessImprovement源代碼(部分)不含deelx.h和stdafx.cpp及stdafx.h/*Socket.h#ifndef_CSOCKET_H_#define_CSOCKET_H_#pragmaonce#include"stdafx.h"#include"deelx.h"classCsocket{public:Csocket(void);SOCKETCreate(intaf,inttype,intprotocol);intCConnect(SOCKETclient,stringdest);voidCClose(SOCKETclient);intCSend(SOCKETclient,constchar*sendbuf,intlen);voidCRecv(SOCKETclient,FILE*fp);public:~Csocket(void);private:intaf;inttype;intprotocol;public:vector<string>myURL;};#endif/*Socket.cpp#include"Csocket.h"Csocket::Csocket(void){}Csocket::~Csocket(void){}SOCKETCsocket::Create(intaf,inttype,intprotocol){WORDwVersionRequested;WSADATAwsaData;interr;wVersionRequested=MAKEWORD(2,2);err=WSAStartup(wVersionRequested,&wsaData);if(err!=0){cout<<"Error:"<<WSAGetLastError()<<endl;returnNULL;}if(LOBYTE(wsaData.wVersion)!=2||HIBYTE(wsaData.wVersion)!=2){cout<<"Error:"<<WSAGetLastError()<<endl;WSACleanup();returnNULL;}returnsocket(af,type,protocol);}intCsocket::CConnect(SOCKETclient,stringdest){

SOCKADDR_INaddrSrv;chara[50]="";for(inti=0;i<dest.size();i++)a[i]=dest[i];LPHOSTENTlphost;intport;port=8080;((LPIN_ADDR)lphost->h_addr)-lphost=gethostbyname(a);addrSrv.sin_addr.S_un.S_addr((LPIN_ADDR)lphost->h_addr)->S_un.S_addr;addrSrv.sin_port=htons(port);addrSrv.sin_family=AF_INET;intresult;result=connect(client,(SOCKADDR*)&addrSrv,sizeof(SOCKADDR));if(0!=result){cout<<"Connecterror!"<<GetLastError()<<endl;WSACleanup();}returnresult;}voidCsocket::CClose(SOCKETclient){closesocket(client);WSACleanup();}intCsocket::CSend(SOCKETclient,constchar*sendbuf,intlen){intresult;result=send(client,sendbuf,len,0);returnresult;}voidCsocket::CRecv(SOCKETclient,FILE*fp){charrecvBuf[200];staticCRegexpT<char>regex_first("\"[hH][tT]{2}[pP]\\:/{2}.*?(\")");//gettheURLlike"/..."staticCRegexpT<char>regex_second("\"[hH][tT]{2}[pP]\\:/{2}.*?(?=((/)|(\")|(\\:)))");//gettheURLlike""intrecvresult=0;inti=0;stringtemp;do{memset(recvBuf,0x00,sizeof(recvBuf));recvresult=recv(client,recvBuf,200,0);MatchResultresult_first=regex_first.Match(recvBuf);while(result_first.IsMatched()){charresu[200]="";for(i=0;i<result_first.GetEnd()-result_first.GetStart();i++)resu[i]=recvBuf[result_first.GetStart()+i];fputs(resu,fp);fprintf(fp,"\n");cout<<resu<<endl;result_first=regex_first.Match(recvBuf,result_first.GetEnd());}MatchResultresult_second=regex_second.Match(recvBuf);while(result_second.IsMatched()){charresu[200]="";for(i=0;i<result_second.GetEnd()-result_second.GetStart()-8;i++)resu[i]=recvBuf[result_second.GetStart()+i+8];temp=resu;myURL.push_back(temp);result_second=regex_second.Match(recvBuf,result_second.GetEnd());}}while(recvresult!=0);cout<<"Receivedover!"<<endl;}/*Sipder.h#pragmaonce#ifndef_SPIDER_H#define_SPIDER_H#include"stdafx.h"#include"Csocket.h"typedefstructaddr{char*dest;FILE*fp;intdepth;}*addr_t;voidSpider(void*p);#endif/*Spider.cpp#include"Spider.h"voidSpider(void*p){addr_tSpiderAddr;SpiderAddr=(addr_t)malloc(sizeof(addr));memset(SpiderAddr,0*00,sizeof(addr));SpiderAddr=(addr_t)p;intconnresult;charsendBuf[200];strcpy(sendBuf,"GET/sitemap.jspHTTP/1.1\r\n");strcat(sendBuf,"Host:localhost\r\n");strcat(sendBuf,"Con

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論