SlideShare une entreprise Scribd logo
1  sur  29
Debugging with Visual Studio Beyond ‘F5’
Dror Helper (@dhelper)
About.ME
Consultant & software architect @ Practical Software
Developing software since 2002
Clean Coder & Test-Driven Developer
Pluralsight author
Blogger: http://helpercode.com
Twitter: @dhelper
Why I hate debugging:
It’s never
planned
Usually
complicated
Extremely
frustrating
Tend to be
stressful
Always time consuming
Why debugging consumes so much
time?
There are 0b10 types of developers
A practical approach to debugging
1. Reproduce the problem
2. Get to where the issue happens
3. Analyze the system state
4. Create hypothesis
5. Fix the bug
6. Verify your solution
7. Celebrate
Reasons to use the debugger
Gather
information
Prove
hypothesis
Check solution
Reproduce the issue
Is it reproducible?
Is it reproducible on my machine?
What input caused the problem?
When was the last time it worked?
Answer those questions before continuing to the next step!
Get to where the issue is
How to waste time:
- Not knowing where we’re going
- Running through all the code
- Multiple reruns + long startup time
Immediate
window
Exception
thrown
Breakpoints
Who can help us get to the bug
Immediate window
debug and evaluate expressions
execute statements
print variable values
Stop on exceptions
We can tell Visual Studio to break whe
- An exception is thrown and not handled
- An exception is thrown
* Reduce noise using exception type
Breakpoints
Pause execution
So I can inspect my code
• Always
• Conditional
• Trace*
• Data (VS2019)
Data breakpoints
New in VS2019
.NET Core 3.0 only!
Value must be on the managed heap
Gathering information
Understand all the information
Don’t waste time traveling your code
Quickly find relevant information
Learn to use your keyboard
Reduce mental overhead
Debug naturally
Tracepoints
Special kind of breakpoint
Log information instead of stopping
Use text and existing variables
When to use Tracepoints
Huge data + iterations (LINQ)
Multi-Threading
Sync issues (up to a point)
Visual Studio’s tool windows
Simple – Stack, Watches, Exceptions, Breakpoints
Advanced – Tasks, Threads, Modules
Make Object Id
Distinguish between different instances
Track an object even if it’s out of scope
Debugging parallel code
Tracepoints for ad-hoc logging
Tasks/Threads to find Blocked/Deadlocks
Parallel Stacks to understand flow
Parallel Watch
22
Parallel Task & Parallel Stacks
View the logical call, the logical call stack and the task/thread state
Understanding your data
Use Make Object Id to follow specific instances
Search for objects and properties in Watch windows (VS019)
Format how your data is displayed
- ToString
- DebbugerDisplayAttribute
Edit & Continue during Fix – Build – Run cycles
Immediate window to avoid crash on exception
Edit values to for and prove hypothesis
Avoid restarting your debugger
Edit & Continue
Make sure Edit and Continue is enabled!
Check list of supported/unsupported changes
https://github.com/dotnet/roslyn/wiki/EnC-Supported-Edits
... Or just try and find out
What we’ve learnt
Reproduce Analyze Hypothesis Fix Verify
Better debugging
Using Visual Studio capabilities
A structured process of finding and eliminating bugs
Dror Helper | @ dhelper | http://helpercode.com
Thank you!
Debugging with visual studio beyond 'F5'

Contenu connexe

Tendances

6 easy steps to get started learning artificial intelligence
6 easy steps to get started learning artificial intelligence6 easy steps to get started learning artificial intelligence
6 easy steps to get started learning artificial intelligenceManju Nath
 
How to improve your skills as a programmer
How to improve your skills as a programmerHow to improve your skills as a programmer
How to improve your skills as a programmerYun Yuan
 
The Fault In Our Code
The Fault In Our CodeThe Fault In Our Code
The Fault In Our CodeCamilo Payan
 
Automatic Question Paper Generator
Automatic Question Paper GeneratorAutomatic Question Paper Generator
Automatic Question Paper GeneratorAbdul Wahid
 

Tendances (7)

6 easy steps to get started learning artificial intelligence
6 easy steps to get started learning artificial intelligence6 easy steps to get started learning artificial intelligence
6 easy steps to get started learning artificial intelligence
 
How to improve your skills as a programmer
How to improve your skills as a programmerHow to improve your skills as a programmer
How to improve your skills as a programmer
 
The Fault In Our Code
The Fault In Our CodeThe Fault In Our Code
The Fault In Our Code
 
Successful developers
Successful developersSuccessful developers
Successful developers
 
Java
JavaJava
Java
 
Hci final presentation
Hci final presentationHci final presentation
Hci final presentation
 
Automatic Question Paper Generator
Automatic Question Paper GeneratorAutomatic Question Paper Generator
Automatic Question Paper Generator
 

Similaire à Debugging with visual studio beyond 'F5'

Visual Studio tricks every dot net developer should know
Visual Studio tricks every dot net developer should knowVisual Studio tricks every dot net developer should know
Visual Studio tricks every dot net developer should knowDror Helper
 
Testing & should i do it
Testing & should i do itTesting & should i do it
Testing & should i do itMartin Sykora
 
iOS development best practices
iOS development best practicesiOS development best practices
iOS development best practicesMichal Juhas
 
Win at life with unit testing
Win at life with unit testingWin at life with unit testing
Win at life with unit testingmarkstory
 
Advanced java script essentials v1
Advanced java script essentials v1Advanced java script essentials v1
Advanced java script essentials v1ASHUTOSHPATKAR1
 
Life of a Remote Developer - Productivity tips (MSBuild 2020)
Life of a Remote Developer - Productivity tips (MSBuild 2020)Life of a Remote Developer - Productivity tips (MSBuild 2020)
Life of a Remote Developer - Productivity tips (MSBuild 2020)Davide Benvegnù
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In ActionJon Kruger
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Mehdi Khalili
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven DevelopmentPablo Villar
 
Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)David Wesst
 
Productive Programmer - Using IDE effectively and various small practices to ...
Productive Programmer - Using IDE effectively and various small practices to ...Productive Programmer - Using IDE effectively and various small practices to ...
Productive Programmer - Using IDE effectively and various small practices to ...Bhavin Javia
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Ivo Jansch
 
Unit Testing Full@
Unit Testing Full@Unit Testing Full@
Unit Testing Full@Alex Borsuk
 
The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debuggingsvilen.ivanov
 
Android design patterns
Android design patternsAndroid design patterns
Android design patternsVitali Pekelis
 

Similaire à Debugging with visual studio beyond 'F5' (20)

Visual Studio tricks every dot net developer should know
Visual Studio tricks every dot net developer should knowVisual Studio tricks every dot net developer should know
Visual Studio tricks every dot net developer should know
 
Testing & should i do it
Testing & should i do itTesting & should i do it
Testing & should i do it
 
iOS development best practices
iOS development best practicesiOS development best practices
iOS development best practices
 
Debugging
DebuggingDebugging
Debugging
 
Win at life with unit testing
Win at life with unit testingWin at life with unit testing
Win at life with unit testing
 
Advanced java script essentials v1
Advanced java script essentials v1Advanced java script essentials v1
Advanced java script essentials v1
 
Automated tests
Automated testsAutomated tests
Automated tests
 
Is Python still production ready ? Ludovic Gasc
Is Python still production ready ? Ludovic GascIs Python still production ready ? Ludovic Gasc
Is Python still production ready ? Ludovic Gasc
 
Life of a Remote Developer - Productivity tips (MSBuild 2020)
Life of a Remote Developer - Productivity tips (MSBuild 2020)Life of a Remote Developer - Productivity tips (MSBuild 2020)
Life of a Remote Developer - Productivity tips (MSBuild 2020)
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In Action
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven Development
 
Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)
 
Productive Programmer - Using IDE effectively and various small practices to ...
Productive Programmer - Using IDE effectively and various small practices to ...Productive Programmer - Using IDE effectively and various small practices to ...
Productive Programmer - Using IDE effectively and various small practices to ...
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
 
Unit Testing Full@
Unit Testing Full@Unit Testing Full@
Unit Testing Full@
 
The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debugging
 
Android design patterns
Android design patternsAndroid design patterns
Android design patterns
 

Plus de Dror Helper

Unit testing patterns for concurrent code
Unit testing patterns for concurrent codeUnit testing patterns for concurrent code
Unit testing patterns for concurrent codeDror Helper
 
The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutDror Helper
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better codeDror Helper
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better codeDror Helper
 
A software developer guide to working with aws
A software developer guide to working with awsA software developer guide to working with aws
A software developer guide to working with awsDror Helper
 
The secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutThe secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutDror Helper
 
The role of the architect in agile
The role of the architect in agileThe role of the architect in agile
The role of the architect in agileDror Helper
 
Harnessing the power of aws using dot net core
Harnessing the power of aws using dot net coreHarnessing the power of aws using dot net core
Harnessing the power of aws using dot net coreDror Helper
 
Developing multi-platform microservices using .NET core
 Developing multi-platform microservices using .NET core Developing multi-platform microservices using .NET core
Developing multi-platform microservices using .NET coreDror Helper
 
Harnessing the power of aws using dot net
Harnessing the power of aws using dot netHarnessing the power of aws using dot net
Harnessing the power of aws using dot netDror Helper
 
Secret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutSecret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutDror Helper
 
C++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the uglyC++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the uglyDror Helper
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy codeDror Helper
 
Secret unit testing tools
Secret unit testing toolsSecret unit testing tools
Secret unit testing toolsDror Helper
 
Electronics 101 for software developers
Electronics 101 for software developersElectronics 101 for software developers
Electronics 101 for software developersDror Helper
 
Navigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupNavigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupDror Helper
 
Building unit tests correctly
Building unit tests correctlyBuilding unit tests correctly
Building unit tests correctlyDror Helper
 
Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbgDror Helper
 
Unit testing patterns for concurrent code
Unit testing patterns for concurrent codeUnit testing patterns for concurrent code
Unit testing patterns for concurrent codeDror Helper
 
Designing with tests
Designing with testsDesigning with tests
Designing with testsDror Helper
 

Plus de Dror Helper (20)

Unit testing patterns for concurrent code
Unit testing patterns for concurrent codeUnit testing patterns for concurrent code
Unit testing patterns for concurrent code
 
The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you about
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better code
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better code
 
A software developer guide to working with aws
A software developer guide to working with awsA software developer guide to working with aws
A software developer guide to working with aws
 
The secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutThe secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you about
 
The role of the architect in agile
The role of the architect in agileThe role of the architect in agile
The role of the architect in agile
 
Harnessing the power of aws using dot net core
Harnessing the power of aws using dot net coreHarnessing the power of aws using dot net core
Harnessing the power of aws using dot net core
 
Developing multi-platform microservices using .NET core
 Developing multi-platform microservices using .NET core Developing multi-platform microservices using .NET core
Developing multi-platform microservices using .NET core
 
Harnessing the power of aws using dot net
Harnessing the power of aws using dot netHarnessing the power of aws using dot net
Harnessing the power of aws using dot net
 
Secret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutSecret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you about
 
C++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the uglyC++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the ugly
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy code
 
Secret unit testing tools
Secret unit testing toolsSecret unit testing tools
Secret unit testing tools
 
Electronics 101 for software developers
Electronics 101 for software developersElectronics 101 for software developers
Electronics 101 for software developers
 
Navigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupNavigating the xDD Alphabet Soup
Navigating the xDD Alphabet Soup
 
Building unit tests correctly
Building unit tests correctlyBuilding unit tests correctly
Building unit tests correctly
 
Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbg
 
Unit testing patterns for concurrent code
Unit testing patterns for concurrent codeUnit testing patterns for concurrent code
Unit testing patterns for concurrent code
 
Designing with tests
Designing with testsDesigning with tests
Designing with tests
 

Dernier

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
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-learnAmarnathKambale
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Dernier (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
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
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Debugging with visual studio beyond 'F5'

  • 1. Debugging with Visual Studio Beyond ‘F5’ Dror Helper (@dhelper)
  • 2. About.ME Consultant & software architect @ Practical Software Developing software since 2002 Clean Coder & Test-Driven Developer Pluralsight author Blogger: http://helpercode.com Twitter: @dhelper
  • 3. Why I hate debugging: It’s never planned Usually complicated Extremely frustrating Tend to be stressful Always time consuming
  • 4. Why debugging consumes so much time?
  • 5. There are 0b10 types of developers
  • 6. A practical approach to debugging 1. Reproduce the problem 2. Get to where the issue happens 3. Analyze the system state 4. Create hypothesis 5. Fix the bug 6. Verify your solution 7. Celebrate
  • 7. Reasons to use the debugger Gather information Prove hypothesis Check solution
  • 8. Reproduce the issue Is it reproducible? Is it reproducible on my machine? What input caused the problem? When was the last time it worked? Answer those questions before continuing to the next step!
  • 9. Get to where the issue is How to waste time: - Not knowing where we’re going - Running through all the code - Multiple reruns + long startup time
  • 11. Immediate window debug and evaluate expressions execute statements print variable values
  • 12. Stop on exceptions We can tell Visual Studio to break whe - An exception is thrown and not handled - An exception is thrown * Reduce noise using exception type
  • 13. Breakpoints Pause execution So I can inspect my code • Always • Conditional • Trace* • Data (VS2019)
  • 14. Data breakpoints New in VS2019 .NET Core 3.0 only! Value must be on the managed heap
  • 15. Gathering information Understand all the information Don’t waste time traveling your code Quickly find relevant information
  • 16. Learn to use your keyboard Reduce mental overhead Debug naturally
  • 17. Tracepoints Special kind of breakpoint Log information instead of stopping Use text and existing variables
  • 18. When to use Tracepoints Huge data + iterations (LINQ) Multi-Threading Sync issues (up to a point)
  • 19. Visual Studio’s tool windows Simple – Stack, Watches, Exceptions, Breakpoints Advanced – Tasks, Threads, Modules
  • 20. Make Object Id Distinguish between different instances Track an object even if it’s out of scope
  • 21. Debugging parallel code Tracepoints for ad-hoc logging Tasks/Threads to find Blocked/Deadlocks Parallel Stacks to understand flow
  • 23. Parallel Task & Parallel Stacks View the logical call, the logical call stack and the task/thread state
  • 24. Understanding your data Use Make Object Id to follow specific instances Search for objects and properties in Watch windows (VS019) Format how your data is displayed - ToString - DebbugerDisplayAttribute
  • 25. Edit & Continue during Fix – Build – Run cycles Immediate window to avoid crash on exception Edit values to for and prove hypothesis Avoid restarting your debugger
  • 26. Edit & Continue Make sure Edit and Continue is enabled! Check list of supported/unsupported changes https://github.com/dotnet/roslyn/wiki/EnC-Supported-Edits ... Or just try and find out
  • 27. What we’ve learnt Reproduce Analyze Hypothesis Fix Verify Better debugging Using Visual Studio capabilities A structured process of finding and eliminating bugs
  • 28. Dror Helper | @ dhelper | http://helpercode.com Thank you!

Notes de l'éditeur

  1. Need to find better way to show the steps and where the debugger comes in
  2. Never ever start your debugger without a clear idea of where to go and what to check
  3. What happens if I can’t? - Help from you team
  4. When you use the debugger you want it to be a simple intuitive experience which means you do not want o use the mouse, you need the keyboard, and without thinking which requires some practice, especially since duerring debnugging we too frustrated to learn new stuff
  5. What cause it? When did it start? Inputs/env Get to the issue Gather information Why it happen? Prove!