Testing med Visual Studio Team System for Software Testers TechTalk Testing med Visual Studio Team System for Software Testers Martin Pamdeth martinpa@microsoft.com Developer & Platform Strategy Microsoft Danmark blog: http://blogs.msdn.com/martinpa
Agenda Mål for VSTS og TFS Tests: Hvorfor, Hvornår og Hvad? Testning med VSTS Test Typer Administration og Kørsel af Tests i VSTS Load Testing Build management med Team Build Et par gode råd Afrunding inkl. spørgsmål og svar
Database Professional Visual Studio Team System Udvidelse af Visual Studio på tværs af Applikations Livsforløbet (ALM) Developer Designer Database Professional Architect Tester Business Analyst IT / Project Manager Projekt Gennemsigtighed Team Samarbejde Software Kvalitet © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 3
Visual Studio Team System Application Life Cycle Management (ALM) Løsning Web Clients and XML Web Services Business Analyst Operations, QA and Help Desk Third-Party IDEs © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 4
Visual Studio Team System Visual Studio Team Suite Software Architects Software Developers Software Testers Database Professionals Visual Studio Team Explorer Visual Studio Industry Partners Application Modeling Code Analysis Performance Testing Database Deployment Infrastructure and Deployment Modeling Performance Tuning Manual Testing Database Change Mgmt. Test Case Management Database Testing Security Analysis Unit Testing Code Coverage MSF Process and Guidance Class Modeling Visio and UML Modeling Visual Studio Professional Edition Team Build Server Load Test Agent Visual Studio Team Foundation Server Change Management Reporting Integration Services Work Item Tracking Project Site Project Management © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 5
Agenda Mål for VSTS og TFS Tests: Hvorfor, Hvornår og Hvad? Testning med VSTS Test Typer Administration og Kørsel af Tests i VSTS Load Testing Build management med Team Build Et par gode råd Afrunding inkl. spørgsmål og svar 6
Hvorfor teste? Øget kvalitet Find og ret design fejl Lavere TCO og vedligeholdelses omkostninger
Hvornår skal man teste? Så ofte som muligt Så tidligt som muligt Automatiserede tests vil være til hjælp
Hvad skal man teste? Kritisk forretningslogik Alt andet Jo tydligere kravene til performance og skalerbarhed er beskrevet, desto lettere er det at vide, hvad der skal testes Projektledelsen bør skaffe disse data så tidligt som muligt i forløbet Bør helst være defineret fra start af
Test af applikationer Funktionel test Performance test Sikkerheds test Robustheds test Usability test …
Funktionelle test Validerer brugerkrav Test data skal defineres Store applikationer/web sites kan være svære at teste Fejl skal gøres reproducerbare Test repetitioner er nødevendige regressions/integrations tests
Performance tests En af de mest kritiske og ofte oversete tests for web løsninger Bør køres for hver iteration i projektet Vigtigt at definere mål og holde testene op imod disse mål Optimer applikationen om nødvendigt
Projekter og Tests Ofte dyrt at vente til sidst Strategier for at minimere indvirkningen 30 25 20 Relative omkostninger for at rette bugs... 15 10 5 Kodning Integration Krav Beta Test Post-Release
Udfordringer... Det er dyrt at finde og rette fejl, der undslipper ifm. den daglige udviklings praksis Det er svært at diagnostisere fejl ved runtime Hvorfor kører en given applikation langsomt? De enklete udviklere og testere har brug for at vide om de følger tidsplanen Test og udvikling er ofte ude af synk Den endelige test fase ifm idriftsættelse er ofte for ad-hoc Hvornår har man testet tilstrækkeligt?
“Defence In Depth” Microsoft bruger en 'defence in depth' strategi Unit testing Kode reviews Jævnlige builds Fang fejlene tidligt Statiske checks Runtime checks
Agenda Mål for VSTS og TFS Tests: Hvorfor, Hvornår og Hvad? Testning med VSTS Test Typer Administration og Kørsel af Tests i VSTS Load Testing Build management med Team Build Et par gode råd Afrunding inkl. spørgsmål og svar 16
Fokus på kvalitet tidligt i processen Visual Studio Team System klient Team Foundation Server Unit Testing og Code Coverage Versions-styring Statisk og Dynamisk Analyse Bug Tracking Team System Goal: Move quality upstream in the development process Code is better on checkin Better, more frequent handoffs between dev and test for continuous quality Tools are integrated so they are part of the way you work Transparency through reporting Client tools: Unit testing and code coverage encourage dev testing early. Now db unit tests too! Static and Dynamic analysis finds problems before they are checked in Policies enable you to instill your processes on the team. Web and load testing available to load test early in the process on your terms to find perf and scale problems, and not leave it to an external team late in the process. TFS: capture and integrate project assets at the data layer TFS stores Source, bugs and work items, builds Reports on team portal show quality metrics like bug trends, code coverage, code churn Checkin regler Build Server Web og Load Testing Reporter m. Kvalitets metrikker
VSTS Developer &Tester Eksempel på forløb Udv. skriver kode Udv. skriver & kører Unit Tests Udv. laver kode review Udv. kører Kode Analyse Udv. definerer Load Tests Udv. checker arbejde ind Tester undersøger Build Status Tester kører Load Test Tester rapporterer fejl Udv. diagnosticerer og retter fejl Udv. checker arbejde ind
Integration af Udv. og Test Tests er bare endnu en form for kildekode: Er under versionskontrol Versioneres sammen med produktet “Test Komplet” Test kodningen planlægges sammen med udviklings arbejdet Spores vha. work items Testere notificeres når fejl bliver rettet
Visual Studio Team System Team Edition for Software Testers Manuelle test Ikke eller svært automatiserbare tests Unit testing Gerne kombineret med Code Coverage, måler effektivitet af ens tests Web test Automatisk afspilning af optagede web scenarier (HTTP/S), samt kode generering Web services tests via protocol-baseret script Load test Parallelt distribuerede unit og funktionelle test Præ-konfigurerede samt skrædersyede load mønstre Foruddefineret metrik opsamling samt overvågning af tærskler Generiske test Integration af anden test kode (Pass/Fail) Skrædersyede test typer 3. parts test integration Test administration samt kobling til Build services © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 20
Web Tests Ikke kun til ASP.NET Kan benyttes til test af Web Services HTTP-baseret En vilkårlig web side Kan benyttes til test af Web Services
Test Typer Optagede tests (deklarative) Kodede tests XML format Liste af URL’er og parametre Validerings- samt ekstraktions-regler Kodede tests Udvides via programlogik Konverteres fra optagne tests
Smarte Features Forberedt for Forms Authentication Viewstate Tracking Cookie Tracking
Validerings- og ekstraktions regler Valider webside tilgang Check indhold eller respons Definer skræddersyede regler Validering kan være data-styret Extraher attributter / parametre Til brug i efterfølgende requests
Kodede Web Tests Komplet skræddersyet test løsning // Create a test WebTestRequest request1 = new WebTestRequest("http://localhost/StoreCSVS"); request1.ThinkTime = 8; // Add a rule ValidationRuleFindText rule1 = new ValidationRuleFindText(); rule1.FailIfTextFound = false; rule1.TextToFind = "IBuySpy"; request1.ValidateResponse += new ValidateResponseEventHandler(rule1.Validate);
Implementering af Tests
Test Typer – kan udvides Vi understøtter 5 test typer “out of the box”: Manuelle Unit (C#, C++ and VB .NET) Web Load/Stress/Smoke 3. parts leverandører kan tilføje deres egne -- fuldt integrerede -- test typer
VSIP Partners Compuware and Automated QA provide a full line of testing tools, include UI automation tools SPI Dynamics provides security testing tools Identify and AviCode provide diagnostics
Andre Test Typer Ordnet Generisk Afvikler en gruppe af tests i foruddefineret rækkefølge Generisk En indkapsling af eksisterende tests (Pass/Fail)
Tests: kerne element i VSTT Understøtter forskellige roller Test implementatør (udviklere & testere) Test afvikler & organisator Build miljø understøttelse Nye brugergrænseflade elementer Test View – implementering, kørsel Test Manager – gruppering, kørsel Test Results – kørsels resultater Test Runs – status og historik Code Coverage Results – test effektivitet
Administation & kørsel af tests Tests kan gruppperes i kategorier Kørsel af tests: Lokalt & remote Via IDE’et Fra kommandolinen: MSTest.exe Via MS Build Task Integration i en større sammenhæng: Kildekode kontrol Issue / Work item tracking Microsoft Solutions Framework
Admin & Kørsel af Tests
ASP.NET Performance Problemer Hvordan opfører jeres applikationer sig under load? Hvilken funktionalitet har størst performanceimpact? Processor / disk forbrug? Er i nødt til at deploye til en produktions server for at kunne teste?
ASP.NET Load Testing Integreret i VSTS for SW Testers Anvender test scripts til scenarierne Browser / bruger load / server kontrol (?) Visualisering af resultater Grafer Login script - 10% Browse script - 60% Search script - 30% Web Site Tabeller XML
Work Load Modellering Modeller brugadfærd, load, browsertyper og netværksforbrug vha. scenarier Web tests Load Pattern Unit tests
Definer Counter Sets Foruddefinerede counters til de forskellige teknologier
Tærskel definitioner
Load Test Profiler Constant Step Goal Seeking Øg load indtil et mål er nået F.eks. øg loadet indtil load agentens CPU er på 90%, og hold derefter loadet stabilt
Load Test Monitor
Load Test Monitor Sort by response time Goal-based Performance Reporting
Load Test Monitor Lav skræddersyede grafer til at sammenholde responstider med server aktivitet Tærskel alarmer Bor ind for at gennemgå fejl detajlerne Sorter data kolonnerne for nemt at finde langsomme web sider Automatisk rapportering af “Page Times” Se hvilker web sider, der ikke står mål med performance kravene
Threshold Violations Drag counters From machines under test onto graph
Load Test Analyzer Al data opsamles i SQL Server til analyse Lav skræddersyede grafer til at sammenligne maskinaktivitet med performance Zoom ind for at grave dybere i analysen
Click and drag to zoom
Zoom Control
VSTS Team Test Load Agents Scale out load generation IP Switching Distributed f-test Share rig with team
Fordele – Load Testing Scale out load generering Effektiv load generering (1000 virtuelle brugere på en typisk maskine med en typisk web test) IP Switching til test af web farme Per CPU licensiering (ingen virtuel bruger lic.) Performance counters opsamles på Load Agents og maskiner under test Data (stats og logs) gemmes i central TFS SQL Server til analyse Load Test Monitor giver mulighed for monitorering af igangværende load test
Agenda Mål for VSTS og TFS Tests: Hvorfor, Hvornår og Hvad? Testning med VSTS Test Typer Administration og Kørsel af Tests i VSTS Load Testing Build management med Team Build Et par gode råd Afrunding inkl. spørgsmål og svar 48
Team Foundation Build Out-of-the-box daglige builds En god build proces kan være svær at opnå Mange udviklingsprojekter udnytter ikke muligheden Mål: Gør det trivielt Builds gøres reproducerbare VS Projekter bygges direkte Builds udføres automatiskt via scheduler eller on-demand Build rapporter publiseres centralt Mål: Tæt integration med VS Team System værktøjerne, heriblandt: Kodeanalyse, unit tests, web test mv. We have a pretty sophisticated build process at Microsoft. Decided to build a sophisticated build system into Team Foundation. Not just talking about compiling. A lot more to creating a testable configuration than just compiling. Goal: Do an end to end build process out of the box for little to no effort. Want to make builds reproducible. Builds can be scheduled or on-demand. Do it now or do it nightly. Build reports – what files, what work items, test results, code coverage. Captures all information about the build. Can see “Oh yesterday was a good build. Today’s is broken. Tight integration with all VS tool.
Build Automatisering Build initiated from server Create a build ID Document build environment Sync sources and tools Compile and analyze Execute tests Update work items Build process – customizable. This is the process in the box. Build initiated from server. Create build ID – generate it how you like. Stamp all binaries that get built with build number. Document build environment – capture build environment so build is reproducible. Synch sources from version control system. Compile and run static analysis. Execute tests. If tests fail, can have it notify you. Update work items – testers need to know which build resolved particular bugs. Produce list of all work items fixed in the build, and stamp work items with the build number. Calculate code coverage – how effective tests were. Code churn – how much of my code has changed. How many bugs are incoming per line of code churn. Build report – publish all of the above information. Publish build to Web site. Calculate code coverage Calculate code churn Produce build report Publish build
Build verification test results as part of the build process Team Foundation Build Build verification test results as part of the build process Who checked in what?
Agenda Mål for VSTS og TFS Tests: Hvorfor, Hvornår og Hvad? Testning med VSTS Test Typer Administration og Kørsel af Tests i VSTS Load Testing Build management med Team Build Et par gode råd Afrunding inkl. spørgsmål og svar 52
Udvikler/Tester samarbejde En test er en test er en test Testere bruger udv. unit tests til Build Verification Tests (BVT) eller i funktionelle test kørsler Udv. bruger testeres tests som Checkin tests Udv. bruger testeres tests til gennemgang af test resultater og reproduktion af bugs Integreret bug tracking
Udnyt de integrerede muligheder i TFS Udnyt Team Build og integrer: Change sets Work items Tests ved at builde jævnligt Rapportering Test Case Management Think about creating builds, using reporting and managing tests; the big advantage of TFS is the ability to integrate this data with your version control
Agenda Mål for VSTS og TFS Tests: Hvorfor, Hvornår og Hvad? Testning med VSTS Test Typer Administration og Kørsel af Tests i VSTS Load Testing Build management med Team Build Et par gode råd Afrunding inkl. spørgsmål og svar 55
Afrunding VSTS for SW Testers er: Stærk integration med TFS Nem at komme i gang med: Deklarative tests Kodede tests med brug af kendte sprog: C#, VB.NET Test Administration og Afvikling Meget fleksibel og udvidbar Stærk integration med TFS Work-item tracking, sporbarhed mellem tests og andre artifakter Versionsstyring Rapport faciliteterne Kan generere stort load med Load Agent’s
Roadmap
VSTS Futures Business Analyst PMO Operations CIO Application Support Architect Project Manager Tester DB Pro Designer Developer Visual Studio Productivity Powerful Ease of use World class IDE Broad reach VS Team System Expand to development team Project transparency Team collaboration Software quality
Links mv. VSTS for SW Tester relaterede blogs: Nogle relevante links: http://blogs.msdn.com/VSTSQualityTools/ http://blogs.msdn.com/vstsloadtestblog/ http://blogs.msdn.com/edglas/ http://blogs.msdn.com/joshch/ http://blogs.msdn.com/slumley/ Nogle relevante links: VSTS Software Tester Team Center: http://msdn2.microsoft.com/en-us/teamsystem/aa718941.aspx Web Test Authoring and Debugging Techniques (artikel): http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/WTAuthDebug.asp Testing Web Services (artikel): http://msdn2.microsoft.com/en-us/library/ms243399(VS.80).aspx VSTS “Power in Simplicity” Webcasts: http://www.microsoft.com/events/series/msdnvsts2005.mspx VSTS On-demand Webcasts: http://msdn2.microsoft.com/en-us/teamsystem/aa718763.aspx VSTS tutorials, demos and videos http://msdn.microsoft.com/teamsystem http://teamsystemrocks.com
For VSTS/TFS brugere TechTalks Dansk VSTS/TFS ERFA gruppe Kontaktperson: Anja Besserman e-mail: anja@commentor.dk tlf: (+45) 44 53 07 60 VSTS/TFS Implementerings Partnere
Mange support muligheder MSDN Forums MSDN Managed Newsgroups Microsoft Support Sites/communities
Spørgsmål og svar? evt. skriv til: martinpa@microsoft.com og check blog’en: http://blogs.msdn.com/martinpa (link til præsentation og level 200 VSTS træningsmateriale)
©2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.