Debugging and Testing

Photo by UX Indonesia on Unsplash

Can you learn to debug?

Photo by Mikhail Nilov: https://www.pexels.com/photo/a-boy-wearing-long-sleeves-sweater-pulling-his-hair-7929277/

Different Levels of Debugging

Debugging 101: Local debugging

Debugging 201: Remote Debugging

  • Wrong data: input and output formats might mismatch or data are truncated or missing.
  • Wrong versions: dependencies come as libraries (static or runtime ) or APIs. Static dependencies are easy to spot and debug. API version mismatches are rare and any breaking changes are announced early. The most difficult to debug are runtime dependencies. In older Microsoft Windows systems, the term ‘DLL Hell’ sent shivers down the spine of any Windows developer. DLLs are dynamically linked libraries that are shared runtime libraries specific to Windows.
  • Wrong timing: Asynchronous calls or multithreaded programs create nasty bugs that have to do with timing. Bugs occur very infrequently and are very hard to repro and debug.
  • Wrong environment: The environment problem is probably the most frequent issue you will encounter in a remote environment. Some bugs can be reproed only in a certain environment: e.g., a specific browser, certain hardware types, OS versions, etc.

Debugging 301: Debugging in Prod

Photo by Joshua Hoehne on Unsplash
  1. Logging: Since remote debugging is next to impossible, logging is the next best tool for debugging. Sprinkle logging statements throughout your program but judiciously so that you can trace the program easily when bugs are reported. The recommendation is to keep at least a few months of log data. Raw log files are also extracted and transformed using an ELK Stack tool for better searching and debugging.
  2. Crash reports: Crash reports allow for collecting more debug information useful to the developers. Windows and Mac both have a crash reporting functionality and ask for user consent before sending it. The crash report should include the hardware specs, date and time, OS type and version info as well as the call stack.
  3. Telemetry: Telemetry refers to collected data from remote machines. User actions like clickstreams can reveal valuable usage patterns that can guide the feature team for the next iteration of development and testing.

Debugging and Testing

The Testing pyramid

Conclusion

References

--

--

--

AI researcher | Software Developer | Tester | ex-Microsoftie | ex-Amazonian

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Deployment of spring boot artifacts on to Google cloud Kubernetes Engine with Jenkins.

Creating a Twitter App and Searching and Storing Tweets in R

From Build to Launch in 5 weeks with Firebase, Flamelink and Flutter.

Bandit Python assert

Nutanix AHV and Next Generation Firewalls

| Engineering News-Record

Go: Ordering in Select Statements

Python Frameworks for Mobile App Development: An In-Depth Comparison

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Changsin Lee

Changsin Lee

AI researcher | Software Developer | Tester | ex-Microsoftie | ex-Amazonian

More from Medium

Debugging the debug process

Unit testing is overkill, or it isn’t?

How can we improve our Git Commits using Husky?

Level Up as a Software Engineer by Writing a Chess Engine