Create a Virtual Test Environment

advertisement
CreateaVirtualTest
Environment
StepbyStepExercises
Hans-PetterHalvorsen,M.Sc.
WhyDoWeNeedaTest
Environment?
WhycantwejustuseourownPC?
WhyTestEnvironment?
• “ItworksonmyPC”saystheDeveloper
• CleanEnvironment
• OntheDevelopersPCswehaveallkindofSoftwareinstalled
thattheCustomerdonthave,e.g.DevelopmentToolslikeVisual
Studio,etc.
• WeneedtotestondifferentPlatformsandOperatingSystems
• CustomersmayusedifferentWebBrowsers
• Deployment:TestofInstallationpackages
• MakethesoftwareavailableforTesters
• etc.
Developers
Development
TypicallytheDevelopersPersonal
ComputerwithDatabase,Web
ServerandProgramming
Software
Development
Environment
Developers&Testers
Testing
ACleanPC/Server(oranetwork
withPCsandServers)whereyou
installandtestyourSoftware.
Todaywetypicallyset-upaVirtual
TestEnvironment
TestEnvironment
Programming environments suchasVisual
Studio, etc.should notbeinstalledinthis
environment. Youneedtocreate.exefiles
etc.inordertomakeyour softwarerun.
Customers
Production
TheCustomers
environment whereyou
unstallthefinal
software(Servers and
Clients)
Production
Environment
VirtualizationSoftware
AlotofVirtualizationSoftwareexists.Herearesomeexamples:
• VMwareWorkstationPlayer (Wewillusethisinthisexercise)
• VMwareWorkstation
• VMwarevSphere
• VMwareFusion(Mac)
• Parallells Desktop(Mac)
• MicrosoftHyper-V
• VirtualBox
• etc.
Virtualization
Windows, Linux,...
Guests
VM
VM
VM=VirtualMachines
VM
Windows, Linux,...
Virtualization
Software
VM
OperatingSystem
(OS)
Host
VM
Hypervisor
Hardware
(Computer)
VM
AHypervisor can
rundirectlyonthe
computer without
aHostOS
VMwareWorkstationPlayer
VMwareWorkstationPlayerisforpersonaluseonyourownPC.
VMwareWorkstationPlayerisfreeofchargeforpersonalnon
commercialuse.
Note!Makesureyouhaveenough
freespaceonyourharddrive!
VMwareisacompanythathas
beenspecializingwithin
virtualizationsoftware.
http://www.vmware.com
8
Exercises
• InstallVMwareWorkstationPlayer(orsimilarsoftware)
...
• DownloadandInstallOS (e.g.,Windows10)from
DreamSpark
• Install/ConfigureServerSoftware,e.g.:
– InstalltheDatabaseSystem (SQLServerorother)
– ConfiguretheWebServer(IISorother)(onlyifyoucreateWeb
pages,etc.)
...
• InstallYourSoftware(Database,DesktopApp/WebApp)
• StartTesting!
Software
1. InstallVMwarePlayer
–
–
Ifyouhave64bitOS:InstallVMwarePlayer7
Ifyouhave32bitOS:InstallVMwarePlayer6
2. InstallOS ofyourchoiceinsidePlayer
–
Windows7orWindows8.1(choosedifferentwithinthe
Team)
3. InstallSQLServerExpresswithToolsinsideyourVM
–
Youmayneedtoinstall.NETFramework3.5SP1first
4. Installyour SoftwareinsideyourVM
1. DatabaseTables,Views,etc.
2. YourApp
Note!Makesureyouhaveenough
freespaceonyourharddrive!
VMWareWorkstation
Player
StepbyStep
Hans-PetterHalvorsen,M.Sc.
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
SelecttheOS.isoFilefortheOSyou
wanttoinstall
Selectproper NameandLocation
Selectthe
versionyouwant
toinstall
Toolsthatthevirtualization
environment needstoworkproperly.
ClickFinish
Note!Itisreccommended
thatyouchangethe
ComputerNamebefore
youstartsinstallionglotsof
Softwareonit.
Congratulations!Itworks!
16
YouarefinishedwiththeExercise
17
VMWarePlayer
InstallationofSoftware
inaVirtualMachine
Hans-PetterHalvorsen,M.Sc.
VirtualMachineSettings
Note!YouhaveaccesstoNetwork,
Printers,USBPorts,Sound Card,
Camera,etc.onyourHostPC
19
InstallingSoftwareusing.isoFiles
Justlocatethe.ISOFilethatis
locatedontheHostPC
Installing/CopyingfromaUSBMemoryStick
ClicktoConnecttoaUSBMemory stick
thatisconnectedtotheHostPC
CopyingFilesintotheVM
Justuse“Ctrl+C”and“Ctrl+V”inorderto
copyfilesbetweenyourHostPCandtheVM
J
YouarefinishedwiththeExercise
Database
StepbyStep
Hans-PetterHalvorsen,M.Sc.
Database
• YoushouldcreateoneSQLScriptthatinstalls
allthenecessarystuff(Tables,Stored
Procedures,Views,Scripts,etc...)
• RuntheScriptusingtheSQLServer
ManagementStudio(orsimiliar)
DatabaseScriptGenerator
Folderstructure:
•
•
•
•
•
•
Functions
Scripts
StoredProcedures
Tables
Triggers
Views
• ThisToolgeneratesoneSQLScriptthatcontainsall
SQLfilesintheFolderstructureincluding
subfolders(recursive).
• UsefulwheninstallingtheDatabase– youneed
onlytoexecuteonesingleSQLfile.
Download fromhttp://home.hit.no/~hansha/?page=software_development
MicrosoftSQLServer– ManagementStudio
3
4
YourSQLServer
1
2
WriteyourQueryhere
YourDatabase
Your
Tables
5
Theresultfrom yourQuery
YouarefinishedwiththeExercise
WebServer
StepbyStep
Hans-PetterHalvorsen,M.Sc.
WebServer
• Configure/setup/installtheWebServer
– IIS(InternetInformationServices),Apache,...
• InstallWebServices(ifany)
• InstallyourWebApp
Deploy/PublishWebServicetoIIS
CopyWebServiceFiles(Project)todefaultIISDirectory:C:\inetpub\wwwroot
32
YouarefinishedwiththeExercise
DesktopApp
Hans-PetterHalvorsen,M.Sc.
InstallyourDesktopApp(ifany)
• ManuallyCopyyourAppFilestotheVMand
makesureyoucanstartit(Createashortcuton
theDesktop)
• Itisrecommendedtocreatean.exeApp
Note!
WewilllearntocreateSetupPackagesinthenext
Topic:“DeploymentandMaintenance”
YouarefinishedwiththeExercise
StartTesting
Hans-PetterHalvorsen,M.Sc.
Testing
• TestyousoftwareaccordingtotheRequirementsandDesign
Documents andtheSoftwareTestPlan
• ReportBugsasWorkItemsinTFS
SoftwareTest
Plan(STP)
PlanningTests
PerformTests
SoftwareDesignDocument (SDD)
SoftwareRequirementsSpecifications(SRS)
TestLogs
Document
TestResults
SoftwareTest
Documentation
(STD)
- Functional&Non-FunctionalRequirements
- User&SystemRequirements
Hans-PetterHalvorsen,M.Sc.
UniversityCollegeofSoutheastNorway
www.usn.no
E-mail:hans.p.halvorsen@hit.no
Blog:http://home.hit.no/~hansha/
Download