Upload
tranlien
View
220
Download
2
Embed Size (px)
Citation preview
CreateaVirtualTestEnvironment
Hans-PetterHalvorsen,M.Sc.StepbyStepExercises
WhyDoWeNeedaTestEnvironment?
WhycantwejustuseourownPC?
WhyTestEnvironment?• “ItworksonmyPC”saystheDeveloper• CleanEnvironment• OntheDevelopersPCswehaveallkindofSoftwareinstalled
thattheCustomerdonthave,e.g.DevelopmentToolslikeVisualStudio,etc.
• WeneedtotestondifferentPlatformsandOperatingSystems• CustomersmayusedifferentWebBrowsers• Deployment:TestofInstallationpackages• MakethesoftwareavailableforTesters• etc.
Development Testing Production
DevelopmentEnvironment TestEnvironment
ProductionEnvironment
TypicallytheDevelopersPersonalComputerwithDatabase,WebServerandProgrammingSoftware
ACleanPC/Server(oranetworkwithPCsandServers)whereyouinstallandtestyourSoftware.Todaywetypicallyset-upaVirtualTestEnvironment
TheCustomersenvironmentwhereyouunstallthefinalsoftware(ServersandClients)
Programming environments suchasVisualStudio,etc.shouldnotbeinstalledinthisenvironment.Youneedtocreate.exefilesetc.inordertomakeyoursoftwarerun.
Developers Developers&Testers Customers
VirtualizationSoftwareAlotofVirtualizationSoftwareexists.Herearesomeexamples:• VMwareWorkstationPlayer (Wewillusethisinthisexercise)• VMwareWorkstation• VMwarevSphere• VMwareFusion(Mac)• Parallells Desktop(Mac)• MicrosoftHyper-V• VirtualBox• etc.
Virtualization
OperatingSystem(OS)
VirtualizationSoftware
Hypervisor
VM VM VM
Hardware(Computer)
VM VM VM
Guests
Host
VM=VirtualMachines
AHypervisorcanrundirectlyonthecomputerwithoutaHostOS
Windows,Linux,...
Windows,Linux,...
VMwareWorkstationPlayerVMwareWorkstationPlayerisforpersonaluseonyourownPC.VMwareWorkstationPlayerisfreeofchargeforpersonalnoncommercialuse.
8
VMwareisacompanythathasbeenspecializingwithinvirtualizationsoftware.http://www.vmware.com
Note!Makesureyouhaveenoughfreespaceonyourharddrive!
Exercises• InstallVMwareWorkstationPlayer(orsimilarsoftware)...• DownloadandInstallOS (e.g.,Windows10)fromDreamSpark
• Install/ConfigureServerSoftware,e.g.:– InstalltheDatabaseSystem (SQLServerorother)– ConfiguretheWebServer(IISorother)(onlyifyoucreateWebpages,etc.)
...• InstallYourSoftware(Database,DesktopApp/WebApp)• StartTesting!
Software1. InstallVMwarePlayer– Ifyouhave64bitOS:InstallVMwarePlayer7– Ifyouhave32bitOS:InstallVMwarePlayer6
2. InstallOS ofyourchoiceinsidePlayer– Windows7orWindows8.1(choosedifferentwithinthe
Team)3. InstallSQLServerExpresswithToolsinsideyourVM– Youmayneedtoinstall.NETFramework3.5SP1first
4. Installyour SoftwareinsideyourVM1. DatabaseTables,Views,etc.2. YourApp
Note!Makesureyouhaveenoughfreespaceonyourharddrive!
VMWareWorkstationPlayer
Hans-PetterHalvorsen,M.Sc.
StepbyStep
VMwareWorkstationPlayer• DownloadandInstallVMwareWorkstationPlayer(orsimilarsoftware)• DownloadandInstallSoftware(.iso Files)neededfromDreamspark
– WindowsOS(e.g.,Windows10).GetLicenseKeyfromDreamSpark– SQLServer(ExpressorFullversion)– ...– Note!DeveloperToolsshallnotbeinstalledinTest/Production
Environment!• DownloadotherSoftwareifneeded⇒ Makesuretokeepallthesoftwareinstallationfilesinoneplacefornexttime⇒ MakeacopyoftheVMforlateruse(“CleanInstallation”)(ifyouhaveenough
freespaceonyourharddrive,oruseamemorystick)
CreateNewVirtualMachine
ExampleofexistingVirtualMachines
SelectproperNameandLocation
SelecttheOS.isoFilefortheOSyouwanttoinstall Selectthe
versionyouwanttoinstall
Toolsthatthevirtualizationenvironmentneedstoworkproperly.
ClickFinish
16
Congratulations!Itworks!Note!ItisreccommendedthatyouchangetheComputerNamebeforeyoustartsinstallionglotsofSoftwareonit.
17YouarefinishedwiththeExercise
VMWarePlayer
Hans-PetterHalvorsen,M.Sc.
InstallationofSoftwareinaVirtualMachine
19
VirtualMachineSettings
Note!YouhaveaccesstoNetwork,Printers,USBPorts,Sound Card,Camera,etc.onyourHostPC
InstallingSoftwareusing.isoFiles
Justlocatethe.ISOFilethatislocatedontheHostPC
Installing/CopyingfromaUSBMemoryStickClicktoConnecttoaUSBMemorystickthatisconnectedtotheHostPC
CopyingFilesintotheVM
Justuse“Ctrl+C”and“Ctrl+V”inordertocopyfilesbetweenyourHostPCandtheVM
J
YouarefinishedwiththeExercise
Database
Hans-PetterHalvorsen,M.Sc.
StepbyStep
Database
• YoushouldcreateoneSQLScriptthatinstallsallthenecessarystuff(Tables,StoredProcedures,Views,Scripts,etc...)
• RuntheScriptusingtheSQLServerManagementStudio(orsimiliar)
DatabaseScriptGeneratorFolderstructure:• Functions• Scripts• StoredProcedures• Tables• Triggers• Views
Download fromhttp://home.hit.no/~hansha/?page=software_development
• ThisToolgeneratesoneSQLScriptthatcontainsallSQLfilesintheFolderstructureincludingsubfolders(recursive).
• UsefulwheninstallingtheDatabase– youneedonlytoexecuteonesingleSQLfile.
MicrosoftSQLServer– ManagementStudio
1
2
3
4
5
WriteyourQueryhere
TheresultfromyourQuery
YourDatabase
YourTables
YourSQLServer
YouarefinishedwiththeExercise
WebServer
Hans-PetterHalvorsen,M.Sc.
StepbyStep
WebServer• Configure/setup/installtheWebServer– IIS(InternetInformationServices),Apache,...
• InstallWebServices(ifany)• InstallyourWebApp
Deploy/PublishWebServicetoIISCopyWebServiceFiles(Project)todefaultIISDirectory:C:\inetpub\wwwroot
32
YouarefinishedwiththeExercise
DesktopApp
Hans-PetterHalvorsen,M.Sc.
InstallyourDesktopApp(ifany)• ManuallyCopyyourAppFilestotheVMandmakesureyoucanstartit(CreateashortcutontheDesktop)
• Itisrecommendedtocreatean.exeApp
Note!WewilllearntocreateSetupPackagesinthenextTopic:“DeploymentandMaintenance”
YouarefinishedwiththeExercise
StartTesting
Hans-PetterHalvorsen,M.Sc.
Testing• TestyousoftwareaccordingtotheRequirementsandDesign
Documents andtheSoftwareTestPlan• ReportBugsasWorkItemsinTFS
PlanningTests PerformTests DocumentTestResults
SoftwareTestPlan(STP)
SoftwareRequirementsSpecifications(SRS)SoftwareDesignDocument (SDD)
SoftwareTestDocumentation
(STD)
TestLogs
- Functional&Non-FunctionalRequirements- User&SystemRequirements
Hans-PetterHalvorsen,M.Sc.
UniversityCollegeofSoutheastNorwaywww.usn.no
E-mail:[email protected]:http://home.hit.no/~hansha/