SlideShare a Scribd company logo
1 of 40
Writing High Quality Visual Studio Extensions
Omer Raviv | omerr@codevalue.net | @omerraviv
www.oz-code.com | @oz_code
Testable, stable, performant, memory efficient
2
@omerraviv on Twitter (twitter picture)
@omerraviv on Gitter.im/extendvs (Gitter logo)
Omer Raviv
• Creator and CTO of OzCode
• Senior Consultant @ CodeValue
• .NET open-source enthusiast
• Passionate about dev productivity
@omerraviv on Twitter
@omerraviv on Gitter (gitter.im/extendvs)
My Journey as a developer
Every minute
spent in the debugger
is a minute squandered
The two most common ways to use a debugger:
1. Wasting time
2. Quality time
Wasting time:
Not knowing what your hypothesis is at any given time
Getting into a rot mindlessly hitting F10
Quality time:
Apply the Scientific Method, religiously
Simplify the scenario, then write a test!
The Debugging Process Overview
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Why can’t
Johnny do Test
Driven
Development?
A typical unit test
Test Driven Woes
2 Unit Tests. 0 Integration Tests.
UI
System/
Subcutaneous
Unit
Automation
Harder
Easier
Exploration
Mike Cohn’s Test
Automation Pyramid
Writing test at the right level of granularity
UI
System/
Subcutaneous
Unit
Exploration
Writing test at the right level of granularity
Microsoft/VisualStudio-TestHost/TestUtilities , PTVS
JaredPar/VsVim/Test
OzCode/VSIntegrationTestSamples
• Synthesis and refinement of practices stemming from TDD & ATDD
• User story:
"As a [role] I want [feature] so that [benefit]”
• Acceptance Criteria
Given [initial context]
When [event occurs]
Then [ensure some outcome]
What’s this BDD thing?
Create living, executable
Specification.
New feature?
Can I see the
requirements doc
please?
What’s BDD all about?
• Use natural language to express intentions (Given…When…Then)
• Use a general purpose programming language
to express test mechanics
• Use a tool that will let you operate in either domain seamlessly
BDD offers a solution
Michael WhelanMehdi Khalili Jake Ginnivan Jason Roberts
PM> Install-Package TestStack.BDDfy
• Works with any testing framework
• Does not require its own test runner
• Creates Humanized, story-like error messages
A few quick BDDfy facts:
Demo time!
My very first Visual Studio
Subcutaneous Test
Having flakey tests is a lot worse than having no tests at all.
A flakey test is like a virus –
quarantine it, then triage.
Visual Studio Integration Tests Pro-Tip
Writing High Quality Visual Studio extensions
Omer Raviv | omerr@codevalue.net | @omerraviv
www.oz-code.com | @oz_code
Testable, stable, performant, memory efficient
The ActivityLog.xml
MessageBox
…of pain and suffering
The ActivityLog.xml
MessageBox
…of pain and suffering github.com/oz-code/OzCode.VisualStudioExtensionAnalyzers
PM> Install-Package OzCode.VisualStudioExtensionAnalyzers
Use an Exception Monitoring Tool
Use an Exception Monitoring Tool
Use an Exception Monitoring Tool
Dealing with crashes
Starting with VS2017.3, users get a notification if an exception might be involved in a crash.
https://gist.github.com/oz-code/76446034c493685bfaabdd5aecc43180
Dealing with crashes
Writing High Quality Visual Studio extensions
Omer Raviv | omerr@codevalue.net | @omerraviv
www.oz-code.com | @oz_code
Testable, stable, performant, memory efficient
Visual Studio 2017 will warn users about extensions that are slowing things down.
Performance as a Feature
1. Delay loading your extension as much as possible (using UIContextRule)
2. When you do load, load in the background. (using AsyncPackage)
Performance as a Feature
OzCode F10 Monkey
http://www.github.com/oz-code/VSExplorationTests
Writing High Quality Visual Studio extensions
Omer Raviv | omerr@codevalue.net | @omerraviv
www.oz-code.com | @oz_code
Testable, stable, performant, memory efficient
Memory Leaks vs. GC Pressure
GC Pressure:
Memory Leak:
Memory Leaks vs. GC Pressure
Pro-Tip: Don’t Close your Diagnostics Tools Window!
Dealing with GC Pressure
Memory Leaks vs. GC Pressure
• Always be measuring (allocations, % time spent in GC)
• Watch out for duplicate strings
• Use object pooling / a string intern pool
• Use Roslyn Heap Allocation Analyzer
github.com/jaredpar/vsvim
Memory Leak Testing
Subcutaneous Tests Pro-Tip
Memory Leak Testing
Subcutaneous Tests Pro-Tip
Which means…
…a business sponsor could request that the current
development version of the software can be deployed
into production at a moment's notice - and nobody
would bat an eyelid, let alone panic.
Got good Subcutaneous Tests?
Start practicing True Continuous Delivery!
Martin Fowler
Thank You!
@oz_code
http://oz-code.com

More Related Content

What's hot

Android tutorials1 install_ide
Android tutorials1 install_ideAndroid tutorials1 install_ide
Android tutorials1 install_ide
Vlad Kolesnyk
 

What's hot (14)

Outside-in Testing in Vue with Cypress
Outside-in Testing in Vue with CypressOutside-in Testing in Vue with Cypress
Outside-in Testing in Vue with Cypress
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best Practices
 
KidoZen Mastering Unit Testing in Xamarin
KidoZen Mastering Unit Testing in Xamarin KidoZen Mastering Unit Testing in Xamarin
KidoZen Mastering Unit Testing in Xamarin
 
Introduction to Integration Testing With Cypress
Introduction to Integration Testing With CypressIntroduction to Integration Testing With Cypress
Introduction to Integration Testing With Cypress
 
MITT - Security OSS in DevOps
MITT - Security OSS in DevOpsMITT - Security OSS in DevOps
MITT - Security OSS in DevOps
 
Android tutorials1 install_ide
Android tutorials1 install_ideAndroid tutorials1 install_ide
Android tutorials1 install_ide
 
Perfect Project Read Me (in a few steps)
Perfect Project Read Me (in a few steps)Perfect Project Read Me (in a few steps)
Perfect Project Read Me (in a few steps)
 
Groovy Testing Aug2009
Groovy Testing Aug2009Groovy Testing Aug2009
Groovy Testing Aug2009
 
Spring competitive tests
Spring competitive testsSpring competitive tests
Spring competitive tests
 
Cvavr to _ isis simulation
Cvavr to _ isis simulationCvavr to _ isis simulation
Cvavr to _ isis simulation
 
Intro to CI/CD using Docker
Intro to CI/CD using DockerIntro to CI/CD using Docker
Intro to CI/CD using Docker
 
Chennai.rb testing workshop mar 5, 2016
Chennai.rb testing workshop mar 5, 2016Chennai.rb testing workshop mar 5, 2016
Chennai.rb testing workshop mar 5, 2016
 
e2e testing with cypress
e2e testing with cypresse2e testing with cypress
e2e testing with cypress
 
Healthy DevOps - Masto Sitorus
Healthy DevOps - Masto SitorusHealthy DevOps - Masto Sitorus
Healthy DevOps - Masto Sitorus
 

Similar to Creating High Quality Visual Studio extensions

Understand release engineering
Understand release engineeringUnderstand release engineering
Understand release engineering
gaoliang641
 
Agile latvia evening_unit_testing_in_practice
Agile latvia evening_unit_testing_in_practiceAgile latvia evening_unit_testing_in_practice
Agile latvia evening_unit_testing_in_practice
denis Udod
 

Similar to Creating High Quality Visual Studio extensions (20)

Topic production code
Topic production codeTopic production code
Topic production code
 
Implementing Quality on a Java Project
Implementing Quality on a Java ProjectImplementing Quality on a Java Project
Implementing Quality on a Java Project
 
Continuous delivery is more than dev ops
Continuous delivery is more than dev opsContinuous delivery is more than dev ops
Continuous delivery is more than dev ops
 
Understand release engineering
Understand release engineeringUnderstand release engineering
Understand release engineering
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
How to write good quality code
How to write good quality codeHow to write good quality code
How to write good quality code
 
Static Code Analysis: Keeping the Cost of Bug Fixing Down
Static Code Analysis:  Keeping the Cost of Bug Fixing DownStatic Code Analysis:  Keeping the Cost of Bug Fixing Down
Static Code Analysis: Keeping the Cost of Bug Fixing Down
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
 
Agile latvia evening_unit_testing_in_practice
Agile latvia evening_unit_testing_in_practiceAgile latvia evening_unit_testing_in_practice
Agile latvia evening_unit_testing_in_practice
 
Continuous Everything
Continuous EverythingContinuous Everything
Continuous Everything
 
Owasp tds
Owasp tdsOwasp tds
Owasp tds
 
codecept.js introduce - front end test E2E tool introduce
codecept.js introduce - front end test E2E tool introducecodecept.js introduce - front end test E2E tool introduce
codecept.js introduce - front end test E2E tool introduce
 
Agility Requires Safety
Agility Requires SafetyAgility Requires Safety
Agility Requires Safety
 
How ANDROID TESTING changed how we think about Death - Second Edition
How ANDROID TESTING changed how we think about Death - Second EditionHow ANDROID TESTING changed how we think about Death - Second Edition
How ANDROID TESTING changed how we think about Death - Second Edition
 
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdfDifferent Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
 
What Visual Studio Code can do for Java Development
What Visual Studio Code can do for Java DevelopmentWhat Visual Studio Code can do for Java Development
What Visual Studio Code can do for Java Development
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
 
Automatic for the People
Automatic for the PeopleAutomatic for the People
Automatic for the People
 

Recently uploaded

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Recently uploaded (20)

%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 

Creating High Quality Visual Studio extensions

Editor's Notes

  1. Roslyn analyzer example, F10 exploration test